mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-06-27 20:06:52 +00:00
Update uninstall-tools.sh
This commit is contained in:
parent
2da0e6923d
commit
f61f356d87
@ -74,19 +74,22 @@ uninstall_figurine() {
|
||||
|
||||
show_uninstall_menu() {
|
||||
local options=()
|
||||
|
||||
local index=1
|
||||
declare -A uninstall_map
|
||||
|
||||
if command -v fastfetch >/dev/null 2>&1; then
|
||||
options+=("$index" "$(translate "Uninstall") Fastfetch")
|
||||
local fastfetch_option="$index"
|
||||
uninstall_map[$index]="uninstall_fastfetch"
|
||||
index=$((index + 1))
|
||||
fi
|
||||
|
||||
if command -v figurine >/dev/null 2>&1; then
|
||||
options+=("$index" "$(translate "Uninstall") Figurine")
|
||||
local figurine_option="$index"
|
||||
uninstall_map[$index]="uninstall_figurine"
|
||||
index=$((index + 1))
|
||||
fi
|
||||
|
||||
|
||||
if [ ${#options[@]} -eq 0 ]; then
|
||||
whiptail --title "ProxMenux" --msgbox "$(translate "No uninstallable tools detected.")" 10 60
|
||||
return_to_menu
|
||||
@ -97,10 +100,12 @@ show_uninstall_menu() {
|
||||
--menu "$(translate "Select a tool to uninstall:")" 15 60 6 \
|
||||
"${options[@]}" 3>&1 1>&2 2>&3)
|
||||
|
||||
case "$choice" in
|
||||
"$fastfetch_option") uninstall_fastfetch ;;
|
||||
"$figurine_option") uninstall_figurine ;;
|
||||
esac
|
||||
[ -z "$choice" ] && return_to_menu
|
||||
|
||||
local func="${uninstall_map[$choice]}"
|
||||
if [[ -n "$func" ]]; then
|
||||
"$func"
|
||||
fi
|
||||
|
||||
return_to_menu
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user