From 10d45b5d995d169afa7278cc04238878c9a3439d Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Tue, 25 Mar 2025 00:59:47 +0900 Subject: [PATCH] install.sh updated to NOT exit if user choose N on the last part. Removed auto-clone instruction for Fish as it creates a big issue --- README.md | 8 +++----- install.sh | 36 ++++++++++++++++++++---------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 6dc4285..1fce12a 100644 --- a/README.md +++ b/README.md @@ -101,16 +101,14 @@ https://github.com/user-attachments/assets/49bc12b2-abaf-45de-a21c-67aacd9bb872 - After installation, check [`THIS`](https://github.com/JaKooLit/Hyprland-Dots/wiki/Notes_to_remember#--for-nvidia-gpu-users) ## ✨ Auto clone and install +> [!CAUTION] +> If you are using FISH SHELL, DO NOT use this function. Clone and ran install.sh instead + - you can use this command to automatically clone the installer and ran the script for you - NOTE: `curl` package is required before running this command ```bash sh <(curl -L https://raw.githubusercontent.com/JaKooLit/Arch-Hyprland/main/auto-install.sh) ``` -- if you are using like fish or a non-POSIX compliant terminal -```bash -curl -sL https://raw.githubusercontent.com/JaKooLit/Arch-Hyprland/main/auto-install.sh | bash -``` - ## ✨ to use this script - clone this repo (latest commit only) to reduce file size download by using git. Change directory, make executable and run the script diff --git a/install.sh b/install.sh index df4824e..6bd97b6 100755 --- a/install.sh +++ b/install.sh @@ -473,25 +473,28 @@ if pacman -Q hyprland &> /dev/null || pacman -Q hyprland-git &> /dev/null; then printf "\n${NOTE} You can start Hyprland by typing ${SKY_BLUE}Hyprland${RESET} (IF SDDM is not installed) (note the capital H!).\n" printf "\n${NOTE} However, it is ${YELLOW}highly recommended to reboot${RESET} your system.\n\n" - read -rp "${CAT} Would you like to reboot now? (y/n): " HYP + while true; do + echo -n "${CAT} Would you like to reboot now? (y/n): " + read HYP + HYP=$(echo "$HYP" | tr '[:upper:]' '[:lower:]') - HYP=$(echo "$HYP" | tr '[:upper:]' '[:lower:]') - - if [[ "$HYP" == "y" || "$HYP" == "yes" ]]; then - echo "${INFO} Rebooting now..." - systemctl reboot - elif [[ "$HYP" == "n" || "$HYP" == "no" ]]; then - echo "👌 ${OK} You choose NOT to reboot" - printf "\n%.0s" {1..1} - # Check if NVIDIA GPU is present - if lspci | grep -i "nvidia" &> /dev/null; then - echo "${INFO} HOWEVER ${YELLOW}NVIDIA GPU${RESET} detected. Reminder that you must REBOOT your SYSTEM..." + if [[ "$HYP" == "y" || "$HYP" == "yes" ]]; then + echo "${INFO} Rebooting now..." + systemctl reboot + break + elif [[ "$HYP" == "n" || "$HYP" == "no" ]]; then + echo "👌 ${OK} You chose NOT to reboot" printf "\n%.0s" {1..1} + # Check if NVIDIA GPU is present + if lspci | grep -i "nvidia" &> /dev/null; then + echo "${INFO} HOWEVER ${YELLOW}NVIDIA GPU${RESET} detected. Reminder that you must REBOOT your SYSTEM..." + printf "\n%.0s" {1..1} + fi + break + else + echo "${WARN} Invalid response. Please answer with 'y' or 'n'." fi - else - echo "${WARN} Invalid response. Please answer with 'y' or 'n'. Exiting." - exit 1 - fi + done else # Print error message if neither package is installed printf "\n${WARN} Hyprland is NOT installed. Please check 00_CHECK-time_installed.log and other files in the Install-Logs/ directory..." @@ -499,4 +502,5 @@ else exit 1 fi + printf "\n%.0s" {1..2} \ No newline at end of file