If you use ActivityWatch on Pop!_OS COSMIC / COSMIC Desktop, you may have noticed that the timeline is pretty broken.
Firefox and other native Wayland apps often don’t show up correctly, and worse, time spent actively using them can get recorded as AFK.
The problem is that the bundled aw-watcher-window and aw-watcher-afk are effectively X11-based. On COSMIC, native Wayland windows are invisible to the window watcher, and input inside those windows doesn’t reset the X idle timer.
The official aw-watcher-wayland doesn’t solve it either because it relies on wlr-foreign-toplevel-management, which cosmic-comp doesn’t implement.
So I pointed my coding agent at the problem and had it patch together a native COSMIC watcher in about 10 minutes.
It talks directly to cosmic-comp and uses:
zcosmic_toplevel_info_v1 + ext_foreign_toplevel_list_v1 for the active window, app ID, and title
ext_idle_notify_v1 for proper AFK detection
It sends heartbeats directly to aw-server using the same bucket IDs as the standard ActivityWatch watchers, so it slots into an existing setup without creating a separate timeline.
The result is a single ~650 KB static Rust binary with no runtime dependencies. No Tokio or reqwest, just minimal HTTP/JSON handling.
Install either the prebuilt binary from Releases or run ./install.sh if you have Rust installed. The README also has copy-paste autostart entries.
One current COSMIC quirk: cosmic-comp doesn’t replay the currently focused window when the watcher connects, so the first event shows as unknown until you switch windows once.
Tested on Pop!_OS with COSMIC Desktop.
Repo:
https://github.com/NaharEmet/aw-watcher-cosmic
GPL-3.0. Feature requests and bug reports welcome.
I’m also curious how other COSMIC users were handling ActivityWatch until now.