summaryrefslogtreecommitdiff
path: root/src/plugins/PluginAPI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/PluginAPI.cpp')
-rw-r--r--src/plugins/PluginAPI.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/PluginAPI.cpp b/src/plugins/PluginAPI.cpp
index 8d2f6627..a873644e 100644
--- a/src/plugins/PluginAPI.cpp
+++ b/src/plugins/PluginAPI.cpp
@@ -160,6 +160,19 @@ APICALL bool HyprlandAPI::addConfigValue(HANDLE handle, const std::string& name,
return true;
}
+APICALL bool HyprlandAPI::addConfigKeyword(HANDLE handle, const std::string& name, std::function<void(const std::string& key, const std::string& val)> fn) {
+ auto* const PLUGIN = g_pPluginSystem->getPluginByHandle(handle);
+
+ if (!g_pPluginSystem->m_bAllowConfigVars)
+ return false;
+
+ if (!PLUGIN)
+ return false;
+
+ g_pConfigManager->addPluginKeyword(handle, name, fn);
+ return true;
+}
+
APICALL SConfigValue* HyprlandAPI::getConfigValue(HANDLE handle, const std::string& name) {
auto* const PLUGIN = g_pPluginSystem->getPluginByHandle(handle);