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

*truncate*: ++
typeof: bool ++
default: false ++
If set to true, the task button text will be ellipsized (truncated with …) when the available button width is smaller than the label text.

*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 @@ -101,6 +101,17 @@ Task::Task(const waybar::Bar &bar, const Json::Value &config, Taskbar *tbar,
content_.show();
button.add(content_);

// Apply optional label truncation (ellipsize).
if (config_["truncate"].isBool() && config_["truncate"].asBool()) {
text_before_.set_single_line_mode(true);
text_before_.set_ellipsize(Pango::ELLIPSIZE_END);
text_before_.set_line_wrap(false);

text_after_.set_single_line_mode(true);
text_after_.set_ellipsize(Pango::ELLIPSIZE_END);
text_after_.set_line_wrap(false);
}

format_before_.clear();
format_after_.clear();

Expand Down