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 module not visible after some time. No such object path '/StatusNotifierWatcher' #3468

Open
HarshNarayanJha opened this issue Jul 23, 2024 · 16 comments

Comments

@HarshNarayanJha
Copy link

HarshNarayanJha commented Jul 23, 2024

After a few hours of logging into hyprland, the Tray Module does now show up after killing and launching waybar.

This does not happen before that point, I can kill waybar and start it again (via a keybind) and the tray and all its icons are still there. But after some time has passed, reloading waybar no longer shows the Tray Module, no matter how many times I reload.
But if I log out and login again, it immediately fixes the issue and the tray stays visible until the issue happens again.
Note that it never disappears automatically, only if I restart waybar.

Running waybar in terminal reveals the issue

...
[2024-07-23 19:38:36.383] [debug] Creating workspace 1
[2024-07-23 19:38:36.383] [debug] Creating workspace 2
[2024-07-23 19:38:36.496] [error] Host: GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: No such object path '/StatusNotifierWatcher'
[2024-07-23 19:38:36.613] [info] Bar configured (width: 1920, height: 40) for output: 
...

EDIT: Following issue #3040, I have downgraded libappindicator-gtk3 to v12.10.0.r296-1 with no success

Full Log
[2024-07-23 19:38:58.575] [debug] Try expanding: $XDG_CONFIG_HOME/waybar/config
[2024-07-23 19:38:58.575] [debug] Try expanding: $XDG_CONFIG_HOME/waybar/config.jsonc
[2024-07-23 19:38:58.576] [debug] Try expanding: $HOME/.config/waybar/config
[2024-07-23 19:38:58.576] [debug] Found config file: $HOME/.config/waybar/config
[2024-07-23 19:38:58.576] [info] Using configuration file /home/harshnj/.config/waybar/config
[2024-07-23 19:38:58.579] [info] Unable to receive desktop appearance: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop
[2024-07-23 19:38:58.579] [debug] Try expanding: $XDG_CONFIG_HOME/waybar/style.css
[2024-07-23 19:38:58.579] [debug] Try expanding: $HOME/.config/waybar/style.css
[2024-07-23 19:38:58.579] [debug] Found config file: $HOME/.config/waybar/style.css
[2024-07-23 19:38:58.579] [info] Using CSS file /home/harshnj/.config/waybar/style.css
[2024-07-23 19:38:58.580] [debug] Parsing imports for file: /home/harshnj/.config/waybar/style.css
[2024-07-23 19:38:58.580] [debug] Try expanding: $XDG_CONFIG_HOME/waybar/themes/theme.css
[2024-07-23 19:38:58.580] [debug] Try expanding: $HOME/.config/waybar/themes/theme.css
[2024-07-23 19:38:58.580] [debug] Found config file: $HOME/.config/waybar/themes/theme.css
[2024-07-23 19:38:58.580] [debug] Adding file to watch list: Catppuccin-Mocha.css
[2024-07-23 19:38:58.580] [debug] Adding file to watch list: /home/harshnj/.config/waybar/style.css
[2024-07-23 19:38:58.587] [debug] Output detection done: eDP-1 (AU Optronics 0x229E)
[2024-07-23 19:38:58.592] [info] Hyprland IPC starting
[2024-07-23 19:38:58.594] [debug] Initializing workspaces
[2024-07-23 19:38:58.595] [debug] Initializing persistent workspaces
[2024-07-23 19:38:58.595] [info] Loading persistent workspaces from Waybar config
[2024-07-23 19:38:58.595] [info] Loading persistent workspaces from Hyprland workspace rules
[2024-07-23 19:38:58.596] [info] Registering for Hyprland's 'windowtitle' events because a user-defined window rewrite rule uses the 'title' field.
[2024-07-23 19:38:58.616] [debug] network: new default route via 192.168.250.102 on if4 metric 600
[2024-07-23 19:38:58.616] [debug] network: wlan0, new addr 192.168.250.94/24
[2024-07-23 19:38:58.616] [debug] network: wlan0, new addr 192.168.250.94/24
[2024-07-23 19:38:58.641] [debug] Received SIGCHLD in signalThread
[2024-07-23 19:38:58.641] [debug] Cmd exited with code 0
[2024-07-23 19:38:58.987] [debug] GTK widget tree:
window#waybar.background.top.eDP-1..mode-default.solo.org.kde.konsole:dir(ltr)
  decoration:dir(ltr)
  box.horizontal:dir(ltr)
    box.horizontal.modules-left:dir(ltr)
      widget:dir(ltr)
        label#custom-l_end.module:dir(ltr)
      widget:dir(ltr)
        box#workspaces.horizontal.module:dir(ltr)
      widget:dir(ltr)
        box#window.horizontal.module:dir(ltr)
          image:dir(ltr)
          label:dir(ltr)
      widget:dir(ltr)
        label#custom-r_end.module:dir(ltr)
      widget:dir(ltr)
        label#custom-padd.module:dir(ltr)
    box.horizontal.modules-center:dir(ltr)
      widget:dir(ltr)
        label#custom-padd.module:dir(ltr)
      widget:dir(ltr)
        label#custom-l_end.module:dir(ltr)
      widget:dir(ltr)
        label#custom-weather.module:dir(ltr)
      widget:dir(ltr)
        label#custom-r_end.module:dir(ltr)
      widget:dir(ltr)
        label#custom-padd.module:dir(ltr)
    box.horizontal.modules-right:dir(ltr)
      widget:dir(ltr)
        label#custom-padd.module:dir(ltr)
      widget:dir(ltr)
        label#custom-l_end.module:dir(ltr)
      widget:dir(ltr)
        box#hardware.horizontal:dir(ltr)
          revealer.drawer:dir(ltr)
            box.horizontal:dir(ltr)
              widget.drawer-child:dir(ltr)
                label#cpu.module:dir(ltr)
              widget.drawer-child:dir(ltr)
                label#temperature.module:dir(ltr)
          widget:dir(ltr)
            label#memory.module:dir(ltr)
      widget:dir(ltr)
        label#custom-r_end.module:dir(ltr)
      widget:dir(ltr)
        label#custom-l_end.module:dir(ltr)
      widget:dir(ltr)
        label#mpris.module:dir(ltr)
      widget:dir(ltr)
        label#backlight.module:dir(ltr)
      widget:dir(ltr)
        label#network.module:dir(ltr)
      widget:dir(ltr)
        label#pulseaudio.module:dir(ltr)
      widget:dir(ltr)
        label#pulseaudio.module.microphone:dir(ltr)
      widget:dir(ltr)
        label#custom-r_end.module:dir(ltr)
      widget:dir(ltr)
        label#custom-l_end.module:dir(ltr)
      widget:dir(ltr)
        box#privacy.horizontal:dir(ltr)
          revealer:dir(ltr)
            box#privacy-item.horizontal.screenshare:dir(ltr)
              image:dir(ltr)
          revealer:dir(ltr)
            box#privacy-item.horizontal.audio-out:dir(ltr)
              image:dir(ltr)
          revealer:dir(ltr)
            box#privacy-item.horizontal.audio-in:dir(ltr)
              image:dir(ltr)
      widget:dir(ltr)
        box#gamemode.horizontal:dir(ltr)
          image:dir(ltr)
          label:dir(ltr)
      widget:dir(ltr)
        box#tray.horizontal.module:dir(ltr)
      widget:dir(ltr)
        label#battery.module:dir(ltr)
      widget:dir(ltr)
        label#custom-r_end.module:dir(ltr)
      widget:dir(ltr)
        label#custom-l_end.module:dir(ltr)
      widget:dir(ltr)
        label#custom-notification.module:dir(ltr)
      widget:dir(ltr)
        label#idle_inhibitor.module:dir(ltr)
      widget:dir(ltr)
        label#clock.module:dir(ltr)
      widget:dir(ltr)
        label#custom-r_end.module:dir(ltr)
      widget:dir(ltr)
        label#custom-l_end.module:dir(ltr)
      widget:dir(ltr)
        box#user.horizontal.module:dir(ltr)
          image:dir(ltr)
          label:dir(ltr)
      widget:dir(ltr)
        label#custom-power.module:dir(ltr)
      widget:dir(ltr)
        label#custom-r_end.module:dir(ltr)

