mirror of
https://github.com/JaKooLit/Debian-Hyprland.git
synced 2025-12-21 02:10:13 +01:00
updated sddm_theme.sh
This commit is contained in:
parent
8e972b6c13
commit
74f1b6ea84
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user