Skip to content

Commit

Permalink
Merge pull request #3034 from wispl/master
Browse files Browse the repository at this point in the history
Add empty workspace style for Sway
  • Loading branch information
Alexays authored Mar 22, 2024
2 parents fe0716b + 0fcf6bc commit 38634a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions man/waybar-sway-workspaces.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,6 @@ n.b.: the list of outputs can be obtained from command line using *swaymsg -t ge
- *#workspaces button.focused*
- *#workspaces button.urgent*
- *#workspaces button.persistent*
- *#workspaces button.empty*
- *#workspaces button.current_output*
- *#workspaces button#sway-workspace-${name}*
5 changes: 5 additions & 0 deletions src/modules/sway/workspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ auto Workspaces::update() -> void {
} else {
button.get_style_context()->remove_class("persistent");
}
if ((*it)["nodes"].size() == 0) {
button.get_style_context()->add_class("empty");
} else {
button.get_style_context()->remove_class("empty");
}
if ((*it)["output"].isString()) {
if (((*it)["output"].asString()) == bar_.output->name) {
button.get_style_context()->add_class("current_output");
Expand Down

0 comments on commit 38634a0

Please sign in to comment.