From 546cc71565cd2ccd9277febb14dcebf513ace623 Mon Sep 17 00:00:00 2001 From: shezdy <77217897+shezdy@users.noreply.github.com> Date: Thu, 30 Apr 2026 13:10:03 -0600 Subject: config/workspace-rules: support modifying persistent and monitor (#14217) * workspace rules: support modifying persistent and monitor * support modifying isDefault --- src/debug/HyprCtl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/debug/HyprCtl.cpp') diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index b334a26e..11171472 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -507,8 +507,8 @@ static std::string getWorkspaceRuleData(const Config::CWorkspaceRule& r, eHyprCt const auto boolToString = [](const bool b) -> std::string { return b ? "true" : "false"; }; if (format == eHyprCtlOutputFormat::FORMAT_JSON) { const std::string monitor = r.m_monitor.empty() ? "" : std::format(",\n \"monitor\": \"{}\"", escapeJSONStrings(r.m_monitor)); - const std::string default_ = sc(r.m_isDefault) ? std::format(",\n \"default\": {}", boolToString(r.m_isDefault)) : ""; - const std::string persistent = sc(r.m_isPersistent) ? std::format(",\n \"persistent\": {}", boolToString(r.m_isPersistent)) : ""; + const std::string default_ = sc(r.m_isDefault) ? std::format(",\n \"default\": {}", boolToString(r.m_isDefault.value())) : ""; + const std::string persistent = sc(r.m_isPersistent) ? std::format(",\n \"persistent\": {}", boolToString(r.m_isPersistent.value())) : ""; const std::string gapsIn = sc(r.m_gapsIn) ? std::format(",\n \"gapsIn\": [{}, {}, {}, {}]", r.m_gapsIn.value().m_top, r.m_gapsIn.value().m_right, r.m_gapsIn.value().m_bottom, r.m_gapsIn.value().m_left) : ""; @@ -531,8 +531,8 @@ static std::string getWorkspaceRuleData(const Config::CWorkspaceRule& r, eHyprCt return result; } else { const std::string monitor = std::format("\tmonitor: {}\n", r.m_monitor.empty() ? "" : escapeJSONStrings(r.m_monitor)); - const std::string default_ = std::format("\tdefault: {}\n", sc(r.m_isDefault) ? boolToString(r.m_isDefault) : ""); - const std::string persistent = std::format("\tpersistent: {}\n", sc(r.m_isPersistent) ? boolToString(r.m_isPersistent) : ""); + const std::string default_ = std::format("\tdefault: {}\n", sc(r.m_isDefault) ? boolToString(r.m_isDefault.value()) : ""); + const std::string persistent = std::format("\tpersistent: {}\n", sc(r.m_isPersistent) ? boolToString(r.m_isPersistent.value()) : ""); const std::string gapsIn = sc(r.m_gapsIn) ? std::format("\tgapsIn: {} {} {} {}\n", std::to_string(r.m_gapsIn.value().m_top), std::to_string(r.m_gapsIn.value().m_right), std::to_string(r.m_gapsIn.value().m_bottom), std::to_string(r.m_gapsIn.value().m_left)) : -- cgit v1.2.3