change progress animation

This commit is contained in:
JaKooLit
2025-02-03 01:59:04 +09:00
parent e2fe39222c
commit bfbbbd2e52
2 changed files with 14 additions and 13 deletions

View File

@@ -29,19 +29,20 @@ fi
show_progress() {
local pid=$1
local package_name=$2
local dots=""
local spin_chars=("|" "/" "-" "\\") # Classic spinner
local i=0
# Print initial message only once
echo -ne "${NOTE} Installing ${YELLOW}$package_name${RESET} ..."
tput civis # Hide cursor
printf "\r${NOTE} Installing ${YELLOW}%s${RESET} ..." "$package_name"
# Loop until the process is running
while ps -p $pid &> /dev/null; do
dots+="."
printf "\r%-80s" "${NOTE} Installing ${YELLOW}$package_name${RESET} ...$dots"
sleep 1
printf "\r${NOTE} Installing ${YELLOW}%s${RESET} %s" "$package_name" "${spin_chars[i]}"
i=$(( (i + 1) % 4 ))
sleep 0.2 # Faster animation
done
printf "\r%-80s\n" "${NOTE} Installing ${YELLOW}$package_name${RESET} ... Done!"
printf "\r${NOTE} Installing ${YELLOW}%s${RESET} ... Done!%-20s\n" "$package_name" ""
tput cnorm # Show cursor again
}
@@ -50,6 +51,7 @@ install_package_pacman() {
# Check if package is already installed
if pacman -Q "$1" &>/dev/null ; then
echo -e "${OK} ${MAGENTA}$1${RESET} is already installed. Skipping..."
printf "\n%.0s" {1..1}
else
# Run pacman and redirect all output to a log file
(
@@ -75,6 +77,7 @@ install_package() {
# Checking if package is already installed
if $ISAUR -Q "$1" &>> /dev/null ; then
echo -e "${OK} ${MAGENTA}$1${RESET} is already installed. Skipping..."
printf "\n%.0s" {1..1}
else
# Run yay/paru and redirect all output to a log file
(

View File

@@ -9,7 +9,6 @@
### -Type AUR helper
### yay or paru
aur_helper="yay"
############ use : "Y" or "N"
###-Do you have any nvidia gpu in your system?
nvidia="Y"
###-Install GTK themes (required for Dark/Light function)?
@@ -34,8 +33,7 @@ dots="Y"
### These are the sub-questions of the above choices
### Would you like to blacklist nouveau? (y/n)
blacklist_nouveau="Y"
# Ask the user if they want to use Thunar as the default file manager
# Do you want to set Thunar as the default file manager? (y/n): "
### Do you want to set Thunar as the default file manager? (y/n): "
thundefault="Y"
### OPTIONAL - Would you like to install SDDM themes? (y/n)
install_sddm_theme="Y"