From 2bcd0eb09fe23a6984a97c15d2bb598f03423a1f Mon Sep 17 00:00:00 2001 From: Marshall Moats <46292427+marshallmoats@users.noreply.github.com> Date: Wed, 2 Aug 2023 16:02:50 -0500 Subject: [PATCH 1/2] Change default workspace format --- 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 6433338d..14cf8528 100644 --- a/src/modules/hyprland/workspaces.cpp +++ b/src/modules/hyprland/workspaces.cpp @@ -16,7 +16,7 @@ Workspaces::Workspaces(const std::string &id, const Bar &bar, const Json::Value box_(bar.vertical ? Gtk::ORIENTATION_VERTICAL : Gtk::ORIENTATION_HORIZONTAL, 0) { Json::Value config_format = config["format"]; - format_ = config_format.isString() ? config_format.asString() : "{id}"; + format_ = config_format.isString() ? config_format.asString() : "{name}"; with_icon_ = format_.find("{icon}") != std::string::npos; if (with_icon_ && icons_map_.empty()) { @@ -325,8 +325,7 @@ void Workspace::update(const std::string &format, const std::string &icon) { 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))); + fmt::format(fmt::runtime(format), fmt::arg("name", name()), fmt::arg("icon", icon))); } void Workspaces::sort_workspaces() { From e40860c3e9f1c4484faa611a33662b21bebe8725 Mon Sep 17 00:00:00 2001 From: Marshall Moats Date: Tue, 8 Aug 2023 17:17:58 -0500 Subject: [PATCH 2/2] keep id --- src/modules/hyprland/workspaces.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/hyprland/workspaces.cpp b/src/modules/hyprland/workspaces.cpp index 14cf8528..3b4bd5f8 100644 --- a/src/modules/hyprland/workspaces.cpp +++ b/src/modules/hyprland/workspaces.cpp @@ -325,7 +325,8 @@ void Workspace::update(const std::string &format, const std::string &icon) { add_or_remove_class(style_context, is_empty(), "persistent"); label_.set_markup( - fmt::format(fmt::runtime(format), fmt::arg("name", name()), fmt::arg("icon", icon))); + fmt::format(fmt::runtime(format), fmt::arg("id", id()), + fmt::arg("name", name()), fmt::arg("icon", icon))); } void Workspaces::sort_workspaces() {