Use variable to store color for script output

This commit is contained in:
clsty
2025-10-01 21:40:06 +08:00
parent 87c031b825
commit 9f711c20e0
9 changed files with 87 additions and 73 deletions
+7 -7
View File
@@ -3,7 +3,7 @@
#####################################################################################
printf "\e[34m[$0]: Hi there! Before we start:\n"
printf "${COLOR_BLUE}[$0]: Hi there! Before we start:\n"
printf '\n'
printf '[NEW] illogical-impulse is now powered by Quickshell. If you were using the old version with AGS and would like to keep it, do not run this script.\n'
printf ' The AGS version, although uses less memory, has much worse performance (it uses Gtk3). \n'
@@ -11,13 +11,13 @@ printf ' If you aren'\''t running on ewaste, the Quickshell version is reco
printf ' If you would like the AGS version anyway, run the script in its branch instead: git checkout ii-ags && ./install.sh\n'
printf '\n'
printf 'This script does not handle system-level/hardware stuff like Nvidia drivers.\n'
printf "\e[00m"
printf "${COLOR_RESET}"
case $ask in
false) sleep 0 ;;
*)
printf "\e[31m"
printf "${COLOR_RED}"
printf '\n'
printf 'Do you want to confirm every time before a command executes?\n'
printf ' y = Yes, ask me before executing each of them. (DEFAULT)\n'
@@ -25,10 +25,10 @@ case $ask in
printf ' a = Abort.\n'
read -p "====> " p
case $p in
n) ask=false ;;
a) exit 1 ;;
*) ask=true ;;
n) ask=false ;;
a) exit 1 ;;
*) ask=true ;;
esac
printf "\e[00m"
printf "${COLOR_RESET}"
;;
esac