From 3d46c739815b178fa77787083d02fabee8e79a21 Mon Sep 17 00:00:00 2001 From: Caleb Owens Date: Mon, 20 Jun 2022 14:37:27 +0100 Subject: Added a multiplier for the width to height ratio --- src/config/ConfigManager.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index d511c05a..60e72f76 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -53,6 +53,7 @@ void CConfigManager::setDefaultVars() { configValues["dwindle:force_split"].intValue = 0; configValues["dwindle:preserve_split"].intValue = 0; configValues["dwindle:special_scale_factor"].floatValue = 0.8f; + configValues["dwindle:split_width_multiplier"].floatValue = 1.0f; configValues["animations:enabled"].intValue = 1; configValues["animations:speed"].floatValue = 7.f; -- cgit v1.2.3 From e0bfec6ef2507de3f13e1d4690adfe195cf1643c Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 4 Jul 2022 17:47:31 +0200 Subject: added experimental:vfr --- src/config/ConfigManager.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index f313b155..842e3bf4 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -43,6 +43,8 @@ void CConfigManager::setDefaultVars() { configValues["debug:damage_blink"].intValue = 0; configValues["debug:disable_logs"].intValue = 0; + configValues["experimental:vfr"].intValue = 0; + configValues["decoration:rounding"].intValue = 1; configValues["decoration:blur"].intValue = 1; configValues["decoration:blur_size"].intValue = 8; -- cgit v1.2.3 From 0277f4c6bd8f1203a54ed7d6266871c8b8a5e6c6 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 6 Jul 2022 15:05:23 +0200 Subject: support relative paths in source= --- src/config/ConfigManager.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 842e3bf4..ee8ab95e 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -577,6 +577,23 @@ void CConfigManager::handleSource(const std::string& command, const std::string& auto value = rawpath; + if (value.length() < 2) { + Debug::log(ERR, "source= path garbage"); + parseError = "source path " + value + " bogus!"; + return; + } + + if (value[0] == '.') { + auto currentDir = configCurrentPath.substr(0, configCurrentPath.find_last_of('/')); + + if (value[1] == '.') { + auto parentDir = currentDir.substr(0, currentDir.find_last_of('/')); + value.replace(0, 2, parentDir); + } else { + value.replace(0, 1, currentDir); + } + } + if (value[0] == '~') { value.replace(0, 1, std::string(ENVHOME)); } -- cgit v1.2.3 From f9756d10d4d1c5ea7737cf3a237b1f966d6b7a01 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 6 Jul 2022 16:50:11 +0200 Subject: changed C++ std to C++23, use std::string::contains --- src/config/ConfigManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index ee8ab95e..ded23733 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -356,7 +356,7 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string newrule.resolution.x = stoi(curitem.substr(0, curitem.find_first_of('x'))); newrule.resolution.y = stoi(curitem.substr(curitem.find_first_of('x') + 1, curitem.find_first_of('@'))); - if (curitem.find_first_of('@') != std::string::npos) + if (curitem.contains("@")) newrule.refreshRate = stof(curitem.substr(curitem.find_first_of('@') + 1)); nextItem(); @@ -722,7 +722,7 @@ void CConfigManager::parseLine(std::string& line) { line = line.substr(1); } - if (line.find(" {") != std::string::npos) { + if (line.contains(" {")) { auto cat = line.substr(0, line.find(" {")); transform(cat.begin(), cat.end(), cat.begin(), ::tolower); if (currentCategory.length() != 0) { @@ -736,7 +736,7 @@ void CConfigManager::parseLine(std::string& line) { return; } - if (line.find("}") != std::string::npos && currentCategory != "") { + if (line.contains("}") && currentCategory != "") { currentCategory = ""; return; } -- cgit v1.2.3 From 1cf2f378d4a0e5e3da757d90404c2816a6765626 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 6 Jul 2022 22:12:03 +0200 Subject: added ls blurring --- src/config/ConfigManager.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index ded23733..2e594a4f 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -552,6 +552,10 @@ void CConfigManager::handleWindowRule(const std::string& command, const std::str } +void CConfigManager::handleBlurLS(const std::string& command, const std::string& value) { + m_dBlurLSNamespaces.emplace_back(value); +} + void CConfigManager::handleDefaultWorkspace(const std::string& command, const std::string& value) { const auto DISPLAY = value.substr(0, value.find_first_of(',')); @@ -670,6 +674,7 @@ std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std:: else if (COMMAND == "animation") handleAnimation(COMMAND, VALUE); else if (COMMAND == "source") handleSource(COMMAND, VALUE); else if (COMMAND == "submap") handleSubmap(COMMAND, VALUE); + else if (COMMAND == "blurls") handleBlurLS(COMMAND, VALUE); else configSetValueSafe(currentCategory + (currentCategory == "" ? "" : ":") + COMMAND, VALUE); @@ -772,6 +777,7 @@ void CConfigManager::loadConfigLoadVars() { m_mAdditionalReservedAreas.clear(); configDynamicVars.clear(); deviceConfigs.clear(); + m_dBlurLSNamespaces.clear(); // paths configPaths.clear(); @@ -1103,3 +1109,12 @@ bool CConfigManager::deviceConfigExists(const std::string& dev) { return it != deviceConfigs.end(); } +bool CConfigManager::shouldBlurLS(const std::string& ns) { + for (auto& bls : m_dBlurLSNamespaces) { + if (bls == ns) { + return true; + } + } + + return false; +} -- cgit v1.2.3 From 4b796d30c190e14aa39a9540395523cee27bd348 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 7 Jul 2022 11:52:12 +0200 Subject: Added swipe workspace gestures --- src/config/ConfigManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 2e594a4f..a20ac431 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -105,6 +105,12 @@ void CConfigManager::setDefaultVars() { configValues["input:touchpad:middle_button_emulation"].intValue = 0; configValues["input:touchpad:tap-to-click"].intValue = 1; + configValues["gestures:workspace_swipe"].intValue = 0; + configValues["gestures:workspace_swipe_distance"].intValue = 300; + configValues["gestures:workspace_swipe_invert"].intValue = 1; + configValues["gestures:workspace_swipe_min_speed_to_force"].intValue = 30; + configValues["gestures:workspace_swipe_cancel_ratio"].floatValue = 0.5f; + configValues["input:follow_mouse"].intValue = 1; configValues["autogenerated"].intValue = 0; -- cgit v1.2.3 From 3278db67a2328443b3f93c8559fc37fa6e8fc82f Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 7 Jul 2022 20:16:40 +0200 Subject: added general:disable_hyprland_logo --- src/config/ConfigManager.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index a20ac431..570fd1f6 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -36,6 +36,7 @@ void CConfigManager::setDefaultVars() { configValues["general:col.active_border"].intValue = 0xffffffff; configValues["general:col.inactive_border"].intValue = 0xff444444; configValues["general:cursor_inactive_timeout"].intValue = 0; + configValues["general:disable_hyprland_logo"].intValue = 0; configValues["debug:int"].intValue = 0; configValues["debug:log_damage"].intValue = 0; -- cgit v1.2.3 From cd0a01f4de6e1489caa35bece331c81dbaab2587 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 8 Jul 2022 09:27:17 +0200 Subject: Added binding by keycodes --- src/config/ConfigManager.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 570fd1f6..91a73ca1 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -512,8 +512,13 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v return; } - if (KEY != "") - g_pKeybindManager->addKeybind(SKeybind{KEY, MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap}); + if (KEY != "") { + if (isNumber(KEY) && std::stoi(KEY) > 9) + g_pKeybindManager->addKeybind(SKeybind{"", std::stoi(KEY), MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap}); + else + g_pKeybindManager->addKeybind(SKeybind{KEY, -1, MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap}); + } + } void CConfigManager::handleUnbind(const std::string& command, const std::string& value) { -- cgit v1.2.3 From 4b334594dc0d8989d8bb09c7db76694aacc71951 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 10 Jul 2022 15:41:26 +0200 Subject: Added splashes --- src/config/ConfigManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 91a73ca1..19db65fd 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -36,7 +36,9 @@ void CConfigManager::setDefaultVars() { configValues["general:col.active_border"].intValue = 0xffffffff; configValues["general:col.inactive_border"].intValue = 0xff444444; configValues["general:cursor_inactive_timeout"].intValue = 0; - configValues["general:disable_hyprland_logo"].intValue = 0; + + configValues["misc:disable_hyprland_logo"].intValue = 0; + configValues["misc:disable_splash_rendering"].intValue = 0; configValues["debug:int"].intValue = 0; configValues["debug:log_damage"].intValue = 0; -- cgit v1.2.3 From c0c75db62188667a4f42aef1ae6bfd8034093af7 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 11 Jul 2022 23:56:24 +0200 Subject: roll VFR for everyone --- src/config/ConfigManager.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 19db65fd..e00270a1 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -46,8 +46,6 @@ void CConfigManager::setDefaultVars() { configValues["debug:damage_blink"].intValue = 0; configValues["debug:disable_logs"].intValue = 0; - configValues["experimental:vfr"].intValue = 0; - configValues["decoration:rounding"].intValue = 1; configValues["decoration:blur"].intValue = 1; configValues["decoration:blur_size"].intValue = 8; -- cgit v1.2.3 From 29e2bb27f6073695aa4f9767f87cd653db5ce811 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 12 Jul 2022 10:02:12 +0200 Subject: added misc:no_vfr --- src/config/ConfigManager.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index e00270a1..f4a2d003 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -39,6 +39,7 @@ void CConfigManager::setDefaultVars() { configValues["misc:disable_hyprland_logo"].intValue = 0; configValues["misc:disable_splash_rendering"].intValue = 0; + configValues["misc:no_vfr"].intValue = 0; configValues["debug:int"].intValue = 0; configValues["debug:log_damage"].intValue = 0; -- cgit v1.2.3 From 2d856ac4b08826ff83c42e97176f4f739442aefa Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 12 Jul 2022 10:28:42 +0200 Subject: Added yes/no values to int parsing --- src/config/ConfigManager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index f4a2d003..077627aa 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -201,7 +201,12 @@ void CConfigManager::configSetValueSafe(const std::string& COMMAND, const std::s // Values with 0x are hex const auto VALUEWITHOUTHEX = VALUE.substr(2); CONFIGENTRY->intValue = stol(VALUEWITHOUTHEX, nullptr, 16); - } else + } else if (VALUE.find("true") == 0 || VALUE.find("on") == 0 || VALUE.find("yes") == 0) { + CONFIGENTRY->intValue = 1; + } else if (VALUE.find("false") == 0 || VALUE.find("off") == 0 || VALUE.find("no") == 0) { + CONFIGENTRY->intValue = 0; + } + else CONFIGENTRY->intValue = stol(VALUE); } catch (...) { Debug::log(WARN, "Error reading value of %s", COMMAND.c_str()); -- cgit v1.2.3 From da83ef7b96fdee7396382712f9f2115ef4664666 Mon Sep 17 00:00:00 2001 From: Mathias Zhang Date: Tue, 12 Jul 2022 19:11:54 +0800 Subject: add config drag_lock for touchpad (#353) * add config drag_lock for touchpad * fix err * Update ConfigManager.cpp --- src/config/ConfigManager.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 077627aa..0243d2fe 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -106,6 +106,7 @@ void CConfigManager::setDefaultVars() { configValues["input:touchpad:clickfinger_behavior"].intValue = 0; configValues["input:touchpad:middle_button_emulation"].intValue = 0; configValues["input:touchpad:tap-to-click"].intValue = 1; + configValues["input:touchpad:drag_lock"].intValue = 0; configValues["gestures:workspace_swipe"].intValue = 0; configValues["gestures:workspace_swipe_distance"].intValue = 300; @@ -134,6 +135,7 @@ void CConfigManager::setDeviceDefaultVars(const std::string& dev) { cfgValues["clickfinger_behavior"].intValue = 0; cfgValues["middle_button_emulation"].intValue = 0; cfgValues["tap-to-click"].intValue = 1; + cfgValues["drag_lock"].intValue = 0; } void CConfigManager::init() { -- cgit v1.2.3 From a4f82491b7e825255253a1fbea509e823b73115b Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 12 Jul 2022 13:40:55 +0200 Subject: active opacity is now animated --- src/config/ConfigManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 0243d2fe..ce4583f5 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -707,7 +707,7 @@ std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std:: g_pLayoutManager->getCurrentLayout()->recalculateMonitor(m->ID); // Update window border colors - g_pCompositor->updateAllWindowsBorders(); + g_pCompositor->updateAllWindowsAnimatedDecorationValues(); return retval; } @@ -899,7 +899,7 @@ void CConfigManager::loadConfigLoadVars() { } // Update window border colors - g_pCompositor->updateAllWindowsBorders(); + g_pCompositor->updateAllWindowsAnimatedDecorationValues(); // Force the compositor to fully re-render all monitors for (auto& m : g_pCompositor->m_vMonitors) -- cgit v1.2.3 From 78c63717434ad9de1cb0a6658848bb5172fa42e2 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 12 Jul 2022 15:41:28 +0200 Subject: default vfr to off --- src/config/ConfigManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index ce4583f5..a4bcdb69 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -39,7 +39,7 @@ void CConfigManager::setDefaultVars() { configValues["misc:disable_hyprland_logo"].intValue = 0; configValues["misc:disable_splash_rendering"].intValue = 0; - configValues["misc:no_vfr"].intValue = 0; + configValues["misc:no_vfr"].intValue = 1; configValues["debug:int"].intValue = 0; configValues["debug:log_damage"].intValue = 0; -- cgit v1.2.3 From ad03360665809d4cbf433664fe8c3a9aab3dfa3a Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 12 Jul 2022 16:07:51 +0200 Subject: fix device sections shadowing parse errors --- src/config/ConfigManager.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index a4bcdb69..75c0bdef 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -159,17 +159,15 @@ void CConfigManager::init() { void CConfigManager::configSetValueSafe(const std::string& COMMAND, const std::string& VALUE) { if (configValues.find(COMMAND) == configValues.end()) { - if (COMMAND[0] == '$') { - // register a dynamic var - Debug::log(LOG, "Registered dynamic var \"%s\" -> %s", COMMAND.c_str(), VALUE.c_str()); - configDynamicVars[COMMAND.substr(1)] = VALUE; - } else { - parseError = "Error setting value <" + VALUE + "> for field <" + COMMAND + ">: No such field."; - } + if (COMMAND.find("device:") != 0 /* devices parsed later */) { + if (COMMAND[0] == '$') { + // register a dynamic var + Debug::log(LOG, "Registered dynamic var \"%s\" -> %s", COMMAND.c_str(), VALUE.c_str()); + configDynamicVars[COMMAND.substr(1)] = VALUE; + } else { + parseError = "Error setting value <" + VALUE + "> for field <" + COMMAND + ">: No such field."; + } - if (COMMAND.find("device:") == 0 /* devices parsed later */) { - parseError = ""; - } else { return; } } -- cgit v1.2.3 From 01fc3d6068f80c60e4113f14e375070e38329641 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Thu, 14 Jul 2022 23:55:24 +0300 Subject: add config flag you can now specify a config with -c --- src/config/ConfigManager.cpp | 46 +++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 15 deletions(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index f01f9b40..ba73b777 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -12,8 +12,15 @@ CConfigManager::CConfigManager() { setDefaultVars(); - static const char* const ENVHOME = getenv("HOME"); - const std::string CONFIGPATH = ENVHOME + (ISDEBUG ? (std::string) "/.config/hypr/hyprlandd.conf" : (std::string) "/.config/hypr/hyprland.conf"); + + std::string CONFIGPATH; + if (g_pCompositor->explicitConfigPath == "") { + static const char* const ENVHOME = getenv("HOME"); + CONFIGPATH = ENVHOME + (ISDEBUG ? (std::string) "/.config/hypr/hyprlandd.conf" : (std::string) "/.config/hypr/hyprland.conf"); + } else { + CONFIGPATH = g_pCompositor->explicitConfigPath; + } + configPaths.emplace_back(CONFIGPATH); Debug::disableLogs = &configValues["debug:disable_logs"].intValue; @@ -801,28 +808,37 @@ void CConfigManager::loadConfigLoadVars() { // paths configPaths.clear(); + std::string CONFIGPATH; + static const char* const ENVHOME = getenv("HOME"); const std::string CONFIGPARENTPATH = ENVHOME + (std::string) "/.config/hypr/"; - const std::string CONFIGPATH = CONFIGPARENTPATH + (ISDEBUG ? "hyprlandd.conf" : "hyprland.conf"); - configPaths.push_back(CONFIGPATH); + if (g_pCompositor->explicitConfigPath == "") { + CONFIGPATH = CONFIGPARENTPATH + (ISDEBUG ? "hyprlandd.conf" : "hyprland.conf"); + } else { + CONFIGPATH = g_pCompositor->explicitConfigPath; + } + configPaths.push_back(CONFIGPATH); + std::ifstream ifs; ifs.open(CONFIGPATH); if (!ifs.good()) { - Debug::log(WARN, "Config reading error. (No file? Attempting to generate, backing up old one if exists)"); - try { - std::filesystem::rename(CONFIGPATH, CONFIGPATH + ".backup"); - } catch(...) { /* Probably doesn't exist */} + if(g_pCompositor->explicitConfigPath == "") { + Debug::log(WARN, "Config reading error. (No file? Attempting to generate, backing up old one if exists)"); + try { + std::filesystem::rename(CONFIGPATH, CONFIGPATH + ".backup"); + } catch(...) { /* Probably doesn't exist */} - try { - if (!std::filesystem::is_directory(CONFIGPARENTPATH)) - std::filesystem::create_directories(CONFIGPARENTPATH); - } - catch (...) { - parseError = "Broken config file! (Could not create directory)"; - return; + try { + if (!std::filesystem::is_directory(CONFIGPARENTPATH)) + std::filesystem::create_directories(CONFIGPARENTPATH); + } + catch (...) { + parseError = "Broken config file! (Could not create directory)"; + return; + } } std::ofstream ofs; -- cgit v1.2.3 From 6306d4dae3fa221a6099e109c7faef60bac4fac5 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 15 Jul 2022 13:29:56 +0200 Subject: add remove, to blurls --- src/config/ConfigManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index ba73b777..e3db1856 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -579,6 +579,12 @@ void CConfigManager::handleWindowRule(const std::string& command, const std::str } void CConfigManager::handleBlurLS(const std::string& command, const std::string& value) { + if (value.find("remove,") == 0) { + const auto TOREMOVE = value.substr(7); + m_dBlurLSNamespaces.erase(std::remove(m_dBlurLSNamespaces.begin(), m_dBlurLSNamespaces.end(), TOREMOVE)); + return; + } + m_dBlurLSNamespaces.emplace_back(value); } -- cgit v1.2.3