heh!!!... still tweaking

This commit is contained in:
JaKooLit
2025-02-03 00:57:08 +09:00
parent 058859a07e
commit 8995c47902
2 changed files with 26 additions and 13 deletions

View File

@@ -15,7 +15,9 @@ MAGENTA="$(tput setaf 5)"
ORANGE="$(tput setaf 214)"
WARNING="$(tput setaf 1)"
YELLOW="$(tput setaf 3)"
GREEN="$(tput setaf 2)"
BLUE="$(tput setaf 4)"
SKY_BLUE="$(tput setaf 6)"
RESET="$(tput sgr0)"
# Create Directory for Install Logs
@@ -92,3 +94,25 @@ install_package() {
fi
fi
}
# Function for uninstalling packages
uninstall_package() {
local pkg="$1"
# Checking if package is installed
if pacman -Qi "$pkg" &>> /dev/null ; then
# Package is installed
echo -e "${NOTE} Uninstalling $pkg ..."
sudo pacman -R --noconfirm "$pkg" 2>&1 | tee -a "$LOG" | grep -v "error: target not found"
# Check if the package was uninstalled
if ! pacman -Qi "$pkg" &>> /dev/null ; then
echo -e "\e[1A\e[K${OK} $pkg was uninstalled."
else
echo -e "\e[1A\e[K${ERROR} $pkg failed to uninstall. Please check the log."
return 1
fi
else
echo -e "${NOTE} $pkg is not installed, skipping uninstallation."
fi
return 0
}

View File

@@ -69,14 +69,14 @@ read -p "${SKY_BLUE}Would you like to proceed? (y/n): ${RESET}" proceed
printf "\n%.0s" {1..2}
if [ "$proceed" != "y" ]; then
echo "Installation aborted."
echo "${INFO} Installation aborted No changes done! Goodbye!"
printf "\n%.0s" {1..2}
exit 1
fi
printf "\n%.0s" {1..2}
echo "${NOTE} ${WARNING}ATTENTION: Choosing Y on use preset question will install also ${MAGENTA}nvidia packages${RESET}!"
echo "${NOTE} ${WARNING}ATTENTION: Choosing Y on use preset question will install also ${MAGENTA}nvidia packages!!!${RESET}"
echo "${YELLOW}CTRL C or Q to cancel and edit the file ${MAGENTA}preset.sh${RESET} ${RESET}"
echo "If you are not sure what to do, answer N in here"
read -p "${SKY_BLUE}Would you like to Use ${YELLOW}Preset Install Settings?${RESET} (See note above)? (y/n): ${RESET}" use_preset
@@ -96,17 +96,6 @@ colorize_prompt() {
# Set the name of the log file to include the current date and time
LOG="install-$(date +%d-%H%M%S).log"
# Initialize variables to store user responses
# aur_helper=""
# bluetooth=""
# dots=""
# gtk_themes=""
# nvidia=""
# rog=""
# sddm=""
# thunar=""
# xdph=""
# zsh=""
# Create Directory for Install Logs
if [ ! -d Install-Logs ]; then