From 43434254e0ea575f45cfe7d9781cfa22025f1fda Mon Sep 17 00:00:00 2001 From: Lasse Luttermann Date: Mon, 26 Jun 2023 11:01:50 +0200 Subject: [PATCH 1/2] Add output port of workspace to template --- src/modules/sway/workspaces.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/sway/workspaces.cpp b/src/modules/sway/workspaces.cpp index bdf4ece9..324c397d 100644 --- a/src/modules/sway/workspaces.cpp +++ b/src/modules/sway/workspaces.cpp @@ -235,7 +235,8 @@ auto Workspaces::update() -> void { auto format = config_["format"].asString(); output = fmt::format(fmt::runtime(format), fmt::arg("icon", getIcon(output, *it)), fmt::arg("value", output), fmt::arg("name", trimWorkspaceName(output)), - fmt::arg("index", (*it)["num"].asString())); + fmt::arg("index", (*it)["num"].asString()), + fmt::arg("output", (*it)["output"].asString())); } if (!config_["disable-markup"].asBool()) { static_cast(button.get_children()[0])->set_markup(output); From 08e18387c92b3ca4b8149650034318daf5ca1666 Mon Sep 17 00:00:00 2001 From: Lasse Luttermann Date: Mon, 26 Jun 2023 11:01:50 +0200 Subject: [PATCH 2/2] Add output port of workspace to template --- man/waybar-sway-workspaces.5.scd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/man/waybar-sway-workspaces.5.scd b/man/waybar-sway-workspaces.5.scd index 644cba46..628115a2 100644 --- a/man/waybar-sway-workspaces.5.scd +++ b/man/waybar-sway-workspaces.5.scd @@ -87,6 +87,8 @@ Addressed by *sway/workspaces* *{index}*: Index of the workspace. +*{output}*: Output where the workspace is located. + # ICONS Additional to workspace name matching, the following *format-icons* can be set.