#2437·Waybar

Missing DBus service for tray

Author: MikilioCreated Aug 28, 2023Updated Sep 28, 2026

DBus service file I'm using:

ini
# /usr/share/dbus-1/services/org.kde.StatusNotifierWatcher.service
[D-BUS Service]
Name=org.kde.StatusNotifierWatcher
Exec=/usr/bin/waybar
# comment SystemdService to start waybar directly
SystemdService=waybar.service

While testing this, I found that Qt apps may fail to display icon when waybar is started with dbus service. This happens because Qt5 expects both org.kde.StatusNotifierWatcher and org.kde.StatusNotifierHost to be ready by the moment of QSystemTrayIcon initialization. Since there's an obvious time lag between the registration of those interfaces, only Watcher is ready when the Qt app checks IsStatusNotifierHostRegistered. As a result, we get qt.qpa.menu: StatusNotifierHost is not registered instead of the icon.

tl;dr: exec 'sleep 1; nextcloud' in sway config actually has higher chance to work :disappointed:

Originally posted by @alebastr in https://github.com/Alexays/Waybar/issues/483#issuecomment-542528145

Ideally this should be added to the project.