From 32954ef25b2eb8081587e7ea9e3c6e4c5388cd57 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Fri, 21 Feb 2025 22:12:09 +0900 Subject: updated copy.sh --- copy.sh | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/copy.sh b/copy.sh index 3fdd7f25..b1344b2b 100755 --- a/copy.sh +++ b/copy.sh @@ -583,29 +583,31 @@ HYPR_DIR="$HOME/.config/hypr" BACKUP_DIR=$(get_backup_dirname) BACKUP_HYPR_PATH="$HYPR_DIR-backup-$BACKUP_DIR" -echo -e "\n${NOTE} Restoring ${SKY_BLUE}Animations & Monitor Profiles${RESET} directories into ${YELLOW}$HYPR_DIR${RESET}..." - -DIR_B=("Monitor_Profiles" "animations") -# Restore directories automatically -for DIR_RESTORE in "${DIR_B[@]}"; do - BACKUP_SUBDIR="$BACKUP_HYPR_PATH/$DIR_RESTORE" +if [ -d "$BACKUP_HYPR_PATH" ]; then + echo -e "\n${NOTE} Restoring ${SKY_BLUE}Animations & Monitor Profiles${RESET} directories into ${YELLOW}$HYPR_DIR${RESET}..." - if [ -d "$BACKUP_SUBDIR" ]; then - cp -r "$BACKUP_SUBDIR" "$HYPR_DIR/" - echo "${OK} - Restored directory: ${MAGENTA}$DIR_RESTORE${RESET}" 2>&1 | tee -a "$LOG" - fi -done + DIR_B=("Monitor_Profiles" "animations") + # Restore directories automatically + for DIR_RESTORE in "${DIR_B[@]}"; do + BACKUP_SUBDIR="$BACKUP_HYPR_PATH/$DIR_RESTORE" + + if [ -d "$BACKUP_SUBDIR" ]; then + cp -r "$BACKUP_SUBDIR" "$HYPR_DIR/" + echo "${OK} - Restored directory: ${MAGENTA}$DIR_RESTORE${RESET}" 2>&1 | tee -a "$LOG" + fi + done -# Restore files automatically -FILE_B=("monitors.conf" "workspaces.conf") -for FILE_RESTORE in "${FILE_B[@]}"; do - BACKUP_FILE="$BACKUP_HYPR_PATH/$FILE_RESTORE" + # Restore files automatically + FILE_B=("monitors.conf" "workspaces.conf") + for FILE_RESTORE in "${FILE_B[@]}"; do + BACKUP_FILE="$BACKUP_HYPR_PATH/$FILE_RESTORE" - if [ -f "$BACKUP_FILE" ]; then - cp "$BACKUP_FILE" "$HYPR_DIR/$FILE_RESTORE" - echo "${OK} - Restored file: ${MAGENTA}$FILE_RESTORE${RESET}" 2>&1 | tee -a "$LOG" - fi -done + if [ -f "$BACKUP_FILE" ]; then + cp "$BACKUP_FILE" "$HYPR_DIR/$FILE_RESTORE" + echo "${OK} - Restored file: ${MAGENTA}$FILE_RESTORE${RESET}" 2>&1 | tee -a "$LOG" + fi + done +fi printf "\n%.0s" {1..1} -- cgit v1.2.3