Add niri/workspaces, niri/window, niri/language #3551
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am working on an event stream IPC for the niri Wayland compositor, which is intended for bar modules and the like. To test out the design, I implemented Waybar modules for workspaces, focused window and language.
This PR is a Draft until I merge the niri PR (in a few days).
I followed the existing modules for Sway and Hyprland in my niri implementation, though with some differences.
Unlike Sway and Hyprland, the niri event stream IPC starts by sending the complete current state, so Waybar doesn't need to query it from other IPC calls. This, however, makes it more convenient to track the state in the IPC class directly, so that modules registering after the initial event burst can still access the current state.
The modules mostly support a similar feature set to the Sway and Hyprland ones, though one notable omission is the window list built into the workspaces module. (All data is there, just didn't get around to it.)
Also, in the workspaces module, configurable sorting order and persistent workspaces are omitted because they don't really make sense for niri's dynamic workspace system.
I documented all supported functionality in the .scd man pages.