updated the mini script to install non-git or git hyprland version
This commit is contained in:
@@ -31,23 +31,21 @@ while true; do
|
|||||||
|
|
||||||
case $choice in
|
case $choice in
|
||||||
1)
|
1)
|
||||||
printf "\n${OK} You chose non-git version of Hyprland....... executing...\n"
|
printf "\n${OK} You chose ${BLUE}non-git version of Hyprland${RESET}....... executing...\n"
|
||||||
echo -e "${YELLOW} Uninstalling some hyprland packages first...${RESET}"
|
echo -e "${YELLOW} Uninstalling some hyprland packages first...${RESET}"
|
||||||
./scripts/uninstall.sh
|
./scripts/uninstall.sh &&
|
||||||
echo -e "${NOTE} Installing non-git version of Hyprland...${RESET}"
|
|
||||||
./scripts/install-hyprland.sh
|
./scripts/install-hyprland.sh
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
printf "\n${OK} You chose git version of Hyprland....... executing...\n"
|
printf "\n${OK} You chose ${BLUE}git version of Hyprland${RESET}....... executing...\n"
|
||||||
echo -e "${YELLOW} Uninstalling some hyprland packages....${RESET}"
|
echo -e "${YELLOW} Uninstalling some hyprland packages....${RESET}"
|
||||||
./scripts/uninstall.sh
|
./scripts/uninstall.sh &&
|
||||||
echo -e "${NOTE} Installing git version of Hyprland...${RESET}"
|
|
||||||
./scripts/install-hyprland-git.sh
|
./scripts/install-hyprland-git.sh
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
3)
|
3)
|
||||||
echo -e "${MAGENTA} You chose to cancel. Good Bye!!...${RESET}"
|
echo -e "${MAGENTA} You have cancel it. Good Bye!!...${RESET}"
|
||||||
printf "\n%.0s" {1..2}
|
printf "\n%.0s" {1..2}
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -38,13 +38,20 @@ packages=(
|
|||||||
"pyprland"
|
"pyprland"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Function that would show a progress bar to the user
|
# rotating stars progress
|
||||||
show_progress() {
|
show_progress() {
|
||||||
|
spin='-'
|
||||||
while ps | grep $1 &> /dev/null; do
|
while ps | grep $1 &> /dev/null; do
|
||||||
echo -n "."
|
echo -ne "\rInstalling ${ORANGE}$2${RESET} ... Kindly wait! $spin"
|
||||||
sleep 1
|
sleep 0.3
|
||||||
|
case $spin in
|
||||||
|
'-') spin='\';;
|
||||||
|
'\') spin='|';;
|
||||||
|
'|') spin='/';;
|
||||||
|
'/') spin='-';;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
echo -en "Done!"
|
echo -en "\rInstalling ${ORANGE}$2${RESET} ... Kindly wait! .... Done!"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Clearing cache
|
# Clearing cache
|
||||||
@@ -53,26 +60,19 @@ printf "\n%.0s" {1..1}
|
|||||||
sudo pacman -Scc &&
|
sudo pacman -Scc &&
|
||||||
$ISAUR -Scc
|
$ISAUR -Scc
|
||||||
|
|
||||||
|
printf "\n%.0s" {1..1}
|
||||||
|
printf "${NOTE} Installing ${BLUE}git hyprland version${RESET}....."
|
||||||
printf "\n%.0s" {1..1}
|
printf "\n%.0s" {1..1}
|
||||||
|
|
||||||
# Installing packages
|
# Installing packages
|
||||||
for package in "${packages[@]}"; do
|
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 &
|
$ISAUR -S --noconfirm --needed "$package" &>/dev/null &
|
||||||
pid=$!
|
pid=$!
|
||||||
|
|
||||||
# Start the progress bar in the background
|
show_progress $pid $package
|
||||||
show_progress $pid
|
|
||||||
|
|
||||||
# Wait for the package installation to finish
|
|
||||||
wait $pid
|
wait $pid
|
||||||
|
|
||||||
# Check the result of the installation
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo -e "\n${OK} ${ORANGE}$package${RESET} successfully installed."
|
echo -e "\n${OK} ${ORANGE}$package${RESET} successfully installed."
|
||||||
printf "\n%.0s" {1..1}
|
printf "\n%.0s" {1..1}
|
||||||
|
|||||||
@@ -38,32 +38,35 @@ packages=(
|
|||||||
"pyprland"
|
"pyprland"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Function that would show a progress bar to the user
|
# rotating stars progress
|
||||||
show_progress() {
|
show_progress() {
|
||||||
|
spin='-'
|
||||||
while ps | grep $1 &> /dev/null; do
|
while ps | grep $1 &> /dev/null; do
|
||||||
echo -n "."
|
echo -ne "\rInstalling ${ORANGE}$2${RESET} ... Kindly wait! $spin"
|
||||||
sleep 1
|
sleep 0.3
|
||||||
|
case $spin in
|
||||||
|
'-') spin='\';;
|
||||||
|
'\') spin='|';;
|
||||||
|
'|') spin='/';;
|
||||||
|
'/') spin='-';;
|
||||||
|
esac
|
||||||
done
|
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
|
# Installing packages
|
||||||
for package in "${packages[@]}"; do
|
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 &
|
$ISAUR -S --noconfirm --needed "$package" &>/dev/null &
|
||||||
pid=$!
|
pid=$!
|
||||||
|
|
||||||
# Start the progress bar in the background
|
show_progress $pid $package
|
||||||
show_progress $pid
|
|
||||||
|
|
||||||
# Wait for the package installation to finish
|
|
||||||
wait $pid
|
wait $pid
|
||||||
|
|
||||||
# Check the result of the installation
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo -e "\n${OK} ${ORANGE}$package${RESET} successfully installed."
|
echo -e "\n${OK} ${ORANGE}$package${RESET} successfully installed."
|
||||||
printf "\n%.0s" {1..1}
|
printf "\n%.0s" {1..1}
|
||||||
|
|||||||
Reference in New Issue
Block a user