From 682b30fba89c043e86d9c96bdb8df133c1683054 Mon Sep 17 00:00:00 2001 From: Vladimir-csp <4061903+Vladimir-csp@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:19:08 +0300 Subject: [PATCH] env: Add HYPRLAND_NO_SD_VARS env condition (#7358) * Add HYPRLAND_NO_SD_VARS env condition wip #7083 * Formatting shuffle * Formatting --- src/Compositor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 4024fadf..9d247a56 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -429,7 +429,7 @@ void CCompositor::cleanEnvironment() { if (m_bDesktopEnvSet) unsetenv("XDG_CURRENT_DESKTOP"); - if (m_pAqBackend->hasSession()) { + if (m_pAqBackend->hasSession() && !envEnabled("HYPRLAND_NO_SD_VARS")) { const auto CMD = #ifdef USES_SYSTEMD "systemctl --user unset-environment DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP QT_QPA_PLATFORMTHEME PATH XDG_DATA_DIRS && hash " @@ -659,7 +659,11 @@ void CCompositor::prepareFallbackOutput() { void CCompositor::startCompositor() { signal(SIGPIPE, SIG_IGN); - if (m_pAqBackend->hasSession() /* Session-less Hyprland usually means a nest, don't update the env in that case */) { + if ( + /* Session-less Hyprland usually means a nest, don't update the env in that case */ + m_pAqBackend->hasSession() && + /* Activation environment management is not disabled */ + !envEnabled("HYPRLAND_NO_SD_VARS")) { const auto CMD = #ifdef USES_SYSTEMD "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP QT_QPA_PLATFORMTHEME PATH XDG_DATA_DIRS && hash "