[2024-07-23 19:38:58.989] [debug] Creating workspace 1
[2024-07-23 19:38:58.990] [debug] Creating workspace 2
[2024-07-23 19:38:59.103] [error] Host: GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: No such object path '/StatusNotifierWatcher'
[2024-07-23 19:38:59.196] [info] Bar configured (width: 1920, height: 40) for output: eDP-1
[2024-07-23 19:38:59.221] [debug] hyprland IPC received openlayer>>waybar
[2024-07-23 19:38:59.869] [debug] Received SIGCHLD in signalThread
[2024-07-23 19:38:59.869] [debug] Cmd exited with code 0
@HarshNarayanJha
Copy link
Author

Wait why these tags bot? Beacuse of the log?

@ShikharArvind
Copy link

ShikharArvind commented Jul 25, 2024

  • Similar issue on Sway + Waybar. Resuming after extended suspend makes the tray part of bar disappear. Killing and restarting it does not help.
  • Starting from terminal throws the error Host: GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: No such object path '/StatusNotifierWatcher'
  • Restarting Sway itself fixes the issue, and the tray seems to be working fine.
  • Could be due to libappindicator-gtk3 as described in issue Tray vanishing at random instances #3040 . Version is 12.10.0.r298-4 for me. Maybe downgrading to 12.10.0.r296 can help (?).
  • Edit : Tried uninstalling libappindicator-gtk3 completely and still does not seem to resolve the issue.

