updated the mini script to install non-git or git hyprland version

This commit is contained in:
JaKooLit
2025-02-03 11:02:58 +09:00
parent 38ce478f5c
commit 1d812d7357
3 changed files with 37 additions and 36 deletions

View File

@@ -38,32 +38,35 @@ packages=(
"pyprland"
)
# Function that would show a progress bar to the user
# rotating stars progress
show_progress() {
spin='-'
while ps | grep $1 &> /dev/null; do
echo -n "."
sleep 1
echo -ne "\rInstalling ${ORANGE}$2${RESET} ... Kindly wait! $spin"
sleep 0.3
case $spin in
'-') spin='\';;
'\') spin='|';;
'|') spin='/';;
'/') spin='-';;
esac
done
echo -en "Done!"
echo -en "\rInstalling ${ORANGE}$2${RESET} ... Kindly wait! .... Done!"
}
printf "\n%.0s" {1..1}
printf "${NOTE} Installing ${BLUE}non-git hyprland version${RESET}....."
printf "\n%.0s" {1..1}
# Installing packages
for package in "${packages[@]}"; do
echo -n "Installing ${ORANGE}$package${RESET} ... ${BLUE}Kindly wait!${RESET} "
# Show progress dots and installation result on a new line
echo -n "..."
# Install the package in the background and capture its PID
$ISAUR -S --noconfirm --needed "$package" &>/dev/null &
pid=$!
# Start the progress bar in the background
show_progress $pid
show_progress $pid $package
# Wait for the package installation to finish
wait $pid
# Check the result of the installation
if [ $? -eq 0 ]; then
echo -e "\n${OK} ${ORANGE}$package${RESET} successfully installed."
printf "\n%.0s" {1..1}
@@ -75,4 +78,4 @@ done
printf "\n%.0s" {1..1}
printf "${OK} Done!! Now you NEED to ${YELLOW}EXIT${RESET} Hyprland and Re-Login! Enjoy!!!!"
printf "\n%.0s" {1..2}
printf "\n%.0s" {1..2}