diff --git a/man/waybar-wlr-taskbar.5.scd b/man/waybar-wlr-taskbar.5.scd index af1ba97f7..039bdbf0b 100644 --- a/man/waybar-wlr-taskbar.5.scd +++ b/man/waybar-wlr-taskbar.5.scd @@ -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. diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index c5c522d85..d9cb7e935 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -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();