From 69d17bf4240e41f2b26abd7a46dfd0e754e9ee9e Mon Sep 17 00:00:00 2001 From: FlafyDev Date: Fri, 19 Aug 2022 21:01:51 +0300 Subject: add input:kb_file --- src/config/ConfigManager.cpp | 47 ++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 19 deletions(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 5f7725a2..37ea10fc 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -119,6 +119,7 @@ void CConfigManager::setDefaultVars() { configValues["animations:workspaces"].intValue = 1; configValues["input:sensitivity"].floatValue = 0.f; + configValues["input:kb_file"].strValue = STRVAL_EMPTY; configValues["input:kb_layout"].strValue = "us"; configValues["input:kb_variant"].strValue = STRVAL_EMPTY; configValues["input:kb_options"].strValue = STRVAL_EMPTY; @@ -155,6 +156,7 @@ void CConfigManager::setDeviceDefaultVars(const std::string& dev) { auto& cfgValues = deviceConfigs[dev]; cfgValues["sensitivity"].floatValue = 0.f; + cfgValues["kb_file"].strValue = STRVAL_EMPTY; cfgValues["kb_layout"].strValue = "us"; cfgValues["kb_variant"].strValue = STRVAL_EMPTY; cfgValues["kb_options"].strValue = STRVAL_EMPTY; @@ -774,28 +776,13 @@ void CConfigManager::handleSubmap(const std::string& command, const std::string& void CConfigManager::handleSource(const std::string& command, const std::string& rawpath) { static const char* const ENVHOME = getenv("HOME"); - auto value = rawpath; - - if (value.length() < 2) { + if (rawpath.length() < 2) { Debug::log(ERR, "source= path garbage"); - parseError = "source path " + value + " bogus!"; + parseError = "source path " + rawpath + " 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)); - } + auto value = absolutePath(rawpath); if (!std::filesystem::exists(value)) { Debug::log(ERR, "source= file doesnt exist"); @@ -889,6 +876,28 @@ std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std:: return parseError; } +std::string CConfigManager::absolutePath(const std::string& rawpath) { + auto value = rawpath; + + 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] == '~') { + static const char* const ENVHOME = getenv("HOME"); + value.replace(0, 1, std::string(ENVHOME)); + } + + return value; +} + void CConfigManager::applyUserDefinedVars(std::string& line, const size_t equalsPlace) { auto dollarPlace = line.find_first_of('$', equalsPlace); @@ -1379,4 +1388,4 @@ SAnimationPropertyConfig* CConfigManager::getAnimationPropertyConfig(const std:: void CConfigManager::addParseError(const std::string& err) { if (parseError == "") parseError = err; -} \ No newline at end of file +} -- cgit v1.2.3 From c2a3896cc9168a12f25a144dada6ecb94fb52b59 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Fri, 19 Aug 2022 22:03:35 +0200 Subject: added dwindle:use_active_for_splits --- 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 5f7725a2..47f10bc5 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -92,6 +92,7 @@ void CConfigManager::setDefaultVars() { configValues["dwindle:special_scale_factor"].floatValue = 0.8f; configValues["dwindle:split_width_multiplier"].floatValue = 1.0f; configValues["dwindle:no_gaps_when_only"].intValue = 0; + configValues["dwindle:use_active_for_splits"].intValue = 1; configValues["master:special_scale_factor"].floatValue = 0.8f; configValues["master:new_is_master"].intValue = 1; -- cgit v1.2.3 From f0ad77251b28fcf48dcaf25f23e3a140d69a4735 Mon Sep 17 00:00:00 2001 From: FlafyDev Date: Fri, 19 Aug 2022 23:18:09 +0300 Subject: move absolutePath to MiscFunctions --- src/config/ConfigManager.cpp | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 37ea10fc..162c8611 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -782,7 +782,7 @@ void CConfigManager::handleSource(const std::string& command, const std::string& return; } - auto value = absolutePath(rawpath); + auto value = absolutePath(rawpath, configCurrentPath); if (!std::filesystem::exists(value)) { Debug::log(ERR, "source= file doesnt exist"); @@ -876,28 +876,6 @@ std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std:: return parseError; } -std::string CConfigManager::absolutePath(const std::string& rawpath) { - auto value = rawpath; - - 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] == '~') { - static const char* const ENVHOME = getenv("HOME"); - value.replace(0, 1, std::string(ENVHOME)); - } - - return value; -} - void CConfigManager::applyUserDefinedVars(std::string& line, const size_t equalsPlace) { auto dollarPlace = line.find_first_of('$', equalsPlace); -- cgit v1.2.3 From 132c96f867198cb68e77ed9930165c51bb8e49f7 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 20 Aug 2022 18:47:48 +0200 Subject: multiple fixes for device configs --- src/config/ConfigManager.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index e1108b22..ff1791f5 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -912,6 +912,7 @@ void CConfigManager::parseLine(std::string& line) { if (line.contains(" {")) { auto cat = line.substr(0, line.find(" {")); transform(cat.begin(), cat.end(), cat.begin(), ::tolower); + std::replace(cat.begin(), cat.end(), ' ', '-'); if (currentCategory.length() != 0) { currentCategory.push_back(':'); currentCategory.append(cat); @@ -1140,9 +1141,13 @@ SConfigValue CConfigManager::getConfigValueSafe(const std::string& val) { SConfigValue CConfigManager::getConfigValueSafeDevice(const std::string& dev, const std::string& val) { std::lock_guard lg(configmtx); - const auto it = deviceConfigs.find(dev); + auto devcopy = dev; + std::replace(devcopy.begin(), devcopy.end(), ' ', '-'); + + const auto it = deviceConfigs.find(devcopy); if (it == deviceConfigs.end()) { + Debug::log(ERR, "getConfigValueSafeDevice: No device config for %s found???", devcopy.c_str()); return SConfigValue(); } @@ -1155,7 +1160,7 @@ SConfigValue CConfigManager::getConfigValueSafeDevice(const std::string& dev, co if (foundIt == std::string::npos) continue; - if (foundIt == cv.first.length() - val.length()) { + if (cv.first == "input:" + val || cv.first == "input:touchpad:" + cv.first) { copy = cv.second; } } @@ -1334,7 +1339,10 @@ SConfigValue* CConfigManager::getConfigValuePtrSafe(std::string val) { } bool CConfigManager::deviceConfigExists(const std::string& dev) { - const auto it = deviceConfigs.find(dev); + auto copy = dev; + std::replace(copy.begin(), copy.end(), ' ', '-'); + + const auto it = deviceConfigs.find(copy); return it != deviceConfigs.end(); } -- cgit v1.2.3 From d6ff7e40cfde6a8484b50911358032b4c53c721c Mon Sep 17 00:00:00 2001 From: Charles Taylor Date: Sun, 21 Aug 2022 20:40:06 +1000 Subject: add general:workspace_back_and_forth option --- 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 ff1791f5..53c008f9 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -34,6 +34,7 @@ void CConfigManager::setDefaultVars() { configValues["general:apply_sens_to_raw"].intValue = 0; configValues["general:main_mod"].strValue = "SUPER"; // exposed to the user for easier configuring configValues["general:main_mod_internal"].intValue = g_pKeybindManager->stringToModMask("SUPER"); // actually used and automatically calculated + configValues["general:workspace_back_and_forth"].intValue = 0; configValues["general:damage_tracking"].strValue = "full"; configValues["general:damage_tracking_internal"].intValue = DAMAGE_TRACKING_FULL; -- cgit v1.2.3 From 9ee42836d5e2c707f7cf203628a0ae530d59c5cd Mon Sep 17 00:00:00 2001 From: Charles Taylor Date: Sun, 21 Aug 2022 20:47:56 +1000 Subject: add general:allow_workspace_cycles option --- 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 53c008f9..079d9a8d 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -35,6 +35,7 @@ void CConfigManager::setDefaultVars() { configValues["general:main_mod"].strValue = "SUPER"; // exposed to the user for easier configuring configValues["general:main_mod_internal"].intValue = g_pKeybindManager->stringToModMask("SUPER"); // actually used and automatically calculated configValues["general:workspace_back_and_forth"].intValue = 0; + configValues["general:allow_workspace_cycles"].intValue = 0; configValues["general:damage_tracking"].strValue = "full"; configValues["general:damage_tracking_internal"].intValue = DAMAGE_TRACKING_FULL; -- cgit v1.2.3 From 3c8c605541d6b3e046951ba8710dfb2e9452a3de Mon Sep 17 00:00:00 2001 From: Charles Taylor Date: Sun, 21 Aug 2022 21:58:46 +1000 Subject: fix style conflicts and config + monitor retrieval --- 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 079d9a8d..893f4ef0 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -34,8 +34,6 @@ void CConfigManager::setDefaultVars() { configValues["general:apply_sens_to_raw"].intValue = 0; configValues["general:main_mod"].strValue = "SUPER"; // exposed to the user for easier configuring configValues["general:main_mod_internal"].intValue = g_pKeybindManager->stringToModMask("SUPER"); // actually used and automatically calculated - configValues["general:workspace_back_and_forth"].intValue = 0; - configValues["general:allow_workspace_cycles"].intValue = 0; configValues["general:damage_tracking"].strValue = "full"; configValues["general:damage_tracking_internal"].intValue = DAMAGE_TRACKING_FULL; @@ -142,6 +140,8 @@ void CConfigManager::setDefaultVars() { configValues["binds:pass_mouse_when_bound"].intValue = 1; configValues["binds:scroll_event_delay"].intValue = 300; + configValues["binds:workspace_back_and_forth"].intValue = 0; + configValues["binds:allow_workspace_cycles"].intValue = 0; configValues["gestures:workspace_swipe"].intValue = 0; configValues["gestures:workspace_swipe_fingers"].intValue = 3; -- cgit v1.2.3