fyne-io / systray

a cross platfrom Go library to place an icon and menu in the notification area
Apache License 2.0
223 stars 41 forks source link

systray not working on i3wm #75

Closed ismaelpadilla closed 5 months ago

ismaelpadilla commented 5 months ago

The systray example in the fyne docs isn't working for me on i3wm. I'm using Manjaro, I was previously using KDE Plasma before switching to i3, and I can confirm that the systray does work if I switch back to KDE.

When I run the app with go run ., I get the message:

2024/03/02 20:27:35 systray error: failed to register: The name is not activatable

I tried building the app and running with sudo, and I get the following:

2024/03/02 20:34:06 systray error: failed to register: The name org.kde.StatusNotifierWatcher was not provided by any .service files

Googling that message I ended up finding another issue in this repo (#64) but I'm not sure these issues are related.

For additional context, I'm using Polybar on version 3.7.1, and the tray works fine for other apps.

If there's anything I can do to provide additional info, or help in some other way, I'm happy to help.

ismaelpadilla commented 5 months ago

After some research, I looks like the problem is that Polybar does not support SystemNotifier tray icons (see https://github.com/polybar/polybar/issues/2010). For those running Polybar, a workaround may be to run snixembed. Indeed, while running snixembed, I can get the Fyne systray to work just fine :)

I don't know enough about this subject to know whether or not it's ok for the systray to not work in Polybar due to Polybar not supporting SystemNotifier tray icons. I will leave this issue open, but I'm ok with it being closed if this behavior is expected.

andydotxyz commented 5 months ago

As you found - the polybar plugin is using the "legacy" system tray (XEmbed) which we do not support - and most DE have moved away from. Plugins are available as you say that implement the newer standard (which isn't all that new). We have to use the new one as Wayland simply can't provide XEmbed ;)