updated
This commit is contained in:
20
uninstall.sh
20
uninstall.sh
@@ -28,7 +28,6 @@ echo -e "\e[35m
|
|||||||
\e[0m"
|
\e[0m"
|
||||||
printf "\n%.0s" {1..1}
|
printf "\n%.0s" {1..1}
|
||||||
|
|
||||||
|
|
||||||
# Show welcome message using whiptail with Yes/No options
|
# Show welcome message using whiptail with Yes/No options
|
||||||
whiptail --title "Arch-Hyprland KooL Dots Uninstall Script" --yesno \
|
whiptail --title "Arch-Hyprland KooL Dots Uninstall Script" --yesno \
|
||||||
"Hello! This script will uninstall KooL Hyprland packages and configs.
|
"Hello! This script will uninstall KooL Hyprland packages and configs.
|
||||||
@@ -67,7 +66,6 @@ remove_packages() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Function to remove selected directories
|
# Function to remove selected directories
|
||||||
remove_directories() {
|
remove_directories() {
|
||||||
local selected_dirs=($1)
|
local selected_dirs=($1)
|
||||||
@@ -86,7 +84,6 @@ remove_directories() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Define the list of packages to choose from (with options_command tags)
|
# Define the list of packages to choose from (with options_command tags)
|
||||||
packages=(
|
packages=(
|
||||||
"cliphist" "clipboard manager" "off"
|
"cliphist" "clipboard manager" "off"
|
||||||
@@ -162,7 +159,7 @@ directories=(
|
|||||||
|
|
||||||
# Use whiptail to choose packages to remove
|
# Use whiptail to choose packages to remove
|
||||||
package_choices=$(whiptail --title "Select Packages to Uninstall" --checklist \
|
package_choices=$(whiptail --title "Select Packages to Uninstall" --checklist \
|
||||||
"Select the packages you want to remove\nNOTE: 'SPACEBAR' to select & 'TAB' key to change selection" 30 90 20 \
|
"Select the packages you want to remove\nNOTE: 'SPACEBAR' to select & 'TAB' key to change selection" 35 90 25 \
|
||||||
"${packages[@]}" 3>&1 1>&2 2>&3)
|
"${packages[@]}" 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
# Check if the user canceled the operation
|
# Check if the user canceled the operation
|
||||||
@@ -180,23 +177,22 @@ if [[ -z "$package_choices" ]]; then
|
|||||||
else
|
else
|
||||||
# Convert the selected package list into an array and clean up quotes
|
# Convert the selected package list into an array and clean up quotes
|
||||||
IFS=" " read -r -a selected_packages <<< "$package_choices"
|
IFS=" " read -r -a selected_packages <<< "$package_choices"
|
||||||
selected_packages=($(echo "${selected_packages[@]}" | tr -d '"')) # Clean up quotes
|
selected_packages=($(echo "${selected_packages[@]}" | tr -d '"'))
|
||||||
echo "Packages to remove: ${selected_packages[@]}" # Debugging line
|
echo "Packages to remove: ${selected_packages[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use whiptail to choose directories to remove
|
# Use whiptail to choose directories to remove
|
||||||
dir_choices=$(whiptail --title "Select Directories to Remove" --checklist \
|
dir_choices=$(whiptail --title "Select Directories to Remove" --checklist \
|
||||||
"Select the directories you want to remove\nNOTE: This will remove configs from ~/.config\n\nNOTE: 'SPACEBAR' to select & 'TAB' key to change selection" 25 90 15 \
|
"Select the directories you want to remove\nNOTE: This will remove configs from ~/.config\n\nNOTE: 'SPACEBAR' to select & 'TAB' key to change selection" 28 90 18 \
|
||||||
"${directories[@]}" 3>&1 1>&2 2>&3)
|
"${directories[@]}" 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
# Check if the user canceled the operation
|
# Check if the user canceled the operation
|
||||||
if [ $? -eq 1 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
echo "$INFO uninstall process canceled."v
|
echo "$INFO uninstall process canceled."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Debugging output: Check what was selected
|
echo "Selected directories: '$dir_choices'"
|
||||||
echo "Selected directories: '$dir_choices'" # Debugging line
|
|
||||||
|
|
||||||
# Check if the selected directories are empty or not
|
# Check if the selected directories are empty or not
|
||||||
if [[ -z "$dir_choices" ]]; then
|
if [[ -z "$dir_choices" ]]; then
|
||||||
@@ -204,8 +200,8 @@ if [[ -z "$dir_choices" ]]; then
|
|||||||
else
|
else
|
||||||
# Convert the selected directories list into an array and clean up quotes
|
# Convert the selected directories list into an array and clean up quotes
|
||||||
IFS=" " read -r -a selected_dirs <<< "$dir_choices"
|
IFS=" " read -r -a selected_dirs <<< "$dir_choices"
|
||||||
selected_dirs=($(echo "${selected_dirs[@]}" | tr -d '"')) # Clean up quotes
|
selected_dirs=($(echo "${selected_dirs[@]}" | tr -d '"'))
|
||||||
echo "Directories to remove: ${selected_dirs[@]}" # Debugging line
|
echo "Directories to remove: ${selected_dirs[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# First confirmation - Warning about potential instability
|
# First confirmation - Warning about potential instability
|
||||||
|
|||||||
Reference in New Issue
Block a user