From da35160bc0dba663b645c7e42ed9d0883ef57649 Mon Sep 17 00:00:00 2001 From: TyleoDvDelaware3217 Date: Thu, 29 May 2025 03:19:09 +0200 Subject: [PATCH] Actualiser toolbox --- toolbox | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/toolbox b/toolbox index e790816..9109b63 100644 --- a/toolbox +++ b/toolbox @@ -23,23 +23,16 @@ MENU_OPTIONS=() declare -A SCRIPT_MAP for script in "${SCRIPTS[@]}"; do - # Get base name, remove underscores, capitalize first letters, and store mapping + # Get base name, remove underscores, and capitalize first letter of each word DISPLAY_NAME=$(basename "$script" | sed 's/_/ /g' | awk '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) tolower(substr($i,2)); print}') - + # Exclude scripts with "Toolbox" in the name if [[ "$DISPLAY_NAME" != *"Toolbox"* ]]; then + MENU_OPTIONS+=("$DISPLAY_NAME" "") SCRIPT_MAP["$DISPLAY_NAME"]="$script" fi done -# Sort script names alphabetically -SORTED_NAMES=($(printf "%s\n" "${!SCRIPT_MAP[@]}" | sort)) - -# Populate menu options in sorted order -for name in "${SORTED_NAMES[@]}"; do - MENU_OPTIONS+=("$name" "") -done - # Show the menu using whiptail with the new title CHOICE=$(whiptail --title "TyOS Setup Toolbox" --menu "Choose A Script To Run:" 15 50 5 "${MENU_OPTIONS[@]}" 3>&1 1>&2 2>&3)