Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

feature request: #workspace button.empty for persistent_workspaces

Open sethidden opened this issue 2 years ago • 1 comments

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.

sethidden avatar Apr 11 '22 13:04 sethidden

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.

justinesmithies avatar May 17 '22 17:05 justinesmithies

Looks like it has already been implemented - https://github.com/Alexays/Waybar/pull/2153 . Same in hyprland.

Use the .persistent class

sethidden avatar Nov 10 '23 18:11 sethidden