Merge pull request #2256 from luttermann/master

Add output port (display) of workspace to template function of sway/workspace
This commit is contained in:
Alexis Rouillard 2023-06-27 13:50:54 +02:00 committed by GitHub
commit 4116490535
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -87,6 +87,8 @@ Addressed by *sway/workspaces*
*{index}*: Index of the workspace. *{index}*: Index of the workspace.
*{output}*: Output where the workspace is located.
# 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.

View File

@ -235,7 +235,8 @@ auto Workspaces::update() -> void {
auto format = config_["format"].asString(); auto format = config_["format"].asString();
output = fmt::format(fmt::runtime(format), fmt::arg("icon", getIcon(output, *it)), output = fmt::format(fmt::runtime(format), fmt::arg("icon", getIcon(output, *it)),
fmt::arg("value", output), fmt::arg("name", trimWorkspaceName(output)), 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()) { if (!config_["disable-markup"].asBool()) {
static_cast<Gtk::Label *>(button.get_children()[0])->set_markup(output); static_cast<Gtk::Label *>(button.get_children()[0])->set_markup(output);