Trimode v2 Easy Button test

This commit is contained in:
tb14
2019-08-18 12:16:51 -07:00
parent b0384971a6
commit 3eee6b3121
+43 -8
View File
@@ -3,13 +3,14 @@
################################################################################
####################### AmRRON Tri-Mode Setup v0.6 #########################
####################### Created by TB-14 #########################
####################### 24 Jul 2019 #########################
####################### 18 Aug 2019 #########################
################################################################################
################################################################################
### This script will perform basic setup for TriMode Operation.
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)
@@ -42,7 +43,7 @@ function maybeOS_Support() {
if (yad --image=/tmp/banner.png --center \
--title "Not Supported OS" \
--text "Your OS may be compatible with this installer but has not been \
tested.\n\nThis installer has been tested on Raspbian Stretch, Buster, Ubuntu \
tested.\n\nThis installer has been tested on Raspbian Stretch, Ubuntu \
18.04, and Mint 18.3 / 19.1.\n\nWould you like to continue anyway?" ${r} ${c}) then
yad --image=/tmp/banner.png --center \
--title "Not Supported OS" \
@@ -62,8 +63,7 @@ tested.\n\nThis installer has been tested on Raspbian Stretch, Buster, Ubuntu \
if hash lsb_release 2>/dev/null; then
PLAT=$(lsb_release -si)
OSCN=$(lsb_release -sc) # We want this to be trusty xenial bionic; jessie
#strech buster; sara serena sonya sylvia tara tessa
OSCN=$(lsb_release -sc) # We want this to be trusty xenial bionic cosmic disco; jessie strech buster; sara serena sonya sylvia tara tessa tina
else # else get info from os-release
@@ -71,8 +71,8 @@ tested.\n\nThis installer has been tested on Raspbian Stretch, Buster, Ubuntu \
| awk '{print $1}')
VER=$(grep "VERSION_ID" /etc/os-release | awk -F "=" '{print $2}' | tr -d '"')
declare -A VER_MAP=(["10"]="buster" ["9"]="stretch" ["8"]="jessie" ["16.04"]="xenial" \
["14.04"]="trusty" ["18.04"]="bionic" ["18"]="sara" ["18.1"]="serena" \
["18.2"]="sonya" ["18.3"]="sylvia" ["19"]="tara" ["19.1"]="tessa" )
["14.04"]="trusty" ["18.04"]="bionic" ["18.10"]="cosmic" ["19.04"]="disco" ["18"]="sara" ["18.1"]="serena" \
["18.2"]="sonya" ["18.3"]="sylvia" ["19"]="tara" ["19.1"]="tessa" ["19.2"]="tina" )
OSCN=${VER_MAP["${VER}"]}
fi
@@ -80,7 +80,7 @@ tested.\n\nThis installer has been tested on Raspbian Stretch, Buster, Ubuntu \
case ${PLAT} in
Ubuntu|Raspbian|Debian|LinuxMint)
case ${OSCN} in
trusty|xenial|bionic|jessie|stretch|sara|serena|sonya|sylvia|tara|tessa)
trusty|xenial|bionic|cosmic|disco|jessie|stretch|buster|sara|serena|sonya|sylvia|tara|tessa|tina)
;;
*)
maybeOS_Support
@@ -645,10 +645,45 @@ ardop_launcher
}
function easy_button() {
echo "Would you like to use the default Tri-Mode setup? This setup will use FLRIG to control your radio and allow for Tri/Quad Mode easily for most popular setups." | yad \
--center \
--text-info \
--image=/tmp/banner.png \
--wrap \
--title="Easy Button" \
--button="Yes:0" \
--button="Custom Setup:1" \
${c} ${r} ||
{ selection_dialogs; }
yad --center --wrap --title="ARDOP Location" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--form --separator="," --item-separator="," --align=left \
--field="Select ardop file:SFL" $HOME/Radio/ARDOP \
--field="Tip::TXT" "Please ensure you select your ardop file." \
${c} ${r} > /tmp/trimode-selections || exit 1
#Here we read the selections and pull out the relevant info from them.
ARDOPLOC=$(cat /tmp/trimode-selections | awk -F "," '{print $1}')
#This catches if the user failed to select the ardopc location and sends them back to try again
if [[ ! -f $ARDOPLOC ]]; then
echo "You must select your ardop file before continuing." | yad --center --text-info --wrap --title=TriMode --button="Start Over:1" ${c} ${r} ||
{ selection_dialogs; return; }
fi
RIGCTLCMD="socat pty,link=/tmp/rigctl,waitslave,b38400 tcp:localhost:4532,retry &
rigctld -vvvvv -m 4 &"
status_update
ardop_launcher
}
set_screen_size
determine_os
info_dialogs
selection_dialogs
easy_button
create_asound
show_results