diff options
author | vaxerski <[email protected]> | 2022-04-21 17:33:24 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-04-21 17:33:24 +0200 |
commit | 4b1773d1b15920431f4258ec587e96ea96c7abf6 (patch) | |
tree | 3e5afa597ae5840e6fe26fa97e83238a40539526 | |
parent | a0ec0326f915f783b81208cb107cad41cf68f1e5 (diff) | |
download | Hyprland-4b1773d1b15920431f4258ec587e96ea96c7abf6.tar.gz Hyprland-4b1773d1b15920431f4258ec587e96ea96c7abf6.zip |
overwrite mon rule if exists
-rw-r--r-- | src/config/ConfigManager.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 96e8eadd..c4977518 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -159,6 +159,14 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string if (curitem == "disable" || curitem == "disabled") { newrule.disabled = true; + // overwrite if exists + for (auto& r : m_dMonitorRules) { + if (r.name == newrule.name) { + r = newrule; + return; + } + } + m_dMonitorRules.push_back(newrule); return; @@ -183,6 +191,14 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string newrule.scale = stof(curitem); + // overwrite if exists + for (auto& r : m_dMonitorRules) { + if (r.name == newrule.name) { + r = newrule; + return; + } + } + m_dMonitorRules.push_back(newrule); } |