Merge pull request #5110 from archion/master
feat(niri/workspaces): add {total} format token to workspaces
This commit is contained in:
@@ -95,6 +95,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.
|
||||||
|
|||||||
@@ -129,10 +129,10 @@ void Workspaces::doUpdate() {
|
|||||||
|
|
||||||
if (config_["format"].isString()) {
|
if (config_["format"].isString()) {
|
||||||
auto format = config_["format"].asString();
|
auto format = config_["format"].asString();
|
||||||
name = fmt::format(fmt::runtime(format), fmt::arg("icon", getIcon(name, ws)),
|
name = fmt::format(
|
||||||
fmt::arg("value", name), fmt::arg("name", ws["name"].asString()),
|
fmt::runtime(format), fmt::arg("icon", getIcon(name, ws)), fmt::arg("value", name),
|
||||||
fmt::arg("index", ws["idx"].asUInt()),
|
fmt::arg("name", ws["name"].asString()), 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()) {
|
||||||
auto* child = gtk_bin_get_child(GTK_BIN(button.gobj()));
|
auto* child = gtk_bin_get_child(GTK_BIN(button.gobj()));
|
||||||
|
|||||||
Reference in New Issue
Block a user