Waybar : v0.10.4
SwayWM on CachyOS (Arch)
Kernel : 6.10.1-3-cachyos

@HarshNarayanJha
Copy link
Author

RIght, forgot to add. I already saw that issue and downgraded libappindicator-gtk3 to v12.10.0.r296-1, with no success. Tray still disappears with the error if I restart waybar.

image

@careb0t
Copy link

careb0t commented Jul 28, 2024

Same issue here unfortunately. I seem to get the Host: GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: No such object path '/StatusNotifierWatcher' error and thus the tray disappearing whenever my lock screen activates, my computer sleeps, or whenever I reload waybar because I updated a config file or what have you.

@Pierceisgone
Copy link

I've been having a similar issue here that's been going on for a month of two now (~Since I started using Hyprland).

I am using Hyprland on Arch. If I suspend/sleep my desktop, and then wake it again later, the tray no longer works. All the icons in it disappear, and programs can no longer run in the tray. E.g. if I play an audio file with VLC, instead of VLC starting in the tray, it'll open as a window. To fix this I have to reboot my PC (Although just restarting Hyprland may fix this but I haven't tested that yet). After the tray breaks, nothing can run trayed. Also, the tray does not break every time I suspend, but it does most of the time.

I am also getting the error] Host: GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: No such object path '/StatusNotifierWatcher' error.

Hyprland version: hyprland 0.41.2-3
Waybar Version: waybar 0.10.4-1
Kernel Version: 6.10.0-arch1-2

My Waybar config: https://pastebin.com/srqbPLEq

I also ran Waybar in a terminal a for a while. I suspended my PC for ~5-8 minutes and then the tray broke when I woke it. These are the logs I got after waking the desktop: https://pastebin.com/0U6ZeECT

@ShikharArvind
Copy link

ShikharArvind commented Jul 29, 2024

  • Similar issue on Sway + Waybar. Resuming after extended suspend makes the tray part of bar disappear. Killing and restarting it does not help.

    • Starting from terminal throws the error Host: GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: No such object path '/StatusNotifierWatcher'

    • Restarting Sway itself fixes the issue, and the tray seems to be working fine.

    • Could be due to libappindicator-gtk3 as described in issue Tray vanishing at random instances #3040 . Version is 12.10.0.r298-4 for me. Maybe downgrading to 12.10.0.r296 can help (?).

    • Edit : Tried uninstalling libappindicator-gtk3 completely and still does not seem to resolve the issue.

Waybar : v0.10.4 SwayWM on CachyOS (Arch) Kernel : 6.10.1-3-cachyos

