aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-04-21 17:33:24 +0200
committervaxerski <[email protected]>2022-04-21 17:33:24 +0200
commit4b1773d1b15920431f4258ec587e96ea96c7abf6 (patch)
tree3e5afa597ae5840e6fe26fa97e83238a40539526
parenta0ec0326f915f783b81208cb107cad41cf68f1e5 (diff)
downloadHyprland-4b1773d1b15920431f4258ec587e96ea96c7abf6.tar.gz
Hyprland-4b1773d1b15920431f4258ec587e96ea96c7abf6.zip
overwrite mon rule if exists
-rw-r--r--src/config/ConfigManager.cpp16
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);
}