From 4363e9c1a995b82db5b2c96e58dc64e1fd81bb34 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Sun, 23 Feb 2025 09:44:55 +0900 Subject: anothe copy.sh changes for waybar and rofi handling --- copy.sh | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/copy.sh b/copy.sh index d22d0fce..f3a6b9dd 100755 --- a/copy.sh +++ b/copy.sh @@ -507,29 +507,31 @@ for DIR2 in $DIRS; do echo -e "${OK} - previous waybar configs and styles restored automatically" 2>&1 | tee -a "$LOG" - # Optionally restore other waybar configuration and style files if present - find "$DIRPATH-backup-$BACKUP_DIR/configs" -type f -exec sh -c ' - echo "Copying {} to $HOME/.config/waybar/configs/" >> "$LOG" - cp -n "{}" "$HOME/.config/waybar/configs/" - ' \; || true - - find "$DIRPATH-backup-$BACKUP_DIR/style" -type f -exec sh -c ' - echo "Copying {} to $HOME/.config/waybar/style/" >> "$LOG" - cp -n "{}" "$HOME/.config/waybar/style/" - ' \; || true + # Optionally restore other waybar configuration and style files if present + for file in "$DIRPATH-backup-$BACKUP_DIR/configs"/*; do + [ -e "$file" ] || continue # Skip if no files are found + echo "Copying $file to $HOME/.config/waybar/configs/" >> "$LOG" + cp -n "$file" "$HOME/.config/waybar/configs/" + done || true + + for file in "$DIRPATH-backup-$BACKUP_DIR/style"/*; do + [ -e "$file" ] || continue # Skip if no files are found + echo "Copying $file to $HOME/.config/waybar/style/" >> "$LOG" + cp -n "$file" "$HOME/.config/waybar/style/" + done || true fi - - + # Restoring rofi themes directory unique themes if [ "$DIR2" = "rofi" ]; then if [ -d "$DIRPATH-backup-$BACKUP_DIR/themes" ]; then - find "$DIRPATH-backup-$BACKUP_DIR/themes" -type f -exec sh -c ' - echo "Copying {} to $HOME/.config/rofi/themes/" >> "$LOG" - cp -n "{}" "$HOME/.config/rofi/themes/" - ' \; || true + for file in "$DIRPATH-backup-$BACKUP_DIR/themes"/*; do + [ -e "$file" ] || continue # Skip if no files are found + echo "Copying $file to $HOME/.config/rofi/themes/" >> "$LOG" + cp -n "$file" "$HOME/.config/rofi/themes/" + done || true fi fi - + break ;; [Nn]* ) -- cgit v1.2.3