change progress animation
This commit is contained in:
@@ -29,19 +29,20 @@ fi
|
|||||||
show_progress() {
|
show_progress() {
|
||||||
local pid=$1
|
local pid=$1
|
||||||
local package_name=$2
|
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
|
while ps -p $pid &> /dev/null; do
|
||||||
dots+="."
|
printf "\r${NOTE} Installing ${YELLOW}%s${RESET} %s" "$package_name" "${spin_chars[i]}"
|
||||||
printf "\r%-80s" "${NOTE} Installing ${YELLOW}$package_name${RESET} ...$dots"
|
i=$(( (i + 1) % 4 ))
|
||||||
sleep 1
|
sleep 0.2 # Faster animation
|
||||||
done
|
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
|
# Check if package is already installed
|
||||||
if pacman -Q "$1" &>/dev/null ; then
|
if pacman -Q "$1" &>/dev/null ; then
|
||||||
echo -e "${OK} ${MAGENTA}$1${RESET} is already installed. Skipping..."
|
echo -e "${OK} ${MAGENTA}$1${RESET} is already installed. Skipping..."
|
||||||
|
printf "\n%.0s" {1..1}
|
||||||
else
|
else
|
||||||
# Run pacman and redirect all output to a log file
|
# Run pacman and redirect all output to a log file
|
||||||
(
|
(
|
||||||
@@ -75,6 +77,7 @@ install_package() {
|
|||||||
# Checking if package is already installed
|
# Checking if package is already installed
|
||||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||||
echo -e "${OK} ${MAGENTA}$1${RESET} is already installed. Skipping..."
|
echo -e "${OK} ${MAGENTA}$1${RESET} is already installed. Skipping..."
|
||||||
|
printf "\n%.0s" {1..1}
|
||||||
else
|
else
|
||||||
# Run yay/paru and redirect all output to a log file
|
# Run yay/paru and redirect all output to a log file
|
||||||
(
|
(
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
### -Type AUR helper
|
### -Type AUR helper
|
||||||
### yay or paru
|
### yay or paru
|
||||||
aur_helper="yay"
|
aur_helper="yay"
|
||||||
############ use : "Y" or "N"
|
|
||||||
###-Do you have any nvidia gpu in your system?
|
###-Do you have any nvidia gpu in your system?
|
||||||
nvidia="Y"
|
nvidia="Y"
|
||||||
###-Install GTK themes (required for Dark/Light function)?
|
###-Install GTK themes (required for Dark/Light function)?
|
||||||
@@ -34,8 +33,7 @@ dots="Y"
|
|||||||
### These are the sub-questions of the above choices
|
### These are the sub-questions of the above choices
|
||||||
### Would you like to blacklist nouveau? (y/n)
|
### Would you like to blacklist nouveau? (y/n)
|
||||||
blacklist_nouveau="Y"
|
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"
|
thundefault="Y"
|
||||||
### OPTIONAL - Would you like to install SDDM themes? (y/n)
|
### OPTIONAL - Would you like to install SDDM themes? (y/n)
|
||||||
install_sddm_theme="Y"
|
install_sddm_theme="Y"
|
||||||
|
|||||||
Reference in New Issue
Block a user