From f97b90859ae95571a2a16cd9827f5f623369c732 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 9 Jun 2022 15:03:34 +0200 Subject: [PATCH] Add envvars to exec cfg --- src/config/ConfigManager.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index ad5ea5a7..56548580 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -156,8 +156,18 @@ void CConfigManager::configSetValueSafe(const std::string& COMMAND, const std::s void CConfigManager::handleRawExec(const std::string& command, const std::string& args) { // Exec in the background dont wait for it. + + std::string toExec = args; + + if (g_pXWaylandManager->m_sWLRXWayland) + toExec = std::string("WAYLAND_DISPLAY=") + std::string(g_pCompositor->m_szWLDisplaySocket) + " DISPLAY=" + std::string(g_pXWaylandManager->m_sWLRXWayland->display_name) + " " + toExec; + else + toExec = std::string("WAYLAND_DISPLAY=") + std::string(g_pCompositor->m_szWLDisplaySocket) + " " + toExec; + + Debug::log(LOG, "Config executing %s", toExec.c_str()); + if (fork() == 0) { - execl("/bin/sh", "/bin/sh", "-c", args.c_str(), nullptr); + execl("/bin/sh", "/bin/sh", "-c", toExec.c_str(), nullptr); _exit(0); }