JakeStanger / ironbar

Customisable Wayland gtk bar written in Rust.
https://crates.io/crates/ironbar
MIT License
640 stars 55 forks source link

Support Niri out of the box #650

Open VarLad opened 4 months ago

VarLad commented 4 months ago

Is your feature request related to a problem? Please describe.

Currently workspaces in Niri WM are not supported. Niri does have IPC.

Describe the solution you'd like Support Niri workspaces out of the box. What would be required to do this?

JakeStanger commented 4 months ago

Yes, happy for this to be added.

I've had a brief look at Niri's IPC and it looks like it's missing events, which would make this tricky. Without those, Ironbar would have to constantly poll Niri to find the focused workspace, as it won't be notified of changes. I might be missing something though.

Assuming that can be resolved, the rest shouldn't be too hard, especially since Niri provides rust types for its IPC. Effectively entries would need to be added to the compositor client code to spawn a Niri client here and a new client would need to be written which implements the WorkspaceClient trait https://github.com/JakeStanger/ironbar/blob/6a06fa534a8f02aa1fa3fe04a9da59697a3fff25/src/clients/compositor/mod.rs#L142-L148

VarLad commented 4 months ago

@JakeStanger Does it make sense to wait for https://github.com/YaLTeR/niri/pull/453 then?

JakeStanger commented 4 months ago

Aha. Yeah definitely so, I'll mark this as blocked for now.

Brisingr05 commented 2 months ago

@JakeStanger Work on the event stream IPC has progressed and the niri dev is wondering if there are any design flaws that need to be worked on. There are some details in the PR linked above. I'm not a programmer but I'm willing to helping in testing.

The PR has been merged.