From a5e287ade8038ba8cd4156fcd7418b4a4b64f9b3 Mon Sep 17 00:00:00 2001 From: tb14 Date: Mon, 27 Jan 2025 16:06:17 -0600 Subject: [PATCH] yad as function --- AmRRON-PAT-GUI.sh | 12 ++++++++++++ AmRRON-Setup-Script.sh | 3 +++ AmRRON-TriMode-Setup.sh | 15 ++++++++++++++- AmRRON-Vara-setup.sh | 3 +++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/AmRRON-PAT-GUI.sh b/AmRRON-PAT-GUI.sh index 21fd761..d838b12 100755 --- a/AmRRON-PAT-GUI.sh +++ b/AmRRON-PAT-GUI.sh @@ -40,6 +40,17 @@ fi } +function yad_install() { +# Find out if we have yad and install if not +echo "Yad is used to create the interactive menus this program uses." +echo "If yad is not installed, we will attempt to install it now." +sleep 2 +if ! hash yad 2>/dev/null; then +sudo apt-get -y install yad || +{ echo "Yad install failed. Yad is required to run this installer. Please install yad and try again or check your internet connection."; exit 1; } + +fi +} function set_screen_size() { screen_size=$(xdpyinfo | grep dimensions | \ @@ -521,6 +532,7 @@ fi check_for_updates +yad_install set_screen_size #check_repo_version dep_check diff --git a/AmRRON-Setup-Script.sh b/AmRRON-Setup-Script.sh index 8989b1c..7c7c96c 100755 --- a/AmRRON-Setup-Script.sh +++ b/AmRRON-Setup-Script.sh @@ -105,6 +105,7 @@ function check_for_updates() { fi } +function yad_install() { # Find out if we have yad and install if not echo "Yad is used to create the interactive menus this program uses." echo "If yad is not installed, we will attempt to install it now." @@ -114,6 +115,7 @@ sudo apt-get -y install yad || { echo "Yad install failed. Yad is required to run this installer. Please install yad and try again or check your internet connection."; exit 1; } fi +} # Find the screen size. Will default to 800x480 if it can not be detected. function set_screen_size() { @@ -4833,6 +4835,7 @@ exit 1 ################################################################################ check_for_updates +yad_install set_screen_size #check_repo_version check_installed_programs diff --git a/AmRRON-TriMode-Setup.sh b/AmRRON-TriMode-Setup.sh index 1021fd4..0279699 100755 --- a/AmRRON-TriMode-Setup.sh +++ b/AmRRON-TriMode-Setup.sh @@ -43,6 +43,18 @@ function check_for_updates() { fi } +function yad_install() { +# Find out if we have yad and install if not +echo "Yad is used to create the interactive menus this program uses." +echo "If yad is not installed, we will attempt to install it now." +sleep 2 +if ! hash yad 2>/dev/null; then +sudo apt-get -y install yad || +{ echo "Yad install failed. Yad is required to run this installer. Please install yad and try again or check your internet connection."; exit 1; } + +fi +} + function set_screen_size() { screen_size=$(xdpyinfo | grep dimensions | \ sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/' | sed s/x/" "/ || echo 800 480) @@ -781,8 +793,9 @@ ardop_launcher check_for_updates +yad_install set_screen_size -check_repo_version +#check_repo_version determine_os info_dialogs easy_button diff --git a/AmRRON-Vara-setup.sh b/AmRRON-Vara-setup.sh index 3b83e1a..a60dc74 100755 --- a/AmRRON-Vara-setup.sh +++ b/AmRRON-Vara-setup.sh @@ -68,6 +68,7 @@ function check_for_updates() { } #### Program setup functions +function yad_install() { # Find out if we have yad and install if not echo "Yad is used to create the interactive menus this program uses." echo "If yad is not installed, we will attempt to install it now." @@ -77,6 +78,7 @@ sudo apt-get -y install yad || { echo "Yad install failed. Yad is required to run this installer. Please install yad and try again or check your internet connection."; exit 1; } fi +} # Find the screen size. Will default to 800x480 if it can not be detected. function set_screen_size() { @@ -652,6 +654,7 @@ exit 1 check_for_updates +yad_install set_screen_size #check_repo_version confirm_os