From 2ba11e840139e6dbc2567068be33cd807388c5fd Mon Sep 17 00:00:00 2001 From: zjeffer <4633209+zjeffer@users.noreply.github.com> Date: Thu, 10 Aug 2023 20:00:01 +0200 Subject: [PATCH 1/2] Hyprland/workspaces: use named icons instead of searching by id --- src/modules/hyprland/workspaces.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/hyprland/workspaces.cpp b/src/modules/hyprland/workspaces.cpp index 3b4bd5f8..bd2586e9 100644 --- a/src/modules/hyprland/workspaces.cpp +++ b/src/modules/hyprland/workspaces.cpp @@ -383,7 +383,7 @@ std::string &Workspace::select_icon(std::map &icons_ma } } - auto named_icon_it = icons_map.find(std::to_string(id())); + auto named_icon_it = icons_map.find(name()); if (named_icon_it != icons_map.end()) { return named_icon_it->second; } From 6f7e7c51997c083ae1d1437a2e4042e8579ad562 Mon Sep 17 00:00:00 2001 From: zjeffer <4633209+zjeffer@users.noreply.github.com> Date: Thu, 10 Aug 2023 20:37:42 +0200 Subject: [PATCH 2/2] formatting --- src/modules/hyprland/workspaces.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/hyprland/workspaces.cpp b/src/modules/hyprland/workspaces.cpp index bd2586e9..16894842 100644 --- a/src/modules/hyprland/workspaces.cpp +++ b/src/modules/hyprland/workspaces.cpp @@ -324,9 +324,8 @@ void Workspace::update(const std::string &format, const std::string &icon) { add_or_remove_class(style_context, is_special(), "special"); add_or_remove_class(style_context, is_empty(), "persistent"); - label_.set_markup( - fmt::format(fmt::runtime(format), fmt::arg("id", id()), - fmt::arg("name", name()), fmt::arg("icon", icon))); + label_.set_markup(fmt::format(fmt::runtime(format), fmt::arg("id", id()), + fmt::arg("name", name()), fmt::arg("icon", icon))); } void Workspaces::sort_workspaces() {