Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No tray icon on KDE #4

Open
arabine opened this issue Feb 25, 2022 · 6 comments
Open

No tray icon on KDE #4

arabine opened this issue Feb 25, 2022 · 6 comments

Comments

@arabine
Copy link

arabine commented Feb 25, 2022

Hello,

There is no tray icon visible on KDE. I don't know where to start but I can propose a patch if someone has some hints.

@dmikushin
Copy link
Owner

dmikushin commented Feb 6, 2023

Hi @arabine , thank you for reporting this. I think the issue is connected to the use of a special functional kind of icon, as explained below. I provide the following example for Gnome 3 Shell:

screenshot_linux.png

As you can see, the icon is set to "envelope" by the following lines of code:

#define TRAY_ICON1 "indicator-messages"
#define TRAY_ICON2 "indicator-messages-new"

My guess is that these two have no valid meaning in KDE and hence not respected, and tray icon is not shown at all.

I'd start by looking into how KDE encodes its special functional icons, such as notifications. A patch should offer a more portable way to use functional icons in different desktop environments.

Alternatively, you can specify a custom bitmap icon, and check whether it works in KDE (it should work out of the box). This could be a very useful test as well!

@arabine
Copy link
Author

arabine commented Mar 8, 2023

I tested with a standard icon name specified by the FreeDesktop and it works well on KDE: https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html

eg:

#define TRAY_ICON1 "mail-message-new"
#define TRAY_ICON2 "mail-message-new"

Screenshot_20230308_111945

I started a pull-request with multiple changes, including this topic.

@dmikushin
Copy link
Owner

Hi @arabine , thank you so much for working on this! I will review the PR #8 .

@ReenigneArcher
Copy link

ReenigneArcher commented Mar 13, 2023

I discovered that you can use your own icon if you place an svg directly in /usr/share/icons (I didn't test PNG, maybe that works as well). Only tested on Ubuntu. I tried using a subfolder, but it didn't work... maybe just need to define the icon differently in the code.

image

Then in your CMakeLists.txt

install(FILES "${CMAKE_SOURCE_DIR}/some-icon-name.svg" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons")

Is it possible to define the full path to the image instead of just some-icon-name? I'd prefer to not install to that icon location if possible.

I also found this list of icons which are probably more universally supported. https://github.com/GNOME/gtk/blob/main/demos/icon-browser/icon.list

@dmikushin
Copy link
Owner

@ReenigneArcher , yes you are right, one way is to install icon into /usr/share/icons. Another way is to embed icon into a binary, and hope that a desktop support its extraction - I don't think it's a popular choice at least due to performance reasons. Please propose a patch how do you envision icon customization in CMake.

cgutman pushed a commit to cgutman/tray that referenced this issue Dec 31, 2023
@dmikushin
Copy link
Owner

Dear all,

After this discussion @Rjvs has replaced GNOME-specific bindings with Qt6, which has been merged into the master branch of tray now. I would like to know what do you think of his solution. Do you still prefer to keep this appindicator solution for legacy purposes, or can it be dropped in favor of Qt6?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants