updated hyprland install script helper

This commit is contained in:
JaKooLit
2025-02-02 19:59:00 +09:00
parent 527a504e83
commit 38ce478f5c
3 changed files with 77 additions and 11 deletions

View File

@@ -34,7 +34,7 @@ while true; do
printf "\n${OK} You chose non-git version of Hyprland....... executing...\n" printf "\n${OK} You chose non-git version of Hyprland....... 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}\n" echo -e "${NOTE} Installing non-git version of Hyprland...${RESET}"
./scripts/install-hyprland.sh ./scripts/install-hyprland.sh
break break
;; ;;
@@ -42,7 +42,7 @@ while true; do
printf "\n${OK} You chose git version of Hyprland....... executing...\n" printf "\n${OK} You chose git version of Hyprland....... 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}\n" echo -e "${NOTE} Installing git version of Hyprland...${RESET}"
./scripts/install-hyprland-git.sh ./scripts/install-hyprland-git.sh
break break
;; ;;

View File

@@ -9,6 +9,7 @@ INFO="$(tput setaf 4)[INFO]$(tput sgr0)"
WARN="$(tput setaf 1)[WARN]$(tput sgr0)" WARN="$(tput setaf 1)[WARN]$(tput sgr0)"
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
MAGENTA="$(tput setaf 5)" MAGENTA="$(tput setaf 5)"
ORANGE="$(tput setaf 214)"
WARNING="$(tput setaf 1)" WARNING="$(tput setaf 1)"
YELLOW="$(tput setaf 3)" YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)" BLUE="$(tput setaf 4)"
@@ -16,6 +17,8 @@ RESET="$(tput sgr0)"
ISAUR=$(command -v yay || command -v paru) ISAUR=$(command -v yay || command -v paru)
printf "\n%.0s" {1..2}
# List of packages to install / update # List of packages to install / update
packages=( packages=(
"hyprutils-git" "hyprutils-git"
@@ -35,18 +38,50 @@ packages=(
"pyprland" "pyprland"
) )
# clearing cache # Function that would show a progress bar to the user
printf "${ACTION} Lets Clear Cache first!!!!" show_progress() {
while ps | grep $1 &> /dev/null; do
echo -n "."
sleep 1
done
echo -en "Done!"
}
# Clearing cache
echo -n "${CAT} Recommend (choose y to all) to clear ${MAGENTA}pacman and aur helper${RESET} cache ..."
printf "\n%.0s" {1..1}
sudo pacman -Scc && sudo pacman -Scc &&
$ISAUR -Scc && $ISAUR -Scc
printf "\n%.0s" {1..2} printf "\n%.0s" {1..1}
# Installing packages
for package in "${packages[@]}"; do for package in "${packages[@]}"; do
$ISAUR -S --noconfirm --needed "$package" 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
# 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}
else
echo -e "\n${ERROR} Failed to install ${MAGENTA}$package${RESET}"
printf "\n%.0s" {1..1}
fi
done done
printf "\n%.0s" {1..2} printf "\n%.0s" {1..1}
printf "${OK} Done!! Now you NEED to ${YELLOW}EXIT${RESET} Hyprland and Re-Login! Enjoy!!!!" 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}

View File

@@ -9,6 +9,7 @@ INFO="$(tput setaf 4)[INFO]$(tput sgr0)"
WARN="$(tput setaf 1)[WARN]$(tput sgr0)" WARN="$(tput setaf 1)[WARN]$(tput sgr0)"
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
MAGENTA="$(tput setaf 5)" MAGENTA="$(tput setaf 5)"
ORANGE="$(tput setaf 214)"
WARNING="$(tput setaf 1)" WARNING="$(tput setaf 1)"
YELLOW="$(tput setaf 3)" YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)" BLUE="$(tput setaf 4)"
@@ -37,11 +38,41 @@ packages=(
"pyprland" "pyprland"
) )
# Function that would show a progress bar to the user
show_progress() {
while ps | grep $1 &> /dev/null; do
echo -n "."
sleep 1
done
echo -en "Done!"
}
# Installing packages
for package in "${packages[@]}"; do for package in "${packages[@]}"; do
$ISAUR -S --noconfirm --needed "$package" 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
# 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}
else
echo -e "\n${ERROR} Failed to install ${MAGENTA}$package${RESET}"
printf "\n%.0s" {1..1}
fi
done done
printf "\n%.0s" {1..1}
printf "\n%.0s" {1..2}
printf "${OK} Done!! Now you NEED to ${YELLOW}EXIT${RESET} Hyprland and Re-Login! Enjoy!!!!" 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}