From 07cb2c02d25c679e40775b31df64997bff1d45a2 Mon Sep 17 00:00:00 2001 From: Owen Spafford Date: Tue, 9 Dec 2025 07:05:21 -0800 Subject: [PATCH] feat(dwl/tags): add empty tag option Added option in the `dwl/tags` to theme empty tags (i.e. tags without any clients) in `style.css` using `#tags button.empty`. Signed-off-by: ospafford --- man/waybar-dwl-tags.5.scd | 1 + src/modules/dwl/tags.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/man/waybar-dwl-tags.5.scd b/man/waybar-dwl-tags.5.scd index a2146dfd..39d15b7a 100644 --- a/man/waybar-dwl-tags.5.scd +++ b/man/waybar-dwl-tags.5.scd @@ -43,6 +43,7 @@ Addressed by *dwl/tags* - *#tags button* - *#tags button.occupied* +- *#tags button.empty* - *#tags button.focused* - *#tags button.urgent* diff --git a/src/modules/dwl/tags.cpp b/src/modules/dwl/tags.cpp index f8b250c8..c916eaf1 100644 --- a/src/modules/dwl/tags.cpp +++ b/src/modules/dwl/tags.cpp @@ -187,6 +187,12 @@ void Tags::handle_view_tags(uint32_t tag, uint32_t state, uint32_t clients, uint button.get_style_context()->remove_class("occupied"); } + if (clients & TAG_INACTIVE) { + button.get_style_context()->remove_class("empty"); + } else { + button.get_style_context()->add_class("empty"); + } + if (state & TAG_ACTIVE) { button.get_style_context()->add_class("focused"); } else {