Skip to content

Commit

Permalink
Merge pull request #2787 from scgtrp/master
Browse files Browse the repository at this point in the history
hyprland/workspaces: allow using the original window class/title
  • Loading branch information
Alexays committed Dec 31, 2023
2 parents 99d26e4 + ff09ef6 commit 3e55d0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion man/waybar-hyprland-workspaces.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Addressed by *hyprland/workspaces*
*window-rewrite*: ++
typeof: object ++
Regex rules to map window class to an icon or preferred method of representation for a workspace's window.
Keys are the rules, while the values are the methods of representation.
Keys are the rules, while the values are the methods of representation. Values may use the placeholders {class} and {title} to use the window's original class and/or title respectively.
Rules may specify `class<...>`, `title<...>`, or both in order to fine-tune the matching.

*window-rewrite-default*:
Expand Down
4 changes: 3 additions & 1 deletion src/modules/hyprland/workspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,9 @@ std::string Workspaces::getRewrite(std::string window_class, std::string window_
} else {
windowReprKey = fmt::format("class<{}>", window_class);
}
return m_windowRewriteRules.get(windowReprKey);
auto const rewriteRule = m_windowRewriteRules.get(windowReprKey);
return fmt::format(fmt::runtime(rewriteRule), fmt::arg("class", window_class),
fmt::arg("title", window_title));
}

WindowCreationPayload::WindowCreationPayload(std::string workspace_name,
Expand Down

0 comments on commit 3e55d0d

Please sign in to comment.