From 74f1b6ea84187a2e3f1fc48335a7a6ef4c4de6f2 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Sun, 16 Feb 2025 14:19:15 +0900 Subject: [PATCH] updated sddm_theme.sh --- install-scripts/sddm_theme.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/install-scripts/sddm_theme.sh b/install-scripts/sddm_theme.sh index 742f1e6..2cdc5e8 100755 --- a/install-scripts/sddm_theme.sh +++ b/install-scripts/sddm_theme.sh @@ -55,24 +55,20 @@ if git clone --depth 1 "$source_theme" "$theme_name"; then echo -e "${NOTE} Setting up the login screen." | tee -a "$LOG" if [ -d "$sddm_conf_dir" ]; then - # If the directory exists, backup present files echo "Backing up files in $sddm_conf_dir" | tee -a "$LOG" for file in "$sddm_conf_dir"/*; do if [ -f "$file" ]; then - # not change the backed up files if [[ "$file" == *$BACKUP_SUFFIX ]]; then echo "Skipping backup file: $file" | tee -a "$LOG" continue fi - # Backup each original file sudo cp "$file" "$file$BACKUP_SUFFIX" 2>&1 | tee -a "$LOG" echo "Backup created for $file" | tee -a "$LOG" - # editing present files in "/etc/sddm.conf.d" + # Edit existing "Current=" if grep -q '^[[:space:]]*Current=' "$file"; then - sudo sed -i 's/^[[:space:]]*Current=/#&/' "$file" 2>&1 | tee -a "$LOG" - sudo sed -i "s/^[[:space:]]*#Current=.*/Current=$theme_name/" "$file" 2>&1 | tee -a "$LOG" + sudo sed -i "s/^[[:space:]]*Current=.*/Current=$theme_name/" "$file" 2>&1 | tee -a "$LOG" echo "Updated theme in $file" | tee -a "$LOG" fi fi