Skip to content
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
4 changes: 4 additions & 0 deletions man/waybar-wlr-taskbar.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ Addressed by *wlr/taskbar*
default: false ++
If set to true, group tasks by their app_id. Cannot be used with 'active-first'.

*justify*: ++
typeof: string ++
The alignment of the text within the module's box, allowing options 'left', 'right', or 'center' to define the positioning.

*on-click*: ++
typeof: string ++
The action which should be triggered when clicking on the application button with the left mouse button.
Expand Down
11 changes: 11 additions & 0 deletions src/modules/wlr/taskbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ Task::Task(const waybar::Bar &bar, const Json::Value &config, Taskbar *tbar,
content_.add(icon_);
content_.add(text_after_);

if (config_["justify"].isString()) {
auto justify_str = config_["justify"].asString();
if (justify_str == "left") {
content_.set_halign(Gtk::ALIGN_START);
} else if (justify_str == "right") {
content_.set_halign(Gtk::ALIGN_END);
} else if (justify_str == "center") {
content_.set_halign(Gtk::ALIGN_CENTER);
}
}

content_.show();
button.add(content_);

Expand Down