Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

Sway workspace, add class for focused output and focused workspace on all output

Open kuon opened this issue 4 years ago • 4 comments

It would be nice to be able to style the focused workspace on the non focused output.

For example, I have 3 output/displays. On the right one, I have workspace 4 and 5. When I have my mouse on the right display and workspace 5 is visible, the .focused class is applied to workspace 5's button. But if I move my mouse to my center display, no workspace have the .focused class, and I do not know which workspace on my right display is currently displayed.

The ideal solution would be to add the state (focused) to the waybar and have a displayed (or visible) state.

To summarize:

  • Add #waybar.focused (or similar) for the focused output waybar styling (allowing to gray out non focused display/output).
  • Add button.displayed when the workspace of the button is displayed.

We could remove button.focused because #waybar.focused button.displayed would replaced it, but maybe keep it for backward compatibility? (and it would be #waybar.focused button.displayed.focused)

kuon avatar Aug 28 '21 22:08 kuon

I like it.

grobx avatar Aug 30 '21 12:08 grobx

You can use .visible

JohnTheCoolingFan avatar Dec 04 '21 12:12 JohnTheCoolingFan

Thank you @JohnTheCoolingFan, this is exactly what I was looking for.

I used it in conjunction with .focused to achieve what I wanted, here my config:

#workspaces button.visible {
    border-top: 2px solid gray;
}

#workspaces button.focused {
    color: white;
    background: transparent;
    border-top: 2px solid white;
}

grobx avatar Dec 15 '21 20:12 grobx

Is there a way to hide or style the unfocused bar? I'm using river. There is a hide option.

Something like this:

window#waybar.notfocused #window {  
 background:none;  
}  

rickswe avatar Mar 27 '24 19:03 rickswe