From 30a2e6f1cca07b93c2d7f30cda38353aec570a10 Mon Sep 17 00:00:00 2001 From: appel Date: Sun, 10 Aug 2025 16:56:17 +0100 Subject: [PATCH 1/2] feat: improving uninstaller experience --- bin/omakub-sub/uninstall.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/omakub-sub/uninstall.sh b/bin/omakub-sub/uninstall.sh index 34e997965..c8974420c 100644 --- a/bin/omakub-sub/uninstall.sh +++ b/bin/omakub-sub/uninstall.sh @@ -1,6 +1,13 @@ #!/bin/bash -UNINSTALLER=$(gum file $OMAKUB_PATH/uninstall --height 26) -[ -n "$UNINSTALLER" ] && gum confirm "Run uninstaller?" && source $UNINSTALLER && gum spin --spinner globe --title "Uninstall completed!" -- sleep 3 +UNINSTALLER=$(gum choose $(ls -1 $OMAKUB_PATH/uninstall) "<< Back" --height 40) + +if [[ "$UNINSTALLER" == "<< Back"* ]] || [[ -z "$UNINSTALLER" ]]; then + # Don't uninstall anything + echo "" +else + [ -n "$UNINSTALLER" ] && gum confirm "Run uninstaller?" && source $UNINSTALLER && gum spin --spinner globe --title "Uninstall completed!" -- sleep 3 +fi + clear source $OMAKUB_PATH/bin/omakub From d12b48f7e8da27cb0f6d2633465b63fb1648ad75 Mon Sep 17 00:00:00 2001 From: appel Date: Sun, 2 Nov 2025 08:33:34 +0000 Subject: [PATCH 2/2] chore: Improving listing and sizing of uninstaller --- bin/omakub-sub/uninstall.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bin/omakub-sub/uninstall.sh b/bin/omakub-sub/uninstall.sh index c8974420c..cec250b33 100644 --- a/bin/omakub-sub/uninstall.sh +++ b/bin/omakub-sub/uninstall.sh @@ -1,13 +1,16 @@ -#!/bin/bash +UNINSTALLER_LIST=() +while IFS= read -r path; do + UNINSTALLER_LIST+=("$(basename "$path" | sed 's/\.sh$//')") +done < <(find "$OMAKUB_PATH/uninstall" -mindepth 1 -maxdepth 1 -type f | sort) -UNINSTALLER=$(gum choose $(ls -1 $OMAKUB_PATH/uninstall) "<< Back" --height 40) +CHOICE=$(gum choose "${UNINSTALLER_LIST[@]}" "<< Back" --header "Uninstall application" --height "$((${#UNINSTALLER_LIST[@]} + 2))") -if [[ "$UNINSTALLER" == "<< Back"* ]] || [[ -z "$UNINSTALLER" ]]; then +if [[ "$CHOICE" == "<< Back"* ]] || [[ -z "$CHOICE" ]]; then # Don't uninstall anything echo "" else - [ -n "$UNINSTALLER" ] && gum confirm "Run uninstaller?" && source $UNINSTALLER && gum spin --spinner globe --title "Uninstall completed!" -- sleep 3 + [ -n "$CHOICE" ] && gum confirm "Run uninstaller?" && source "$CHOICE" && gum spin --spinner globe --title "Uninstall completed!" -- sleep 3 fi clear -source $OMAKUB_PATH/bin/omakub +source $OMAKUB_PATH/bin/omakub \ No newline at end of file