diff options
author | dranull <[email protected]> | 2024-01-14 17:12:52 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-01-14 18:12:52 +0100 |
commit | 13d9a637d61ffdd0cb23dda80f6a971f17e0f5b3 (patch) | |
tree | 7460428fe95e9503ea744302246cbd476de1ac3d | |
parent | 4cee94b91c9337036f3ea94f80cf8259c5c51cb4 (diff) | |
download | Hyprland-13d9a637d61ffdd0cb23dda80f6a971f17e0f5b3.tar.gz Hyprland-13d9a637d61ffdd0cb23dda80f6a971f17e0f5b3.zip |
hyprctl: screen_shader config fixes (#4102)
* Allow "/" in values of requests
* Don't tick on empty value
-rw-r--r-- | src/config/ConfigManager.cpp | 2 | ||||
-rw-r--r-- | src/debug/HyprCtl.cpp | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 69128c52..57985c41 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -550,7 +550,7 @@ void CConfigManager::configSetValueSafe(const std::string& COMMAND, const std::s } } - if (COMMAND == "decoration:screen_shader") { + if (COMMAND == "decoration:screen_shader" && VALUE != STRVAL_EMPTY) { const auto PATH = absolutePath(VALUE, configCurrentPath); configPaths.push_back(PATH); diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 78d20903..490f14c9 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -1402,13 +1402,20 @@ std::string getReply(std::string request) { auto format = HyprCtl::FORMAT_NORMAL; // process flags for non-batch requests - if (!request.contains("[[BATCH]]") && request.contains("/")) { + if (!request.starts_with("[[BATCH]]") && request.contains("/")) { long unsigned int sepIndex = 0; for (const auto& c : request) { if (c == '/') { // stop at separator break; } + // after whitespace assume the first word as a keyword, + // so its value can have slashes (e.g., a path) + if (c == ' ') { + sepIndex = request.size(); + break; + } + sepIndex++; if (c == 'j') |