diff --git a/man/waybar-niri-workspaces.5.scd b/man/waybar-niri-workspaces.5.scd index 433cbf97..48c02df5 100644 --- a/man/waybar-niri-workspaces.5.scd +++ b/man/waybar-niri-workspaces.5.scd @@ -95,6 +95,8 @@ as defined by niri. *{output}*: Output where the workspace is located. +*{total}*: The total number of workspaces. + # ICONS Additional to workspace name matching, the following *format-icons* can be set. diff --git a/src/modules/niri/workspaces.cpp b/src/modules/niri/workspaces.cpp index b6645491..f6d0553d 100644 --- a/src/modules/niri/workspaces.cpp +++ b/src/modules/niri/workspaces.cpp @@ -129,10 +129,10 @@ void Workspaces::doUpdate() { if (config_["format"].isString()) { auto format = config_["format"].asString(); - name = fmt::format(fmt::runtime(format), fmt::arg("icon", getIcon(name, ws)), - fmt::arg("value", name), fmt::arg("name", ws["name"].asString()), - fmt::arg("index", ws["idx"].asUInt()), - fmt::arg("output", ws["output"].asString())); + name = fmt::format( + fmt::runtime(format), fmt::arg("icon", getIcon(name, ws)), fmt::arg("value", name), + fmt::arg("name", ws["name"].asString()), fmt::arg("index", ws["idx"].asUInt()), + fmt::arg("output", ws["output"].asString()), fmt::arg("total", my_workspaces.size())); } if (!config_["disable-markup"].asBool()) { auto* child = gtk_bin_get_child(GTK_BIN(button.gobj()));