Skip to content

Instantly share code, notes, and snippets.

@Darkhogg
Last active May 7, 2024 10:20
Show Gist options
  • Save Darkhogg/1a73eaa29b8c604528c6596e24214588 to your computer and use it in GitHub Desktop.
Save Darkhogg/1a73eaa29b8c604528c6596e24214588 to your computer and use it in GitHub Desktop.
An attempt to document the status of Icon Theme support on applications and frameworks, as well as the efforts on expanding such support.

Icon Theme Support

Theming is a big part of the Linux desktop experience, and icon themes are a great way of customizing it to look how you want. Applications provide their own icons as fallback, but the way their menus, lists, file explorers and other interface elements is in the end dictated by the icon theme selected by the user.

The icons on the notification area are also part of this theming, and it's pretty nice to see icons looking consistent with a theme, particularly when they draw attention to themselves in a homogenous way instead of each application using different approaches.

This is why is particularly jarring when an application doesn't respect the user's theme, to the point that people have developed software like hardcode-tray to fix those applications the best way we as users can, and get back some consistency in our trays.

However, this is one of those problems that we simply shouldn't have. For one, changing one hardcoded icon for another keeps a lot of the issues that hardcoding has: multiple users of the same app can't have different themes, the icon will have one single size regardless of context, etc. Instead, we should push for applications to respect the user's theme in the first place, using the open standards that were set in place decades ago.

Fixing

This section aims to provide with a guide to fix this issue for application developers or contributors. If there's another framework or toolkit you'd like me to add, see the Contribute section.

Qt includes support for icon themes out of the box by using QIcon::fromTheme instead of the simple constructor.

- QIcon appicon(":/icon/extra/appname.png");
+ QIcon appicon = QIcon::fromTheme("appname-tray", QIcon(":/icon/extra/appname.png"));

Probably the worst offender of the bunch, Electron currently has absolutely no support for themed icons.

I recently made a feature request on the electron project, but it's currently impossible to implement something like this without support from Chromium itself. I plan to bring the discussion there too, but we'll see what comes out of that.

I am also currently working on making a Node library to load icons from icon themes on the application side (essentially an implementation of the XDG icon lookup algorithm), which will allow applications to load themed icons even if Electron never adds support, but this will come with some issues, like no SVG support, no ability to properly size the icon, etc.

Tauri doesn't seem to have support for themed icons at all. All icons are specified as paths to images, or can be updated programatically as "raw icons", which are just images.

I've made a feature request to the Tauri project, let's see what their response is.

Applications

In this section, I'd like to document offending applications that I or other people encounter, their status, and any other important information.

Slack - 🚫 Not fixable

Icon is completely unthemed.

This issue is currently unfixable because of lack of support from Electron.

I've had mixed results trying to fix it using hardcode-tray, but it's possible in theory.

teams-for-linux - 🚫 Not fixable

Icon is completely unthemed.

This issue is currently unfixable because of lack of support from Electron.

Base icon is fixable with hardcode-tray, but uses modified images for attention states.

Discord - 🚫 Not fixable

Icon is completely unthemed

This issue is currently unfixable because of lack of support from Electron.

Discord uses a self-updater and it extracts its icons to a directory inside your home every time it gets updated, which makes icons unfixable by hardcode-tray, and only fixable temporarily using other means.

Discover Overlay - βœ… Fixed

Tray icon was using the same name as application icon, making it impossible to theme them separately.

Reported in October 2020 in Issue #103 by me, fixed in October 2020 by Commit 63a9b31 by project's author

OBS Studio - βœ… Fixed

Icon was unthemed in some cases.

Fixed in September 2020 by PR #3425 by me

Radeon Profile - βœ… Fixed

Icon was completely unthemed.

Fixed in June 2020 by PR #208 by me

Contribute

If you'd like to contribute to this document with applications, solutions, open issues or PRs, or anything, please leave a comment on this Gist. If this gets enough attention, I'll probably convert it to a proper repository, but if you know of a different platform that can be more useful for this kind of living public document, I'd love to hear about it in the comments.

The best way to contribute, though is to share this document, open issues in projects that lack support, or even contribute solutions for open source projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment