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've been using this project in niri for a couple months now and it works great. I haven't written any Rust in a decade, so this may not be optimal, but I was able to put together workspace support based on the Hyprland provider. I'm not 100% sure I got every edge case, but I've been running it for 24 hours of normal use now without any crashes and it seems to behave across multiple outputs.
I chose not to add a dependency on the
niri-ipc
crate that was recently published because so little of it was actually needed. The socket helper within it also wasn't useful since it blocks. Additionally, the crate has a warning about not following the usual stability guarantees. Instead, I used a recent feature of serde to ignore any unknown event types so that any additions to the ipc protocol shouldn't result in errors.niri has a concept of named workspaces, but they are the exception rather than the norm so I chose to append the name to the workspace number if it is set. I didn't make this format configurable since there's currently no setting to do so and defining a syntax for that seems like a can of worms. This seems like a good followup change, and I'm happy to change the format here in the meantime to whatever seems best.
I am very open to adjusting any and all of this since I have no idea what I'm doing :)