env: Add HYPRLAND_NO_SD_VARS env condition (#7358)

* Add HYPRLAND_NO_SD_VARS env condition

wip #7083

* Formatting shuffle

* Formatting
This commit is contained in:
Vladimir-csp 2024-08-16 10:19:08 +03:00 committed by GitHub
parent 12d9901472
commit 682b30fba8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 "