Closed yavko closed 1 year ago
Hey, thanks for the interest! I'd definitely like to make the bar independent from Sway. The biggest roadblock for me at the moment is I'm not too familiar with Wayland or wlroots under the hood (Sway's IPC server proved the easy option).
The bar relies on Sway's IPC server in these places currently:
The first one is the biggest hurdle. If I can get output names in a stable/reliable way that (ideally) doesn't vary between compositors, the bar can at least run under different compositors.
The workspaces can probably be ported to wlr_ext_workspace_unstable_v1
as you say, although I'll need to find out more about that.
The other two modules I've no idea currently - if you've any knowledge on how I could get window events agnostically let me know!
But I'm willing to add support for Hyprland as a pr in the future, and it wouldn't be too hard as I have developed a crate to communicate with Hyprland.
I've got quite a large refactor I'm finishing up at the moment so I'd recommend holding off for now, but I'm definitely interested in knowing more about this!
I'll try to find suitable protocols, but i know the outputs can definitely done with a wlr ext protocol, for the window events i think there might have been one though ill have to do more research
I've got quite a large refactor I'm finishing up at the moment so I'd recommend holding off for now, but I'm definitely interested in knowing more about this!
Sounds good!
For outputs the https://wayland.app/protocols/wlr-output-management-unstable-v1 protocol can be used!
And https://wayland.app/protocols/wlr-foreign-toplevel-management-unstable-v1 for window events!
Found a crate that provides bindings to wlr specific wayland protocols https://crates.io/crates/wayland-protocols-wlr (which uses wayland-scanner), though it may be better just to use wayland-rs' wayland-scanner and wayland-rs
Awesome thanks for these! Getting output names through Wayland doesn't look too tricky, so I should be able to get the bar running outside Sway pretty quickly. I'll tackle the others after as I suspect those will need a bit more work
First step! I've got a bit of tidying/testing to do before it gets pushed up, but I've got the bar running in Hyprland:
Monitor names and ordering look to line up with what Sway reports so that's great, and all modules except focused/launcher/workspaces should work straight away.
The animations even work for the popup which I guess makes sense, but is very cool to see!
Great progress! Can't wait for full support!
Quick update. I've managed to get as far with the toplevel management as to get a list of windows out so just need to figure out properly listening to events, which is the hard bit.
Unfortunately it looks like the workspace protocol hasn't actually been merged into wlroots or sway yet so I won't be able to port that off the Sway IPC server. If the aforementioned Hyprland crate can handle that we can look at abstracting the calls behind a trait & being able to pick between the Sway/Hyprland/whatever else clients.
I think the way it should be done is to create a unix socket, and then it can receive events from it. For example someone can write a shell script that uses socat to listen to their wm, and then use socat to write to ironbar, so its wm independant.
That's a clever idea and I'm all for that, but I think that should be added in the long-term as a fallback option. If I can feasibly add native support that means users don't need to set up a second process, which is definitely preferable (I'd rather the bar was batteries included).
If anybody on an unsupported compositor then wants to use the bar, they could then write a script.
Yeah thats how it should be done!
I've just pushed a big update on the feat/wayland-protocols
branch that integrates wlr-foreign-toplevel-management-unstable-v1
and ports the focused
module over to it.
It seems to work in both Sway and Hyprland for me, but could you build it and see if it works for you too please?
Doesn't open
Thanks for trying. I can see in the backtrace it's trying to load the workspaces
module which is still sway-only (as is the launcher
module). Can you check your config and test again please?
If you get focused
working I will work on porting the other two.
Strange i removed it from my config
If that's the case could you please share:
I can then try and investigate what's going on. At the moment I've got nothing to go on.
I've ported over the launcher
module, although there's some glaring room for optimisation at the moment, which I'll look at before next release.
Seems like launcher, focus, sysinfo, clock and tray is working on hyprland. (upper is waybar and little bit below is ironbar)
At first for me too new update didn't work (sway ipc error) but for some reason git didn't pull new updates (I checked if I was in a right branch). but after deleting and re downloading it worked so..
I'm going to merge the changes into master as-is as I think they're ready, but I'm holding off the workspaces
module until the linked hyperland-rs
bug is resolved.
👍
I'm going to merge the changes into master as-is as I think they're ready, but I'm holding off the
workspaces
module until the linkedhyperland-rs
bug is resolved.
The Hyprland-rs
bug was fixed, I can publish a alpha release if you'd prefer to use a release instead of master, as atm I'm still polishing it for a full major release, tho API has mostly stabilized
Awesome! I won't be able to get a release out until there's a Hyperland-rs release since crates.io doesn't let you publish git/path deps. I can start working on support and get that pushed up to its own branch/master soon though
Ah, I'll work on getting a release out once im back home. Thanks for telling me!
Awesome! I won't be able to get a release out until there's a Hyperland-rs release since crates.io doesn't let you publish git/path deps. I can start working on support and get that pushed up to its own branch/master soon though
I've release an alpha release, its now on crates.io as well! https://github.com/hyprland-community/hyprland-rs/releases/tag/0.3.0-alpha.0
PR finally pushed!
No configuration should be needed to get it working. If anybody on Hyprland can give it a go and double-check it all works (I've only tested inside a Hyprland session nested in Sway with the default config) please let me know how it goes.
It also comes with some general improvements to the workspaces module.
I know you just merged this, but I released a full release of Hyprland-rs like 10 mins ago 💀 https://github.com/hyprland-community/hyprland-rs/releases/tag/0.3.0
That's cool, I've got a few other deps to update so I'll just add it to the list
I tested in wayfire, it support now except workspace archlinux
I tested in wayfire, it support now except workspace archlinux
Wayfire doesn't have IPC does it?
I tested in wayfire, it support now except workspace archlinux
Wayfire doesn't have IPC does it?
Doesn't have, and they may use dbus about workspace, for now use api, may support workspace protocol after https://github.com/WayfireWM/wayfire/issues/49#issuecomment-650819625
I tested in wayfire, it support now except workspace archlinux
Wayfire doesn't have IPC does it?
Doesn't have, and they may use dbus WayfireWM/wayfire#49
Yeah, so support can't be added, unless wayfire also supports the unfinished workspaces protocol, which would also require support for it to be added here.
It would be nice if the bar could run without the features that require sway if it isn't present, also for workspaces to use the standardized
wlr_ext_workspace_unstable_v1
protocol. I would love to try this bar, but I run Hyprland and not sway.