diff options
| author | JaKooLit <ejhay.games@gmail.com> | 2025-02-22 01:02:43 +0900 |
|---|---|---|
| committer | JaKooLit <ejhay.games@gmail.com> | 2025-02-22 01:02:43 +0900 |
| commit | eb18f06d8cb34b529567016812c9b3a454280859 (patch) | |
| tree | 8e211b479642723595828c822937f83690d75610 /copy.sh | |
| parent | b486e85ebb19b1a6904c7324d559b9ddb533c93c (diff) | |
wallpapers and waybar config and styles will be restored automatically
Diffstat (limited to 'copy.sh')
| -rwxr-xr-x | copy.sh | 39 |
1 files changed, 16 insertions, 23 deletions
@@ -483,26 +483,23 @@ for DIR2 in $DIRS; do [Yy]* ) BACKUP_DIR=$(get_backup_dirname) + # Backup the existing directory mv "$DIRPATH" "$DIRPATH-backup-$BACKUP_DIR" 2>&1 | tee -a "$LOG" - if [ $? -eq 0 ]; then - echo -e "${NOTE} - Backed up $DIR2 to $DIRPATH-backup-$BACKUP_DIR." 2>&1 | tee -a "$LOG" - - cp -r config/"$DIR2" ~/.config/"$DIR2" - if [ $? -eq 0 ]; then - echo -e "${OK} - Replaced $DIR2 with new configuration." 2>&1 | tee -a "$LOG" - else - echo "${ERROR} - Failed to copy $DIR2." 2>&1 | tee -a "$LOG" - exit 1 - fi - else - echo "${ERROR} - Failed to back up $DIR2." 2>&1 | tee -a "$LOG" - exit 1 + echo -e "${NOTE} - Backed up $DIR2 to $DIRPATH-backup-$BACKUP_DIR." 2>&1 | tee -a "$LOG" + + # Copy the new config + cp -r config/"$DIR2" ~/.config/"$DIR2" 2>&1 | tee -a "$LOG" + echo -e "${OK} - Replaced $DIR2 with new configuration." 2>&1 | tee -a "$LOG" + + # restoring waybar config and style automatically + if [ "$DIR2" = "waybar" ]; then + cp "$DIRPATH-backup-$BACKUP_DIR/config" ~/.config/waybar/ && cp "$DIRPATH-backup-$BACKUP_DIR/style.css" ~/.config/waybar/ + echo -e "${OK} - waybar config and style restored automatically" 2>&1 | tee -a "$LOG" fi break ;; [Nn]* ) - # Skip the directory - echo -e "${NOTE} - Skipping ${YELLOW}$DIR2${RESET} " 2>&1 | tee -a "$LOG" + echo -e "${NOTE} - Skipping ${YELLOW}$DIR2${RESET}" 2>&1 | tee -a "$LOG" break ;; * ) @@ -513,14 +510,10 @@ for DIR2 in $DIRS; do else # Copy new config if directory does not exist cp -r config/"$DIR2" ~/.config/"$DIR2" 2>&1 | tee -a "$LOG" - if [ $? -eq 0 ]; then - echo "${OK} - Copy completed for ${YELLOW}$DIR2${RESET}" 2>&1 | tee -a "$LOG" - else - echo "${ERROR} - Failed to copy ${YELLOW}$DIR2${RESET}" 2>&1 | tee -a "$LOG" - exit 1 - fi + echo "${OK} - Copy completed for ${YELLOW}$DIR2${RESET}" 2>&1 | tee -a "$LOG" fi done + printf "\n%.0s" {1..1} printf "${INFO} - Copying dotfiles ${SKY_BLUE}second${RESET} part\n" @@ -586,7 +579,7 @@ BACKUP_HYPR_PATH="$HYPR_DIR-backup-$BACKUP_DIR" if [ -d "$BACKUP_HYPR_PATH" ]; then echo -e "\n${NOTE} Restoring ${SKY_BLUE}Animations & Monitor Profiles${RESET} directories into ${YELLOW}$HYPR_DIR${RESET}..." - DIR_B=("Monitor_Profiles" "animations") + DIR_B=("Monitor_Profiles" "animations" "wallpaper_effects") # Restore directories automatically for DIR_RESTORE in "${DIR_B[@]}"; do BACKUP_SUBDIR="$BACKUP_HYPR_PATH/$DIR_RESTORE" @@ -598,7 +591,7 @@ if [ -d "$BACKUP_HYPR_PATH" ]; then done # Restore files automatically - FILE_B=("monitors.conf" "workspaces.conf") + FILE_B=("monitors.conf" "workspaces.conf" "pyprland.toml") for FILE_RESTORE in "${FILE_B[@]}"; do BACKUP_FILE="$BACKUP_HYPR_PATH/$FILE_RESTORE" |