I also have Plasma 6 installed along with Sway. I suspect this has something to do with org.kde.StatusNotifierWatcher (ref : https://www.reddit.com/r/qtile/comments/17nx6qt/unable_to_get_status_notifier_working_on_qtile/k7xzvmc/ )

@ShikharArvind
Copy link

ShikharArvind commented Aug 1, 2024

I've been trying to debug this issue and I think I have a better idea now. I've Plasma 6 installed along with Sway + Waybar. Here is what I've found so far, maybe this will help others facing similar issue.

  • During the startup Waybar process owns org.kde.StatusNotifierWatcher and registers an org.kde.StatusNotifierHost. I can confirm this by running busctl --user list|grep -i status. The output is as follows:
org.kde.StatusNotifierHost-1358-1                                  1358 waybar          shikhar :1.8          session-3.scope   3       -
org.kde.StatusNotifierWatcher                                      1358 waybar          shikhar :1.8          session-3.scope   3       -
  • After and extended suspend and resume, the tray from Waybar disappears. If I run busctl -- user list|grep -i status again, its seems like kded6 now owns org.kde.StatusNotifierWatcher.
org.kde.StatusNotifierHost-1358-1                                  1358 waybar          shikhar :1.8          session-3.scope   3       -
org.kde.StatusNotifierWatcher                                     17162 kded6           shikhar :1.73         [email protected] -       -
  • Killing kded6 using pkill brings back the tray in Waybar , so this definitely seems to have something to do with this error. But I checked journalctl and kded6 was already running before the suspend and resume, and the tray was working fine then.
  • Since the unit for kded6 was [email protected], I ran systemctl status [email protected] and these were the relevant parts:
Jul 31 06:38:37  kactivitymanagerd[16997]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Jul 31 06:38:37  kded6[17162]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
  • Whenever I boot, kactivitymanagerd and kded6 are not running in on my system. Only when I open Dolphin ( and presumably other KDE applications),kactivitymanagerd starts via D-bus service. (Probably something similar triggers the starting of kded6).
  • Even if they are running in the background, as long as my computer is not suspended, the tray seems to work fine. Waybar still owns org.kde.StatusNotifierWatcher . Only when I suspend for long and resume, the tray disappears. Presumably due to whatever this does kded6[17162]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash and kded6 is now the process owning org.kde.StatusNotifierWatcher .
  • A very hacky fix for this : the D-bus services for starting kactivitymanagerd and kded6 are located in /usr/share/dbus-1/services. I renamed both from org.kde.ActivityManager.service and org.kde.kded6.service to org.kde.ActivityManagerservice.backup and org.kde.kded6service.backup.
  • Dolphin works fine with these modifications, but I have not extensively tested all the KDE apps.
  • Of course, this is not ideal and maybe be application breaking if I switch to Plasma. For now it seems to work fine on Sway + using KDE applications. I will update this post incase something major breaks because of this.

EDIT : Disabling org.kde.ActivityManager.service and org.kde.kded6.service definitely breaks Plasma if you ever want to switch from WM to it.

@HarshNarayanJha
Copy link
Author

Amazing debugging skills @ShikharArvind 👏🏼👏🏼👏🏼 ! I myself have been trying to debug this for some time, but couldn't figure out for myself how kde6 owns the tray after killing waybar and/or suspending, and how to give ownership back to waybar.

I also have KDE Plasma alongside hyprland, and this must be the issue.

For the solution, is there some mechanism to ask for the ownership of a dbus service? AFAIK, there is not, since all notification daemons ask to kill any running notification daemon. Maybe waybar can check and kill kded6 at launch?

@ShikharArvind
Copy link

ShikharArvind commented Aug 2, 2024

Thanks! I'm out of my depth when it comes to C++ or just general D-Bus spec, so not sure if there is an elegant/idiomatic way to check for this by waybar itself. This is something for more knowledgeable people to check. In the mean time, I did come up with a quick and dirty workaround for this : https://github.com/ShikharArvind/check_waybar_tray . It seems to work fine for me but I have not tested it all that much.

@HarshNarayanJha
Copy link
Author

Seems good! I will check it out later

@aziz-204
Copy link

aziz-204 commented Aug 18, 2024

@ShikharArvind thank you so much bro <3

@mt190502
Copy link

EDIT : Disabling org.kde.ActivityManager.service and org.kde.kded6.service definitely breaks Plasma if you ever want to switch from WM to it.

This situation happened to me too. But when I look, I cannot find these services in my system. One of the apps I use must be triggering kded6

OS: Fedora 41
Waybar version: v0.11.0
Indicator versions:

libappindicator-gtk3           12.10.1
libindicator-gtk3              12.10.1
libappindicator-sharp          12.10.1
libappindicator                12.10.1
libindicator                   12.10.1

@ralphocdol
Copy link

ralphocdol commented Oct 29, 2024

Thanks @ShikharArvind.

Mine happened because I was curious and tested something and ran plasmashell in the terminal (don't ask why). After reloading waybar, the tray icons disappeared. Though I haven't experienced what others did, I did notice kiod6, kded6 and kioworker running in the background when I did that, so I just created a script that:

# terminates those
kquitapp6 kiod6
kquitapp6 kded6
pkill kioworker
# reloads waybar
pkill waybar
hyprctl dispatch exec waybar

@mt190502
Copy link

EDIT : Disabling org.kde.ActivityManager.service and org.kde.kded6.service definitely breaks Plasma if you ever want to switch from WM to it.

This situation happened to me too. But when I look, I cannot find these services in my system. One of the apps I use must be triggering kded6

OS: Fedora 41 Waybar version: v0.11.0 Indicator versions:

libappindicator-gtk3           12.10.1
libindicator-gtk3              12.10.1
libappindicator-sharp          12.10.1
libappindicator                12.10.1
libindicator                   12.10.1

I uninstalled the KDE applications I was using along with their dependencies. And reinstalled this apps (dolphin, kate, okular etc.) without weak kde plasma dependencies. Problem solved.

@tomektom
Copy link

From my experiments (mainly trying to use Open as administrator in Dolphin provided by kio-admin, also Dolphin's builtin file search seems to have this issue) seems it's caused exclusively by kded6 dbus service – so I disabled it as described on Arch Wiki and that solved everything (for now). KDE also starts with this dbus disabled (but I didn't test much here)

Instead of disabling permanently and facing unknown problems in KDE, I disabled kded6 only for Hyprland with these two lines, kded6 never start by itself 😄

exec-once = printf "[D-BUS Service]\nName=org.kde.kded6\nExec=/bin/false" > $HOME/.local/share/dbus-1/services/org.kde.kded6.service
exec-shutdown = rm $HOME/.local/share/dbus-1/services/org.kde.kded6.service

@ShikharArvind
Copy link

ShikharArvind commented Oct 31, 2024

Thanks @tomektom! Ooh, I like this approach a lot better than what I did.
For those wondering how to implement this for sway, it is quite similar to hyprland except there is no exec-shutdown so you need to append the rm command to your sway exit bind. Here are the relevant lines in my sway config :

exec printf "[D-BUS Service]\nName=org.kde.kded6\nExec=/bin/false" > $HOME/.local/share/dbus-1/services/org.kde.kded6.service

bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'rm -f $HOME/.local/share/dbus-1/services/org.kde.kded6.service && swaymsg exit'

I used rm -f because it will not throw any error if the file doesn't exist and move ahead with the swaymsg exit.

Now one obvious drawback for sway users is that this approach does not clean up the file during shutdown or reboot unless you explicitly exit sway first (which most people do not). To cover these scenarios, we can create a simple user systemd service that runs the rm command during system shutdown or reboot.

I created a cleanup_kded6_blocking.service in $HOME/.config/systemd/user with the following contents :

[Unit]
Description=Delete modified kded6 service file

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecStop=rm -f %h/.local/share/dbus-1/services/org.kde.kded6.service

[Install]
WantedBy=default.target

And enable it by running the following commands:

sudo systemctl daemon-reload
systemctl --user enable cleanup_kded6_blocking.service
systemctl --user start cleanup_kded6_blocking.service

I think this should cover 99% of the scenarios. I'm still testing this setup and will update the post if something breaks.

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

No branches or pull requests

8 participants