From 13d9a637d61ffdd0cb23dda80f6a971f17e0f5b3 Mon Sep 17 00:00:00 2001 From: dranull <150595692+dranull@users.noreply.github.com> Date: Sun, 14 Jan 2024 17:12:52 +0000 Subject: [PATCH] hyprctl: screen_shader config fixes (#4102) * Allow "/" in values of requests * Don't tick on empty value --- src/config/ConfigManager.cpp | 2 +- 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')