Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dwl/tags option to show only active tags #3504

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions man/waybar-dwl-tags.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ Addressed by *dwl/tags*
default: false ++
If set to false, you can left-click to set focused tag. Right-click to toggle tag focus. If set to true this behaviour is disabled.

*show-only-viable*: ++
typeof: bool ++
default: false ++
If set to true, only active (focused, urgent or with clients) tags will be displayed.

# EXAMPLE

```
Expand Down
9 changes: 9 additions & 0 deletions src/modules/dwl/tags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,15 @@ void Tags::handle_view_tags(uint32_t tag, uint32_t state, uint32_t clients, uint
} else {
button.get_style_context()->remove_class("urgent");
}

const bool show_only_viable = config_["show-only-viable"].asBool();
if (show_only_viable) {
if (clients > 0 || state & (TAG_ACTIVE | TAG_URGENT)) {
button.show();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if blindly calling show/hide is OK, was thinking about button.is_visible() checks.

} else {
button.hide();
}
}
}

} /* namespace waybar::modules::dwl */