diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-27 17:46:07 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-27 17:46:07 +0200 |
| commit | d284aaa2caaf6d25793fe27740b724a7b99a5be7 (patch) | |
| tree | 7a530030b0271c47fef269279019ef4eb8f0b975 /src/config/ConfigManager.cpp | |
| parent | dddb00fbc8cf9d973b3724a7366bdcc86e3b4717 (diff) | |
Added custom reserved area per mon
Diffstat (limited to 'src/config/ConfigManager.cpp')
| -rw-r--r-- | src/config/ConfigManager.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index e6d0ccd1..64a3f01e 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -160,8 +160,33 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string nextItem(); - if (curitem == "disable" || curitem == "disabled") { - newrule.disabled = true; + if (curitem == "disable" || curitem == "disabled" || curitem == "addreserved") { + if (curitem == "disable" || curitem == "disabled") + newrule.disabled = true; + else if (curitem == "addreserved") { + nextItem(); + + int top = std::stoi(curitem); + + nextItem(); + + int bottom = std::stoi(curitem); + + nextItem(); + + int left = std::stoi(curitem); + + nextItem(); + + int right = std::stoi(curitem); + + m_mAdditionalReservedAreas[newrule.name] = {top, bottom, left, right}; + + return; // this is not a rule, ignore + } else { + Debug::log(ERR, "ConfigManager parseMonitor, curitem bogus???"); + return; + } // overwrite if exists for (auto& r : m_dMonitorRules) { @@ -422,6 +447,7 @@ void CConfigManager::loadConfigLoadVars() { m_dWindowRules.clear(); g_pKeybindManager->clearKeybinds(); g_pAnimationManager->removeAllBeziers(); + m_mAdditionalReservedAreas.clear(); const char* const ENVHOME = getenv("HOME"); const std::string CONFIGPATH = ENVHOME + (ISDEBUG ? (std::string) "/.config/hypr/hyprlandd.conf" : (std::string) "/.config/hypr/hyprland.conf"); |
