mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 06:25:59 +01:00
hyprctl: screen_shader config fixes (#4102)
* Allow "/" in values of requests * Don't tick on empty value
This commit is contained in:
parent
4cee94b91c
commit
13d9a637d6
2 changed files with 9 additions and 2 deletions
|
@ -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);
|
const auto PATH = absolutePath(VALUE, configCurrentPath);
|
||||||
|
|
||||||
configPaths.push_back(PATH);
|
configPaths.push_back(PATH);
|
||||||
|
|
|
@ -1402,13 +1402,20 @@ std::string getReply(std::string request) {
|
||||||
auto format = HyprCtl::FORMAT_NORMAL;
|
auto format = HyprCtl::FORMAT_NORMAL;
|
||||||
|
|
||||||
// process flags for non-batch requests
|
// process flags for non-batch requests
|
||||||
if (!request.contains("[[BATCH]]") && request.contains("/")) {
|
if (!request.starts_with("[[BATCH]]") && request.contains("/")) {
|
||||||
long unsigned int sepIndex = 0;
|
long unsigned int sepIndex = 0;
|
||||||
for (const auto& c : request) {
|
for (const auto& c : request) {
|
||||||
if (c == '/') { // stop at separator
|
if (c == '/') { // stop at separator
|
||||||
break;
|
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++;
|
sepIndex++;
|
||||||
|
|
||||||
if (c == 'j')
|
if (c == 'j')
|
||||||
|
|
Loading…
Reference in a new issue