Skip to content

Commit

Permalink
Merge pull request #2393 from zjeffer/hyprland/fixes
Browse files Browse the repository at this point in the history
Hyprland/workspaces: use named icons instead of searching by id
  • Loading branch information
Alexays authored Aug 14, 2023
2 parents eb74623 + 6f7e7c5 commit 2c7bbe9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/modules/hyprland/workspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -383,7 +382,7 @@ std::string &Workspace::select_icon(std::map<std::string, std::string> &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;
}
Expand Down

0 comments on commit 2c7bbe9

Please sign in to comment.