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