modules/niri: add {total} format token to workspaces

This commit is contained in:
Zuodong Yu
2026-06-07 17:35:37 +08:00
parent 05945748dc
commit f7b9d8c123
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -63,6 +63,8 @@ as defined by niri.
*{output}*: Output where the workspace is located. *{output}*: Output where the workspace is located.
*{total}*: The total number of workspaces.
# ICONS # ICONS
Additional to workspace name matching, the following *format-icons* can be set. Additional to workspace name matching, the following *format-icons* can be set.
+2 -1
View File
@@ -100,7 +100,8 @@ void Workspaces::doUpdate() {
name = fmt::format(fmt::runtime(format), fmt::arg("icon", getIcon(name, ws)), name = fmt::format(fmt::runtime(format), fmt::arg("icon", getIcon(name, ws)),
fmt::arg("value", name), fmt::arg("name", ws["name"].asString()), fmt::arg("value", name), fmt::arg("name", ws["name"].asString()),
fmt::arg("index", ws["idx"].asUInt()), fmt::arg("index", ws["idx"].asUInt()),
fmt::arg("output", ws["output"].asString())); fmt::arg("output", ws["output"].asString()),
fmt::arg("total", my_workspaces.size()));
} }
if (!config_["disable-markup"].asBool()) { if (!config_["disable-markup"].asBool()) {
static_cast<Gtk::Label*>(button.get_children()[0])->set_markup(name); static_cast<Gtk::Label*>(button.get_children()[0])->set_markup(name);