looks cooler :)

This commit is contained in:
JaKooLit
2025-02-03 02:08:17 +09:00
parent 29cc1c3f52
commit 93d3a18b9a

View File

@@ -29,7 +29,8 @@ fi
show_progress() { show_progress() {
local pid=$1 local pid=$1
local package_name=$2 local package_name=$2
local spin_chars=("●○○○" "○●○○" "○○●○" "○○○●" "○○●○" "○○○") # Dots Growing & Shrinking local spin_chars=("●○○○○○" "○●○○○○" "○○●○○○" "○○○●○○" "○○○○●○" "○○○○○" \
"○○○○●○" "○○○●○○" "○○●○○○" "○●○○○○") # Growing & Shrinking Dots
local i=0 local i=0
tput civis # Hide cursor tput civis # Hide cursor
@@ -37,8 +38,8 @@ show_progress() {
while ps -p $pid &> /dev/null; do while ps -p $pid &> /dev/null; do
printf "\r${NOTE} Installing ${YELLOW}%s${RESET} %s" "$package_name" "${spin_chars[i]}" printf "\r${NOTE} Installing ${YELLOW}%s${RESET} %s" "$package_name" "${spin_chars[i]}"
i=$(( (i + 1) % 6 )) i=$(( (i + 1) % 10 )) # Cycle through 10 animation frames
sleep 0.2 sleep 0.3 # Slower animation
done done
printf "\r${NOTE} Installing ${YELLOW}%s${RESET} ... Done!%-20s\n" "$package_name" "" printf "\r${NOTE} Installing ${YELLOW}%s${RESET} ... Done!%-20s\n" "$package_name" ""
@@ -46,7 +47,6 @@ show_progress() {
} }
# Function to install packages with pacman # Function to install packages with pacman
install_package_pacman() { install_package_pacman() {
# Check if package is already installed # Check if package is already installed