From 90c5715bc6a3c9551ae13c9ac4e3578823e27e0b Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 5 Mar 2023 13:15:12 +0000 Subject: [PATCH] add env dbus opt --- src/config/ConfigManager.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 78543609..5037d9cb 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1051,6 +1051,15 @@ void CConfigManager::handleEnv(const std::string& command, const std::string& va } setenv(ARGS[0].c_str(), ARGS[1].c_str(), 1); + + if (command.back() == 'd') { + // dbus + const auto CMD = "systemctl --user import-environment " + ARGS[0] + + " && hash dbus-update-activation-environment 2>/dev/null && " + "dbus-update-activation-environment --systemd " + + ARGS[0]; + handleRawExec("", CMD.c_str()); + } } std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std::string& VALUE, bool dynamic) { @@ -1097,7 +1106,7 @@ std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std:: handleBlurLS(COMMAND, VALUE); else if (COMMAND == "wsbind") handleBindWS(COMMAND, VALUE); - else if (COMMAND == "env") + else if (COMMAND.find("env") == 0) handleEnv(COMMAND, VALUE); else { configSetValueSafe(currentCategory + (currentCategory == "" ? "" : ":") + COMMAND, VALUE);