aboutsummaryrefslogtreecommitdiffstats
path: root/systray/watcher.h
diff options
context:
space:
mode:
authorNikita Langer <nikitalanger@icloud.com>2026-08-22 18:23:18 +0200
committerNikita Langer <nikitalanger@icloud.com>2026-08-22 18:23:18 +0200
commit98f342c73911d1ba4afcdcd36bd5b4fb9cade224 (patch)
tree1dd0db18d76f5af51e161f919179e84142c3cc25 /systray/watcher.h
parent960d0661f6ed5ab6fd9c371c53a5f5b137864da1 (diff)
downloaddwl-master.tar.gz
dwl-master.tar.bz2
dwl-master.tar.xz
dwl-master.zip
systrayHEADmaster
Diffstat (limited to 'systray/watcher.h')
-rw-r--r--systray/watcher.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/systray/watcher.h b/systray/watcher.h
new file mode 100644
index 0000000..127eb64
--- /dev/null
+++ b/systray/watcher.h
@@ -0,0 +1,35 @@
+#ifndef WATCHER_H
+#define WATCHER_H
+
+#include <dbus/dbus.h>
+#include <wayland-server-core.h>
+#include <wayland-util.h>
+
+/*
+ * The FDO spec says "org.freedesktop.StatusNotifierWatcher"[1],
+ * but both the client libraries[2,3] actually use "org.kde.StatusNotifierWatcher"
+ *
+ * [1] https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/
+ * [2] https://github.com/AyatanaIndicators/libayatana-appindicator-glib
+ * [3] https://invent.kde.org/frameworks/kstatusnotifieritem
+ */
+#define SNW_NAME "org.kde.StatusNotifierWatcher"
+#define SNW_OPATH "/StatusNotifierWatcher"
+#define SNW_IFACE "org.kde.StatusNotifierWatcher"
+
+typedef struct {
+ struct wl_list items;
+ struct wl_list trays;
+ struct wl_event_loop *loop;
+ DBusConnection *conn;
+ int running;
+} Watcher;
+
+void watcher_start (Watcher *watcher, DBusConnection *conn,
+ struct wl_event_loop *loop);
+void watcher_stop (Watcher *watcher);
+
+int watcher_get_n_items (const Watcher *watcher);
+void watcher_update_trays (Watcher *watcher);
+
+#endif /* WATCHER_H */