diff --git a/man/waybar-wlr-taskbar.5.scd b/man/waybar-wlr-taskbar.5.scd index af1ba97f7..5d2cd97f8 100644 --- a/man/waybar-wlr-taskbar.5.scd +++ b/man/waybar-wlr-taskbar.5.scd @@ -52,10 +52,15 @@ Addressed by *wlr/taskbar* default: false ++ If set to true, always reorder the tasks in the taskbar so that the currently active one is first. Otherwise don't reorder. +*active-last*: ++ + typeof: bool ++ + default: false ++ + If set to true, always reorder the tasks in the taskbar so that the currently active one is last. Otherwise don't reorder. + *sort-by-app-id*: ++ typeof: bool ++ default: false ++ - If set to true, group tasks by their app_id. Cannot be used with 'active-first'. + If set to true, group tasks by their app_id. Cannot be used with 'active-first' or 'active-last'. *on-click*: ++ typeof: string ++ diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index c5c522d85..786cfdb02 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -350,8 +350,11 @@ void Task::handle_done() { button.get_style_context()->remove_class("fullscreen"); } - if (config_["active-first"].isBool() && config_["active-first"].asBool() && active()) + if (config_["active-first"].isBool() && config_["active-first"].asBool() && active()) { tbar_->move_button(button, 0); + } else if (config_["active-last"].isBool() && config_["active-last"].asBool() && active()) { + tbar_->move_button(button, -1); + } tbar_->dp.emit(); }