ags
ags copied to clipboard
Service for river tags and commands
This adds a new service that allows querying various information from and sending commands to the river compositor. It adds bindings for the control and status protocols, allowing sending commands to the river server and getting the title of the active window, list of focused tags, etc. To demonstrate usage I've added code to use river in the simple-bar example if it is detected.
I will admit the switching between services in the example is a bit messy, but there's no unified service yet. That would require some more work. Stuff like active window title would be easy to unify, but for workspaces, river uses a different "tag" system that's more flexible than workspaces, and can behave like Sway/Hyprland workspaces, but is more generalized. I don't see it as a huge concern, however, since most users will write their config to work with the compositor they use and not think about adding support for other setups.
Communication with river uses Wayland protocols, so I extended the gutils subproject to add two new C classes, River and RiverOutput, which convert the Wayland events into GLib signals. These classes are then wrapped in the river.ts to adapt the signals into the binding system.
There is one protocol that I have not yet added, which is the layout protocol. I have not implemented this mainly because I didn't see it used in Waybar and could not think of a reason to add it.