托盘缺少 DBus 服务
作者: Mikilio创建于 2023年8月28日更新于 2026年9月28日
DBus 服务文件我使用的是:
# /usr/share/dbus-1/services/org.kde.StatusNotifierWatcher.service [D-BUS 服务] Name=org.kde.StatusNotifierWatcher Exec=/usr/bin/waybar # 为了直接启动 waybar,注释掉 SystemdService 项 SystemdService=waybar.service
在测试过程中,我发现在启动 waybar 使用 dbus 服务时,Qt 应用程序可能无法显示图标。这是因为 Qt5 期望 在 QSystemTrayIcon 初始化时,
org.kde.StatusNotifierWatcher和org.kde.StatusNotifierHost都已准备就绪。由于这些接口注册之间存在明显的时间延迟,因此在 Qt 应用程序检查IsStatusNotifierHostRegistered时,只有 Watcher 才准备就绪。因此,我们得到qt.qpa.menu: StatusNotifierHost is not registered而不是图标。 tl;dr: sway 配置中的exec 'sleep 1; nextcloud'实际上更有可能成功 :disappointed: 最初由 @alebastr 在 https://GitHub.com/Alexays/Waybar/issues/483#issuecomment-542528145 中发布
理想情况下,应该将此添加到项目中。
内容来源: Alexays/Waybar