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

Cannot create systray menu without StatusNotifierWatcher #30

Closed Elara6331 closed 1 year ago

Elara6331 commented 1 year ago

I run a window manager on Linux (specifically spectrwm). My systray is provided by Polybar, a separate program that creates a lightweight status bar for window managers. Whenever I try to set a systray menu, I get the following error:

2022/11/09 21:42:59 systray error: failed to register our icon with the notifier watcher (maybe no tray is running?): The name org.kde.StatusNotifierWatcher was not provided by any .service files

The systray is in fact running (I am looking right at it and it's full of other non-fyne icons), but org.kde.StatusNotifierWatcher does not appear in the output of a DBus ListNames call. The only related name I see is org.kde.StatusNotifierItem-611597-1 which seems to be coming from the fyne app itself as the PID 611597 corresponds to the running fyne app.

Elara6331 commented 1 year ago

This seems to be caused by polybar/polybar#2010, but I do believe it should be documented and wonder how all my other apps seem to work fine (including electron apps, unlike people in that issue are saying).

Elara6331 commented 1 year ago

The snixembed program mentioned in the issue I linked does seem to fix this, so I think maybe this should be documented somewhere.

andydotxyz commented 1 year ago

There is an old spec for system tray which we do not support. That old approach has been superseded in the mainstream many years ago. If you want to use that then go with the original systray project that we forked - their code is legacy only, ours is modern only.

Elara6331 commented 1 year ago

Yeah, I realized that when I found that polybar issue. Should this maybe be added to the documentation so that users that happen to be using WMs with systrays that adhere to the old standard know why fyne apps aren't appearing in their systray? Polybar is very popular amongst tiling WM users.

andydotxyz commented 1 year ago

Updated docs accordingly.