Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for niri workspaces #39

Merged
merged 4 commits into from
Nov 19, 2024
Merged

Conversation

vilhalmer
Copy link
Contributor

@vilhalmer vilhalmer commented Nov 17, 2024

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 :)

@vilhalmer
Copy link
Contributor Author

vilhalmer commented Nov 18, 2024

I found one bug with multiple displays, will push a fix for that along with rustfmt as soon as it's solved.

Edit: done

Copy link
Owner

@MaxVerevkin MaxVerevkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good to me!

@MaxVerevkin MaxVerevkin merged commit eaf5b67 into MaxVerevkin:master Nov 19, 2024
4 checks passed
@vilhalmer
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants