Update-Structure
This commit is contained in:
parent
da35160bc0
commit
64615a2004
2 changed files with 36 additions and 1 deletions
|
@ -1,3 +1,3 @@
|
|||
# TyOS-Local-Scripts
|
||||
|
||||
Scripts intégrés de TyOS - Ce dépôt peut être réinjecter dans l'OS dynamiquement !
|
||||
Scripts intégrés de TyOS - Ce dépôt peut être réinjecter dans l'OS dynamiquement.
|
35
flatpak_selections
Normal file
35
flatpak_selections
Normal file
|
@ -0,0 +1,35 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Directory containing scripts
|
||||
SCRIPT_DIR="/usr/local/bin/flatpacks"
|
||||
|
||||
# Check if the directory exists
|
||||
if [[ ! -d "$SCRIPT_DIR" ]]; then
|
||||
echo "Directory $SCRIPT_DIR does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get list of scripts
|
||||
SCRIPTS=($(ls "$SCRIPT_DIR"))
|
||||
|
||||
# Check if there are any scripts
|
||||
if [[ ${#SCRIPTS[@]} -eq 0 ]]; then
|
||||
whiptail --msgbox "No scripts found in $SCRIPT_DIR" 10 40
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Build menu options
|
||||
MENU_OPTIONS=()
|
||||
for SCRIPT in "${SCRIPTS[@]}"; do
|
||||
MENU_OPTIONS+=("$SCRIPT" "$SCRIPT")
|
||||
done
|
||||
|
||||
# Show menu with the new title
|
||||
SELECTED_SCRIPT=$(whiptail --title "TyOS Flatpak Selections" --menu "Choose a script to run:" 20 60 10 "${MENU_OPTIONS[@]}" 3>&1 1>&2 2>&3)
|
||||
|
||||
# Check if a script was selected
|
||||
if [[ -n "$SELECTED_SCRIPT" ]]; then
|
||||
bash "$SCRIPT_DIR/$SELECTED_SCRIPT"
|
||||
else
|
||||
whiptail --msgbox "No script selected." 10 40
|
||||
fi
|
Loading…
Add table
Reference in a new issue