Open 31KM opened 2 years ago
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.
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 https://github.com/i3/i3/issues/2088. For example, it is not working with i3bar:Instead, a better approach seems to be to use a lib based on libappindicator, e.g. tray-item-rs.
See https://github.com/kondinskis/hyperx-cloud-flight/issues/11 for related discussion.