From 712eece39885fa136bc0c9c8d19e081e2541a3bc Mon Sep 17 00:00:00 2001 From: nagumii Date: Tue, 31 Dec 2024 22:37:16 +0200 Subject: [PATCH] Rename femtofox-config to femto-config --- .../bin/{femtofox-config => femto-config} | 45 ++++--- .../usr/local/bin/femto-pinout.sh | 124 ++++++++++++------ 2 files changed, 111 insertions(+), 58 deletions(-) rename foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/{femtofox-config => femto-config} (92%) mode change 100755 => 100644 diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femtofox-config b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config old mode 100755 new mode 100644 similarity index 92% rename from foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femtofox-config rename to foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config index 0b0257f..b8d2a6a --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femtofox-config +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config @@ -83,6 +83,34 @@ For more details, enter \`iwconfig\`. done } + # Pinout menu +femto_pinouts() { + while true; do + local option="" + option=$(dialog --menu "Pinouts" 15 40 5 \ + 1 "Femtofox" \ + 2 "Femtofox Zero" \ + 3 "Femtofox Tiny" \ + 4 "Luckfox" \ + 5 "Back to Main Menu" 3>&1 1>&2 2>&3) + + exit_status=$? # This line checks the exit status of the dialog command + + if [ $exit_status -ne 0 ]; then # Exit the loop if the user selects "Cancel" or closes the dialog + break + fi + + case $option in + 1) dialog --title "$title" --msgbox "$(femto-pinout.sh -f)" 38 70 ;; + 2) dialog --title "$title" --msgbox "$(femto-pinout.sh -z)" 38 70 ;; + 3) dialog --title "$title" --msgbox "$(femto-pinout.sh -t)" 38 70 ;; + 4) dialog --title "$title" --msgbox "$(femto-pinout.sh -l)" 23 63 ;; + 5) return ;; + *) echo "Invalid option selected!" ;; + esac + done +} + # Function to handle misc settings misc_settings() { local title="Misc Settings" @@ -155,7 +183,7 @@ Rerunning the script will not cause any issues if these things are already in pl fi ;; 4) - dialog --title "$title" --msgbox "$(femto-pinout.sh -a | sed 's/|n/\\n/g')" 0 0 + femto_pinouts ;; 5) luckfox-config @@ -326,21 +354,6 @@ meshtasticd_settings() { femto-meshtasticd-config.sh -r dialog --msgbox "Meshtasticd uninstalled. To purge all remnants, run \`sudo apt purge\`.\nAfter reinstallation but before first launch, run \`sudo runonce.sh\`." 8 40 fi - pause - ;; - 12) - return - ;; - esac - done -} - - -# Main menu -while true; do - choice=$(dialog --title "$(date)" --menu "Femtofox Config" 15 40 5 \ - 1 "Wi-Fi" \ - 2 "Meshtasticd" \ 3 "Misc" \ 4 "Software" \ 5 "Help" \ diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-pinout.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-pinout.sh index 6aab26d..a09654c 100644 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-pinout.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-pinout.sh @@ -3,11 +3,10 @@ help=$(cat <