summaryrefslogtreecommitdiff
path: root/src/tray.rs
diff options
context:
space:
mode:
authorcashmere <cashmere@autistici.org>2026-07-29 12:00:28 +0200
committercashmere <cashmere@autistici.org>2026-07-29 12:00:28 +0200
commit91b84d1f1bfbc5de2eb140a48185a5252b1b592e (patch)
treeac6072908671b0f21ebb1813c6a8d0be7c5f8117 /src/tray.rs
parentde596d4fca9ca54f9248e788685eee1820bb2381 (diff)
downloadi3bar-mango-91b84d1f1bfbc5de2eb140a48185a5252b1b592e.tar.gz
tray: register as StatusNotifierHost so libappindicator and Electron clients registerHEADmain
Diffstat (limited to 'src/tray.rs')
-rw-r--r--src/tray.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tray.rs b/src/tray.rs
index 1caeb3a..b0e1b74 100644
--- a/src/tray.rs
+++ b/src/tray.rs
@@ -274,6 +274,18 @@ async fn run(
let dbus = zbus::fdo::DBusProxy::new(&conn).await?;
+ let host_name = format!("org.kde.StatusNotifierHost-i3bar-mango-{}", std::process::id());
+ let watcher_proxy = zbus::Proxy::new(
+ &conn,
+ "org.kde.StatusNotifierWatcher",
+ "/StatusNotifierWatcher",
+ "org.kde.StatusNotifierWatcher",
+ )
+ .await?;
+ watcher_proxy
+ .call::<_, _, ()>("RegisterStatusNotifierHost", &host_name)
+ .await?;
+
let owner_stream = dbus.receive_name_owner_changed().await?;
let tx = events_tx.clone();
conn.executor()