From 3318f33c31f469f1eb5f3707b0b8c5ca5ab1915b Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Sat, 7 Sep 2024 23:27:46 +0900 Subject: [PATCH] adjusted to detect if pulseaudio is installed --- install.sh | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/install.sh b/install.sh index 159ac60..8d409fc 100755 --- a/install.sh +++ b/install.sh @@ -1,25 +1,42 @@ #!/bin/bash # https://github.com/JaKooLit +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + # Check if running as root. If root, script will exit if [[ $EUID -eq 0 ]]; then - echo "This script should not be executed as root! Exiting......." + echo "$ERROR This script should not be executed as root! Exiting......." exit 1 fi clear +# Check if PulseAudio package is installed +if pacman -Qq pulseaudio >/dev/null 2>&1; then + echo "$ERROR PulseAudio is installed. Uninstall it first or edit install.sh on line 211 (execute_script 'pipewire.sh')." + exit 1 +fi + # Check if base-devel is installed if pacman -Q base-devel &> /dev/null; then echo "base-devel is already installed." else - echo "Install base-devel.........." + echo "$NOTE Install base-devel.........." if sudo pacman -S --noconfirm --needed base-devel; then - echo "base-devel has been installed successfully." + echo "$OK base-devel has been installed successfully." else - echo "Error: base-devel not found nor cannot be installed." - echo "Please install base-devel manually before running this script... Exiting" + echo "$ERROR base-devel not found nor cannot be installed." + echo "$ACTION Please install base-devel manually before running this script... Exiting" exit 1 fi fi @@ -63,17 +80,6 @@ if [[ $use_preset = [Yy] ]]; then source ./preset.sh fi -# Set some colors for output messages -OK="$(tput setaf 2)[OK]$(tput sgr0)" -ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" -NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" -WARN="$(tput setaf 166)[WARN]$(tput sgr0)" -CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" -ORANGE=$(tput setaf 166) -YELLOW=$(tput setaf 3) -RESET=$(tput sgr0) - - # Function to colorize prompts colorize_prompt() { local color="$1"