summaryrefslogtreecommitdiff
path: root/src/plugins/PluginAPI.cpp
diff options
context:
space:
mode:
authorStanisław Zagórowski <hasohasacz@gmail.com>2023-03-07 11:42:33 +0100
committerGitHub <noreply@github.com>2023-03-07 10:42:33 +0000
commitb11e2eaa3b4a87d004616d635e167bea29fa3dc7 (patch)
tree4146d623edf5136e442cd4b90aa9c62d43d58b29 /src/plugins/PluginAPI.cpp
parent0aeb61a95af38ad20dd4d0f8a4ec1d485d73352f (diff)
Fix plugin argument-less hyprctl calls (#1723)
Handle hyprctl command whitespace trimming might break
Diffstat (limited to 'src/plugins/PluginAPI.cpp')
-rw-r--r--src/plugins/PluginAPI.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/PluginAPI.cpp b/src/plugins/PluginAPI.cpp
index dc8c9707..8c816546 100644
--- a/src/plugins/PluginAPI.cpp
+++ b/src/plugins/PluginAPI.cpp
@@ -39,8 +39,10 @@ APICALL bool HyprlandAPI::unregisterCallback(HANDLE handle, HOOK_CALLBACK_FN* fn
}
APICALL std::string HyprlandAPI::invokeHyprctlCommand(const std::string& call, const std::string& args, const std::string& format) {
- std::string COMMAND = format + "/" + call + " " + args;
- return HyprCtl::makeDynamicCall(COMMAND);
+ if (args.empty())
+ return HyprCtl::makeDynamicCall(format + "/" + call);
+ else
+ return HyprCtl::makeDynamicCall(format + "/" + call + " " + args);
}
APICALL bool HyprlandAPI::addLayout(HANDLE handle, const std::string& name, IHyprLayout* layout) {
@@ -190,4 +192,4 @@ APICALL bool HyprlandAPI::removeDispatcher(HANDLE handle, const std::string& nam
std::erase_if(PLUGIN->registeredDispatchers, [&](const auto& other) { return other == name; });
return true;
-} \ No newline at end of file
+}