diff --git a/v2/debian-full.sh b/v2/debian-full.sh index 3fd7d98..9c7ab9e 100755 --- a/v2/debian-full.sh +++ b/v2/debian-full.sh @@ -129,6 +129,9 @@ if [[ "${DE}" == "xfce" || "${DDE}" == "xfce" ]]; then SOURCE_DIR="$SCRIPT_DIR/config-files/debian" DEST_DIR="$HOME" + # Variable to track if Xfce was running *before* we killed the processes + XFCE_WAS_RUNNING=0 + # 1. Check if the source directory exists if [ ! -d "$SOURCE_DIR" ]; then say_red "Error: Source directory '$SOURCE_DIR' not found. Aborting." @@ -162,11 +165,15 @@ if [[ "${DE}" == "xfce" || "${DDE}" == "xfce" ]]; then say_green "Configurations copied to disk." - # 4. Restart Xfce processes to load the new configuration (Conditional on initial state) - # We use the stored XFCE_WAS_RUNNING variable to ensure we restart if we killed processes. + # 4. Cleanup and Restart Xfce processes to load the new configuration if [ "$XFCE_WAS_RUNNING" -eq 1 ]; then - say_bold "Xfce was detected. Restarting components to load new configuration." + say_bold "Xfce was detected. Applying configuration changes immediately." + # CRITICAL FIX: Delete the session cache to prevent Xfce from restoring old settings + # This forces the session manager to read the new configuration files. + say_yellow "Clearing Xfce session cache to force a fresh configuration load..." + rm -rf "$HOME/.cache/sessions/" + # Restart Xfce processes to load the new configuration from the copied files say_cyan "Restarting Xfce environment components..."