diff --git a/install-scripts/sddm_theme.sh b/install-scripts/sddm_theme.sh index 2cdc5e8..54981c7 100755 --- a/install-scripts/sddm_theme.sh +++ b/install-scripts/sddm_theme.sh @@ -74,12 +74,20 @@ if git clone --depth 1 "$source_theme" "$theme_name"; then fi done else - # If the directory doesn't exist, create it and set up the new theme echo "$CAT - $sddm_conf_dir not found, creating..." | tee -a "$LOG" sudo mkdir -p "$sddm_conf_dir" 2>&1 | tee -a "$LOG" + fi - echo -e "[Theme]\nCurrent=$theme_name" | sudo tee "$sddm_conf_dir/theme.conf.user" 2>&1 | tee -a "$LOG" - echo "Created and configured $sddm_conf_dir/theme.conf.user with theme $theme_name" | tee -a "$LOG" + if [ ! -f "$sddm_conf_dir/theme.conf.user" ]; then + echo -e "[Theme]\nCurrent = $theme_name" | sudo tee "$sddm_conf_dir/theme.conf.user" > /dev/null + + if [ -f "$sddm_conf_dir/theme.conf.user" ]; then + echo "Created and configured $sddm_conf_dir/theme.conf.user with theme $theme_name" | tee -a "$LOG" + else + echo "Failed to create $sddm_conf_dir/theme.conf.user" | tee -a "$LOG" + fi + else + echo "$sddm_conf_dir/theme.conf.user already exists, skipping creation." | tee -a "$LOG" fi # Replace current background from assets