Waybar
Waybar copied to clipboard
feature request: #workspace button.empty for persistent_workspaces
With persistent_workspaces, you can set eg. workspaces 1,2,3 to always show on a given display (even when those workspaces are empty).
Would it be possible to scan each workspace periodically (swaymsg -t get_tree
) to see if it contains any windows? Not sure if Wayland has a "window created" event to plug into, otherwise polling every 1s for windows would be the only choice. Then based on the result, a class .empty could be applied to the #workspace button.
That way, out of all the persistent_workspaces you have, you'd know which ones are populated.
I second this as for my use case I'd like to be able to set the colour of the workspace that is on my second screen by default to the colour of used as ATM it shows as an in use workspace but there are no windows on it. So having an .empty class for the #workspace button would be fantastically useful.
Looks like it has already been implemented - https://github.com/Alexays/Waybar/pull/2153 . Same in hyprland.
Use the .persistent class