rootiest bd4facf1c4 feat: implement active-app monitor via KWin scripting and D-Bus
Replaces the no-op stub with a working implementation for KDE6 Wayland.
Wayland's privacy model prevents querying focused-window state from outside
the compositor, so the monitor injects a KWin JavaScript snippet at runtime
that subscribes to workspace.windowActivated and calls back via D-Bus.

On startup:
- Writes the KWin script to a NamedTempFile
- Registers dev.rootiest.qmk_host on the session bus at /AppMonitor
- Loads the script via org.kde.kwin.Scripting.loadScript(), then calls
  start() to activate it (loadScript alone does not execute the script)

On each window-activation event:
- Truncates app_id to 27 UTF-8 bytes at a char boundary
- Skips no-op updates when the active app has not changed
- Broadcasts CMD_ACTIVE_APP (0x43) to all connected keyboards

Depends on new crates: zbus v4 (blocking D-Bus) and tempfile v3.
2026-04-10 16:47:21 -04:00
S
Description
No description provided
75 KiB
Languages
Rust 100%