hyprctl: screen_shader config fixes (#4102)

* Allow "/" in values of requests

* Don't tick on empty value
This commit is contained in:
dranull
2024-01-14 17:12:52 +00:00
committed by GitHub
parent 4cee94b91c
commit 13d9a637d6
2 changed files with 9 additions and 2 deletions

View File

@@ -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')