Skip to content

Commit

Permalink
Merge pull request #445 from JaKooLit/development
Browse files Browse the repository at this point in the history
updated copy.sh
  • Loading branch information
JaKooLit authored Sep 16, 2024
2 parents 1320496 + 2c87bc3 commit ea5a4b1
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions copy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ NOTE:
echo "${NOTE} kb_layout $new_layout configured in settings." 2>&1 | tee -a "$LOG"
break ;;
*)
echo "Please enter either 'y' or 'n'." ;;
echo "${ERROR} Please enter either 'y' or 'n'." ;;
esac
done

Expand Down Expand Up @@ -212,7 +212,7 @@ while true; do
break
;;
*)
echo "Invalid choice. Please enter 1 for ≤ 1080p or 2 for ≥ 1440p."
echo "${ERROR} Invalid choice. Please enter 1 for ≤ 1080p or 2 for ≥ 1440p."
;;
esac
done
Expand Down Expand Up @@ -292,15 +292,15 @@ while true; do
sudo sed -i 's|^## HourFormat="hh:mm AP"|HourFormat="hh:mm AP"|' "$sddm_folder_2/theme.conf" 2>&1 | tee -a "$LOG" || true
sudo sed -i 's|^HourFormat="HH:mm"|## HourFormat="HH:mm"|' "$sddm_folder_2/theme.conf" 2>&1 | tee -a "$LOG" || true

echo "12H format set to SDDM theme successfully." 2>&1 | tee -a "$LOG"
echo "${OK} 12H format set to SDDM theme successfully." 2>&1 | tee -a "$LOG"
fi

break
elif [[ "$answer" == "n" ]]; then
echo "You chose not to change to 12H format." 2>&1 | tee -a "$LOG"
break
else
echo "Invalid choice. Please enter y for yes or n for no."
echo "${ERROR} Invalid choice. Please enter y for yes or n for no."
fi
done

Expand Down Expand Up @@ -379,19 +379,19 @@ for DIR2 in $DIRS; do

if [ -d "$DIRPATH" ]; then
while true; do
read -p "${CAT} Config directory $DIR2 already exists. Do you want to replace it? (Y/N): " CHOICE
read -p "${CAT} ${ORANGE}$DIR2${RESET} config found in ~/.config/ Do you want to replace ${ORANGE}$DIR2${RESET} config? (Y/N): " CHOICE
case "$CHOICE" in
[Yy]* )
BACKUP_DIR=$(get_backup_dirname)
echo -e "${NOTE} - Config for $DIR2 found, attempting to back up."
echo -e "${NOTE} - Config for ${YELLOW}$DIR2${RESET} found, attempting to back up."

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" 2>&1 | tee -a "$LOG"
cp -r config/"$DIR2" ~/.config/"$DIR2"
if [ $? -eq 0 ]; then
echo -e "${OK} - Replaced $DIR2 with new configuration."
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
Expand All @@ -404,7 +404,7 @@ for DIR2 in $DIRS; do
;;
[Nn]* )
# Skip the directory
echo -e "${NOTE} - Skipping $DIR2." 2>&1 | tee -a "$LOG"
echo -e "${NOTE} - Skipping ${ORANGE}$DIR2${RESET} " 2>&1 | tee -a "$LOG"
break
;;
* )
Expand All @@ -416,9 +416,9 @@ for DIR2 in $DIRS; do
# 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 $DIR2." 2>&1 | tee -a "$LOG"
echo "${OK} - Copy completed for ${YELLOW}$DIR2${RESET}" 2>&1 | tee -a "$LOG"
else
echo "${ERROR} - Failed to copy $DIR2." 2>&1 | tee -a "$LOG"
echo "${ERROR} - Failed to copy ${YELLOW}$DIR2${RESET}" 2>&1 | tee -a "$LOG"
exit 1
fi
fi
Expand All @@ -428,7 +428,7 @@ printf "\n%.0s" {1..1}

# copying Wallpapers
mkdir -p ~/Pictures/wallpapers
cp -r wallpapers ~/Pictures/ && { echo "${OK}Copy of wallpapers completed!"; } || { echo "${ERROR} Failed to copy wallpapers."; exit 1; } 2>&1 | tee -a "$LOG"
cp -r wallpapers ~/Pictures/ && { echo "${OK} some wallpapers compied!"; } || { echo "${ERROR} Failed to copy some wallpapers."; exit 1; } 2>&1 | tee -a "$LOG"

# Set some files as executable
chmod +x ~/.config/hypr/scripts/* 2>&1 | tee -a "$LOG"
Expand Down Expand Up @@ -486,7 +486,7 @@ while true; do
fi
;;
[Nn])
echo "You chose not to download additional wallpapers." 2>&1 | tee -a "$LOG"
echo "${NOTE} You chose not to download additional wallpapers." 2>&1 | tee -a "$LOG"
break
;;
*)
Expand Down

0 comments on commit ea5a4b1

Please sign in to comment.