From 588f669a603ab5be788642d37e41cc345bf76ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Thu, 7 May 2026 17:10:27 +0200 Subject: [PATCH] logon_script: gate KDE-specific settings on XDG_CURRENT_DESKTOP Wrap kwriteconfig5 calls in a KDE check so they are skipped on Cinnamon and other desktops. Also add empty-session setting so previous apps are not restored on login. Co-Authored-By: Claude Sonnet 4.6 --- system_setup/logon_script.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/system_setup/logon_script.sh b/system_setup/logon_script.sh index 26697ad..756d415 100755 --- a/system_setup/logon_script.sh +++ b/system_setup/logon_script.sh @@ -47,9 +47,12 @@ if [[ $? -ne 0 ]]; then echo "Error: python3-ipaclient is not installed. Please install it via: sudo dnf install python3-ipaclient" fi -#TODO C: Check if Desktop is KDE/Plasma and support other Displays -# Make kdesu use sudo -kwriteconfig5 --file kdesurc --group super-user-command --key super-user-command sudo >/dev/null 2>&1 +if [ "${XDG_CURRENT_DESKTOP}" = "KDE" ]; then + # Start each session empty (not restoring previous apps) - avoids stale mounts and autostart conflicts + kwriteconfig5 --file ksmserverrc --group General --key loginMode 2 >/dev/null 2>&1 + # Make kdesu use sudo + kwriteconfig5 --file kdesurc --group super-user-command --key super-user-command sudo >/dev/null 2>&1 +fi # Mount the private Directory elog_add_command "${SYSCONFIGPATH}/system_setup/mount_ecrypt_home.sh"