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

Tray icon support based on libappindicator #12

Open
31KM opened this issue Jul 21, 2022 · 1 comment
Open

Tray icon support based on libappindicator #12

31KM opened this issue Jul 21, 2022 · 1 comment

Comments

@31KM
Copy link

31KM commented Jul 21, 2022

The current tray icon implementation is based on ksni (using org.kde.StatusNotifierItem) and that standard seems to not be widely supported (anymore?) - see related discussion over at i3/i3#2088.
For example, it is not working with i3bar:

31KM: ~ dbus-monitor
...
method call time=1658403699.624431 sender=:1.107 -> destination=org.kde.StatusNotifierWatcher serial=3 path=/StatusNotifierWatcher; interface=org.kde.StatusNotifierWatcher; member=RegisterStatusNotifierItem
   string "org.kde.StatusNotifierItem-1661775-1"
error time=1658403699.624437 sender=org.freedesktop.DBus -> destination=:1.107 error_name=org.freedesktop.DBus.Error.ServiceUnknown reply_serial=3
   string "The name org.kde.StatusNotifierWatcher was not provided by any .service files"
...

Instead, a better approach seems to be to use a lib based on libappindicator, e.g. tray-item-rs.

See #11 for related discussion.

@31KM
Copy link
Author

31KM commented Jul 21, 2022

So libappindicator requires GTK to implement a menu. This, however, means that GTK will also need to become a dependency - with the consequence that it will dictate the GTK - or probably more general, UI - paradigm of the main loop. The loop { ... } in fn main() thus cannot be implemented that way as it blocks the main loop.

Also note that using libappindicator also introduces a .so dependency to libayatana-appindicator.

I started playing around with tray-item-rs but that apparently lacks the possibility to add a tooltip. So I moved to libappindicator directly as that is more flexible.

Note that I'm neither a rust nor GTK expert by any means, so I might have taken a wrong turn somewhere. But with a naive implementation I was able to get a tray icon - that has no functionality whatsoever (yet) though.

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

1 participant