mirror of
https://gitlab.com/amrron/setup-scripts.git
synced 2026-10-17 01:54:00 -04:00
Trimode v2 Easy Button test
This commit is contained in:
@@ -3,13 +3,14 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
####################### AmRRON Tri-Mode Setup v0.6 #########################
|
####################### AmRRON Tri-Mode Setup v0.6 #########################
|
||||||
####################### Created by TB-14 #########################
|
####################### Created by TB-14 #########################
|
||||||
####################### 24 Jul 2019 #########################
|
####################### 18 Aug 2019 #########################
|
||||||
################################################################################
|
################################################################################
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
### This script will perform basic setup for TriMode Operation.
|
### This script will perform basic setup for TriMode Operation.
|
||||||
|
|
||||||
|
|
||||||
function set_screen_size() {
|
function set_screen_size() {
|
||||||
screen_size=$(xdpyinfo | grep dimensions | \
|
screen_size=$(xdpyinfo | grep dimensions | \
|
||||||
sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/' | sed s/x/" "/ || echo 800 480)
|
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 \
|
if (yad --image=/tmp/banner.png --center \
|
||||||
--title "Not Supported OS" \
|
--title "Not Supported OS" \
|
||||||
--text "Your OS may be compatible with this installer but has not been \
|
--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
|
18.04, and Mint 18.3 / 19.1.\n\nWould you like to continue anyway?" ${r} ${c}) then
|
||||||
yad --image=/tmp/banner.png --center \
|
yad --image=/tmp/banner.png --center \
|
||||||
--title "Not Supported OS" \
|
--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
|
if hash lsb_release 2>/dev/null; then
|
||||||
|
|
||||||
PLAT=$(lsb_release -si)
|
PLAT=$(lsb_release -si)
|
||||||
OSCN=$(lsb_release -sc) # We want this to be trusty xenial bionic; jessie
|
OSCN=$(lsb_release -sc) # We want this to be trusty xenial bionic cosmic disco; jessie strech buster; sara serena sonya sylvia tara tessa tina
|
||||||
#strech buster; sara serena sonya sylvia tara tessa
|
|
||||||
|
|
||||||
else # else get info from os-release
|
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}')
|
| awk '{print $1}')
|
||||||
VER=$(grep "VERSION_ID" /etc/os-release | awk -F "=" '{print $2}' | tr -d '"')
|
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" \
|
declare -A VER_MAP=(["10"]="buster" ["9"]="stretch" ["8"]="jessie" ["16.04"]="xenial" \
|
||||||
["14.04"]="trusty" ["18.04"]="bionic" ["18"]="sara" ["18.1"]="serena" \
|
["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" )
|
["18.2"]="sonya" ["18.3"]="sylvia" ["19"]="tara" ["19.1"]="tessa" ["19.2"]="tina" )
|
||||||
OSCN=${VER_MAP["${VER}"]}
|
OSCN=${VER_MAP["${VER}"]}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@@ -80,7 +80,7 @@ tested.\n\nThis installer has been tested on Raspbian Stretch, Buster, Ubuntu \
|
|||||||
case ${PLAT} in
|
case ${PLAT} in
|
||||||
Ubuntu|Raspbian|Debian|LinuxMint)
|
Ubuntu|Raspbian|Debian|LinuxMint)
|
||||||
case ${OSCN} in
|
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
|
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
|
set_screen_size
|
||||||
determine_os
|
determine_os
|
||||||
info_dialogs
|
info_dialogs
|
||||||
selection_dialogs
|
easy_button
|
||||||
create_asound
|
create_asound
|
||||||
show_results
|
show_results
|
||||||
|
|||||||
Reference in New Issue
Block a user