Skip to content

[bug] Debian icons have mixed sources (png & icns) with tauricon defaults #4280

@betamos

Description

@betamos

Describe the bug

When using tauricon to generate app icons, the .deb bundle sources its icons from different files. Notably, this includes the .icns file. The docs state that file endings png, ico and icns correspond to Linux, Windows and MacOS respectively.

In particular, the files generated include all sizes from the icns file, if it is present. Looking at the source, it appears possible that also the ico file can be used.

I am using a different icon source file for MacOS (see reasons below), and when building a .deb, I get icons mixed in from the icns file.

Reproduction

  1. Generate an icon set from a source png using tauricon.
  2. Set the default/recommended(?) tauri.bundle.icon in tauri.conf.json:
    [icons/32x32.png, icons/128x128.png, icons/128x128@2x.png, icons/icon.icns, icons/icon.ico]
  3. Swap out the icns file for an entirely different icns file.
  4. Build the deb
  5. Verify the different icons in the data/usr/share/icons/hicolor dir. Some are from the icns, some are from the pngs. I see 10 different png files in different sizes and resolutions (compared with the 3 pngs in the src-tauri/icons dir).

Expected behavior

Honestly, it depends. I think the least surprising way is to copy over png files only, without the fallback. A lot of complexity is removed if png, ico and icns are platform-specific, and the fallback is removed. Omitting the fallback also allows power users to customize further, since only pngs are used in the long run. However, this would silently break icons for any user who currently does not have png files set up correctly.

Another option is to generate pngs from tauricon in even more resolutions and sizes, in order to prevent the fallback to kick in at all. However, this is quite wasteful and error prone to future changes.

That said, I haven't looked into the interactions with other uses of icons, such as the sys tray. Not sure if that changes anything.

Platform and versions

This is present in dev today.

Stack trace

No response

Additional context

There are several reasons one would use different icons for different platforms, and even multiple icon sources per platform:

  • In Apple's icon grid, the icon border has an inset from the actual image size (so that certain elements can "stick out" of the icon"). If you create such an image to fit for Mac, it will look too small on Windows and Linux.
  • On Mac it is very common with rounded squares, which are less common elsewhere. Discord, for instance, uses a circular unshaded icon on Linux and a shaded squircle on Mac.
  • On smaller sizes, details and bevel are often removed to make the icon more distinct and less cluttered.

I think it's fine with a default that uses a single source file, but it's important that this can be customized if necessary.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions