diff --git a/README.md b/README.md index 249bb289..2451c778 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ - Memory - Cpu load average - Custom scripts +- And much more customizations **Configuration and Customization** diff --git a/resources/style.css b/resources/style.css index 0778a894..2c92e824 100644 --- a/resources/style.css +++ b/resources/style.css @@ -22,7 +22,7 @@ window { font-size: 10px; } -#workspaces button.current { +#workspaces button.focused { background: #64727D; border-bottom: 3px solid white; } diff --git a/src/modules/workspaces.cpp b/src/modules/workspaces.cpp index bd11c5cb..a227f6f6 100644 --- a/src/modules/workspaces.cpp +++ b/src/modules/workspaces.cpp @@ -53,9 +53,17 @@ auto waybar::modules::Workspaces::update() -> void } else { auto &button = it->second; if (node["focused"].asBool()) - button.get_style_context()->add_class("current"); + button.get_style_context()->add_class("focused"); else - button.get_style_context()->remove_class("current"); + button.get_style_context()->remove_class("focused"); + if (node["visible"].asBool()) + button.get_style_context()->add_class("visible"); + else + button.get_style_context()->remove_class("visible"); + if (node["urgent"].asBool()) + button.get_style_context()->add_class("urgent"); + else + button.get_style_context()->remove_class("urgent"); if (needReorder) _box.reorder_child(button, node["num"].asInt()); button.show(); @@ -89,7 +97,11 @@ void waybar::modules::Workspaces::_addWorkspace(Json::Value node) .connect(sigc::mem_fun(*this, &Workspaces::_handleScroll)); _box.reorder_child(button, node["num"].asInt()); if (node["focused"].asBool()) - button.get_style_context()->add_class("current"); + button.get_style_context()->add_class("focused"); + if (node["visible"].asBool()) + button.get_style_context()->add_class("visible"); + if (node["urgent"].asBool()) + button.get_style_context()->add_class("urgent"); button.show(); }