Pull image icon locally instead of from the web each time.

This commit is contained in:
tb14
2019-12-20 20:38:50 -08:00
parent 1288720c72
commit c94807bc42
6 changed files with 84 additions and 39 deletions
+24 -9
View File
@@ -1,9 +1,9 @@
#!/bin/bash
################################################################################
################################################################################
################# AmRRON PAT Setup and Alias Manager v0.5.1 ##################
################# AmRRON PAT Setup and Alias Manager v0.5.2 ##################
################# Created by TB-14 ##################
################# 23 Feb 2019 ##################
################# 20 Dec 2019 ##################
################################################################################
################################################################################
@@ -25,6 +25,21 @@ r="--height=${rows}"
}
# Determine location user is running script from.
SOURCE="${BASH_SOURCE[0]}"
# While $SOURCE is a symlink, resolve it
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$( readlink "$SOURCE" )"
# If $SOURCE was a relative symlink (so no "/" as prefix, need to
#resolve it relative to the symlink base directory
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
#echo "$DIR"
function dep_check() {
@@ -40,7 +55,7 @@ fi
if ! hash pat 2>/dev/null; then
echo "Pat is not installed. Please install pat and try again.
https://getpat.io" | yad --center --text-info --wrap --image=/tmp/banner.png --show-uri --button="Exit:1" --title "Install PAT" ${r} ${c} || exit 1
https://getpat.io" | yad --center --text-info --wrap --image=$DIR/images/corps-icon.png --show-uri --button="Exit:1" --title "Install PAT" ${r} ${c} || exit 1
fi
if ! hash getardoplist 2>/dev/null; then
@@ -60,7 +75,7 @@ fi
}
#Lets grab the AmRRON Banner.
wget -N http://s9756.storage.proboards.com/5619756/a/KWTGc2YscxSclVEeB5jD.png -O /tmp/banner.png
#wget -N http://s9756.storage.proboards.com/5619756/a/KWTGc2YscxSclVEeB5jD.png -O /tmp/banner.png
#create a finish trap
@@ -115,7 +130,7 @@ if ( [[ "$(jq .mycall $PATCONFIG | tr -d \")" != "" ]] && [[ "$(jq .locator $PAT
function main_menu() {
if [[ ! -f $PATCONFIG ]]; then
pat configure | sleep 2 | kill $(pidof pat) ||
{ echo "No config.json file exists. Please run 'pat configure' from a terminal and then CTRL-X to close the file. This will generate a blank file which this tool will assist you wil."; exit 1; }
{ echo "No config.json file exists. Please run 'pat configure' from a terminal and then CTRL-X to close the file. This will generate a blank file which this tool will assist you with."; exit 1; }
fi
CURRENTCALL=$(jq ".mycall" $PATCONFIG | tr -d \")
@@ -126,7 +141,7 @@ CURRENTRIG=$(jq ".ardop.rig" $PATCONFIG | tr -d \")
PATSETUP=$(yad --center --wrap --title="PAT Setup and Alias Manager" \
--text="--Please ensure you have a valid winlink account and password established.\n--The raspberry pi sometimes has problems understanding 'localhost.' Use 127.0.0.1 Using 0.0.0.0 will allow you to access the PAT UI from your local network.\n--Point your browser to the local ip and port. Example: 192.168.1.15:8080" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--form --separator="," --item-separator="," \
--field="Enter your callsign" "$CURRENTCALL" \
--field="Enter your winlink password:H" "$CURRENTPASS" \
@@ -231,7 +246,7 @@ fi
FINDALIAS=$(yad --center --wrap --show-uri \
--title="PAT Setup and Alias Manager" \
--text="$LASTUPDATE\n\nSelect PAT Setup to open user and radio config.\nSelect MANAGE to view or remove current aliases.\nSelect Update to Re-Download the list of stations\nThis may take a couple minutes.\nUpdates will be visable from the PAT UI after restarting the pat http server." \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--button="PAT Setup:3" \
--button="MANAGE:4" \
--button="UPDATE:2" \
@@ -261,7 +276,7 @@ TUNEMODE=$(echo $FINDALIAS | awk -F "," '{print $4}' | awk '{print $1}')
cat $LISTLOC/${BAND}ardoplist.txt | awk '$2 ~/'${GRID}'/{print $1,$2,$3,$4,$7,$11}' | sed 's/^/false /' | tr ' ' '\012' > /tmp/stationlist
cat /tmp/stationlist | yad --image=/tmp/banner.png --center \
cat /tmp/stationlist | yad --image=$DIR/images/corps-icon.png --center \
--checklist \
--separator="," \
--title "ARDOP Stations" \
@@ -317,7 +332,7 @@ jq .connect_aliases $PATCONFIG | sed '/^}/d' | sed '/^{/d' | sed 's/^ *//g' | se
CURRENT=$(cat /tmp/currentaliases | yad --image=/tmp/banner.png --center --checklist --separator="," --title "Current Aliases" --text "Select any aliases you would like to remove" --list --print-column=2 --button="Exit:1" --button="Return:2" --button="Apply:0" --column="Saved Alias" --column="Name-Dist-Freq" --column="Alias" ${r} ${c} > /tmp/removealiases)
CURRENT=$(cat /tmp/currentaliases | yad --image=$DIR/images/corps-icon.png --center --checklist --separator="," --title "Current Aliases" --text "Select any aliases you would like to remove" --list --print-column=2 --button="Exit:1" --button="Return:2" --button="Apply:0" --column="Saved Alias" --column="Name-Dist-Freq" --column="Alias" ${r} ${c} > /tmp/removealiases)
rc=$?
+12 -10
View File
@@ -1,9 +1,9 @@
#!/bin/bash
################################################################################
################################################################################
######################## AmRRON Setup Script v0.6.0 ########################
######################## AmRRON Setup Script v0.6.1 ########################
######################## Created by TB-14 ########################
######################## 07 DEC 2019 ########################
######################## 20 DEC 2019 ########################
################################################################################
################################################################################
#
@@ -1703,12 +1703,12 @@ if hash yaac 2>/dev/null; then
Icon=$USERDIR/icons/yaaclogo.png
Terminal=false
Type=Application
Categories=Network;HamRadio;" > $HOME/Desktop/js8call.desktop ||
Categories=Network;HamRadio;" > $HOME/Desktop/yaac.desktop ||
{ ERRCODE="Failed to create desktop icon for YAAC"; errors; }
if [[ ! -f $USERDIR/icons/yaaclogo.png ]]; then
mkdir -p $USERDIR/icons && wget -P $USERDIR/icons/ -N www.ka2ddo.org/ka2ddo/yaaclogo.png ||
{ ERRCODE="Failed to download icon image for GTKTerm"; errors; }
{ ERRCODE="Failed to download icon image for YAAC"; errors; }
fi
fi
@@ -2742,7 +2742,7 @@ yad --image=$DIR/images/corps-icon.png --center --checklist --print-column=2 --s
false "GTKTERM" "GTK based terminal - Recommended" "${GTKTERMVER}" \
false "PUTTY" "Popular graphical terminal" "${PUTTYVER}" \
false "DIREWOLF" "Soundcard TNC" "" \
false "YAAC" "Yet Another APRS Client **DISABLED FOR NOW**" "${YAACVER}" \
false "YAAC" "Yet Another APRS Client" "${YAACVER}" \
false "PACKET_GUIDE" "Creates a guide in $HOME/Documents with basic information to get you started with packet operations" \
${r} ${c} >>/tmp/results
rc=$?
@@ -3302,7 +3302,7 @@ cat /tmp/results | yad --text-info --center \
direwolf_install
;;
YAAC) echo "Skipping YAAC"
#yaac_install
yaac_install
;;
PACKET_GUIDE) echo "Creating Packet Radio Guide"
packet_guide
@@ -3390,7 +3390,7 @@ done < /tmp/results
function failure_handling() {
FAIL=$(cat /tmp/failures)
FAIL=$(cat /tmp/failures) || echo "No failures recorded"
if [[ -f /tmp/failures ]]; then
@@ -3455,7 +3455,9 @@ communications at this time."
TITLE="ARDOP configuration"
TEXT="A configuration file is required for your sound device to \
work with the ARDOP TNC.\n\nThis file is located at $HOME/.asoundrc
work with the ARDOP TNC.
This file is located at $HOME/.asoundrc
You may need to substitute the appropriate hardware location for your \
device.
@@ -3646,9 +3648,9 @@ TEXT="VOACAPL pythonprop GUI does not yet support Ubuntu 19.10."
pybitmessagesetup)
if [[ ${PLAT} = "Raspbian" ]]; then
echo --text "Add @/usr/local/bin/pybitmessage to the file /etc/xdg/lxsession/LXDE-pi/autostart \
echo "Add @/usr/local/bin/pybitmessage to the file /etc/xdg/lxsession/LXDE-pi/autostart \
to enable autostart of pybitmessage on the Pi. Would you like me to attempt to do this now?" | yad \
--image=$DIR/images/corps-icon.png --center --wrap \
--text-info --image=$DIR/images/corps-icon.png --center --wrap \
--button="No:0" --button="Enable Autostart:2" \
--title "PyBitmessage Autostart Setup." \
${r} ${c}
+35 -20
View File
@@ -1,9 +1,9 @@
#!/bin/bash
################################################################################
################################################################################
####################### AmRRON Tri-Mode Setup v0.6 #########################
####################### AmRRON Tri-Mode Setup v0.6.1 #########################
####################### Created by TB-14 #########################
####################### 18 Aug 2019 #########################
####################### 20 Dec 2019 #########################
################################################################################
################################################################################
@@ -30,7 +30,7 @@ r="--height=${rows}"
function determine_os() {
#Deterimine computer type.
function noOS_Support() {
yad --image=/tmp/banner.png --center --no-buttons \
yad --image=$DIR/images/corps-icon.png --center --no-buttons \
--title "INVALID OS DETECTED" \
--text "A valid OS was not detected.\n\nThis installer was designed for \
Debian based distros; specifically Raspbian Stretch, Linux Mint 18.3 / 19.1 and Ubuntu 18.04." \
@@ -40,24 +40,39 @@ Debian based distros; specifically Raspbian Stretch, Linux Mint 18.3 / 19.1 and
}
function maybeOS_Support() {
if (yad --image=/tmp/banner.png --center \
if (yad --image=$DIR/images/corps-icon.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, 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 \
yad --image=$DIR/images/corps-icon.png --center \
--title "Not Supported OS" \
--text "::: Did not detect perfectly supported OS but,\n\n \
::: Continuing installation at user's own risk..." ${r} ${c} ||
{ echo "exiting"; exit 1; }
else
yad --image=/tmp/banner.png --center \
yad --image=$DIR/images/corps-icon.png --center \
--title "Not Supported OS" \
--text "::: Exiting due to unsupported OS" ${r} ${c}
exit 1
fi
}
# Determine location user is running script from.
SOURCE="${BASH_SOURCE[0]}"
# While $SOURCE is a symlink, resolve it
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$( readlink "$SOURCE" )"
# If $SOURCE was a relative symlink (so no "/" as prefix, need to
#resolve it relative to the symlink base directory
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
#echo "$DIR"
# Compatibility check for OS
# if lsb_release command is on their system
if hash lsb_release 2>/dev/null; then
@@ -119,7 +134,7 @@ fi
trap finish EXIT
#Lets grab the AmRRON Banner.
wget -N http://s9756.storage.proboards.com/5619756/a/KWTGc2YscxSclVEeB5jD.png -O /tmp/banner.png
#wget -N http://s9756.storage.proboards.com/5619756/a/KWTGc2YscxSclVEeB5jD.png -O /tmp/banner.png
##Some Variables used by more than one function
ARDOPSTATUS="/usr/local/bin/ardop-status"
@@ -323,19 +338,19 @@ sudo mv /tmp/ardop-status /usr/local/bin/ardop-status
function find_rig() {
RADIOMK=$(rigctl -l | awk '{print $2}' | awk '!x[$0]++' | grep -v "#" | tr '\n' ',')
CUSTOMRAD1=$(yad --center --wrap --title="Rigctl Setup" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--form --separator="," --item-separator="," \
--field="Select Radio Make::CB" $RADIOMK ${c} ${r} | tr -d ,) || exit 1
RADIOMOD=$(rigctl -l | grep $CUSTOMRAD1 | awk '{print $3}' | tr '\n' ',')
CUSTOMRAD2=$(yad --center --wrap --title="Rigctl Setup" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--form --separator="," --item-separator="," \
--field="Select Radio Model::CB" $RADIOMOD ${c} ${r} | tr -d ,) || exit 1
RADIOID=$(rigctl -l | grep $CUSTOMRAD2 | awk '{print $1}')
CUSTOMRAD3=$(yad --center --wrap --title="Rigctl Setup" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--form --separator="," --item-separator="," \
--field="Rigctl Radio ID::CBE" $RADIOID \
--field="Tip::TXT" "Per your selections, this should be your Radio ID for rigctl. If you know it to be different, type the correct value instead." ${c} ${r}) || exit 1
@@ -349,7 +364,7 @@ RID=$(echo $CUSTOMRAD3 | awk -F "," '{print $1}')
function rigctl_setup() {
RIGCTLOPTIONS=$(yad --center --wrap --title="Rigctl Setup" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--form --separator="," --item-separator="," \
--field="PTT Device::CBE" $RTSOPTIONS \
--field="Select Radio::CB" $RADIOS \
@@ -478,7 +493,7 @@ DEV=""
function rts_setup() {
DEV=$(yad --center --title="TriMode Setup" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--form --separator="," --item-separator="," \
--field="PTT Device::CB" $RTSOPTIONS ${c} ${r}) || exit 1
@@ -491,7 +506,7 @@ function cat_setup() {
CATSEL=$(yad --center --title="TriMode Setup" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--form --separator="," --item-separator="," \
--field="Select CAT device::CB" $RTSOPTIONS \
--field="Enter Baud Rate" "19200" \
@@ -573,9 +588,9 @@ SOCATRIGCTL="True"
function show_results() {
cat /etc/asound.conf | yad --center --text-info --image=/tmp/banner.png --wrap --title=TriMode --button="gtk-ok:0" --text="Your asound.conf file has been created with the following information." ${c} ${r}
cat /etc/asound.conf | yad --center --text-info --image=$DIR/images/corps-icon.png --wrap --title=TriMode --button="gtk-ok:0" --text="Your asound.conf file has been created with the following information." ${c} ${r}
awk 'NR==92 || NR==119 || NR==120' $ARDOPSTATUS | yad --center --text-info --image=/tmp/banner.png --wrap --title=TriMode --button="gtk-ok:0" --text="Your TNC Status launcher command has been modified to the following.." ${c} ${r}
awk 'NR==92 || NR==119 || NR==120' $ARDOPSTATUS | yad --center --text-info --image=$DIR/images/corps-icon.png --wrap --title=TriMode --button="gtk-ok:0" --text="Your TNC Status launcher command has been modified to the following.." ${c} ${r}
}
@@ -591,7 +606,7 @@ Procedure:
3. Enable RIGTLD and PAVUCONTROL, select Toggle. They should now have PID's listed.
4. You can now enable ARDOPC and ARDOP_GUI.
*NOTE* If you wish to use PAT you must first detach the TNC from ARIM before loading PAT." | yad --image=/tmp/banner.png \
*NOTE* If you wish to use PAT you must first detach the TNC from ARIM before loading PAT." | yad --image=$DIR/images/corps-icon.png \
--text-info --center --button="gtk-ok:0" \
--wrap \
--title "Complete" ${r} ${c}
@@ -606,13 +621,13 @@ echo "This will create an asound.conf file in the /etc/ directory with pulse aud
This script is meant to aid you in configuring but cannot account for all variations.
RIGCTL does not play nicely with CAT and RTS keying across all software. If you wish to use RIGCTL it is recommended to select SOCAT and check the RIGCTL box on the next screen." | yad --center --text-info --image=/tmp/banner.png --wrap --title=TriMode ${c} ${r} || exit 1
RIGCTL does not play nicely with CAT and RTS keying across all software. If you wish to use RIGCTL it is recommended to select SOCAT and check the RIGCTL box on the next screen." | yad --center --text-info --image=$DIR/images/corps-icon.png --wrap --title=TriMode ${c} ${r} || exit 1
}
function selection_dialogs() {
##This creates our menu with the initial selections and outputs the results to /tmp/trimode-selections
yad --center --wrap --title="TriMode Setup" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.png \
--form --separator="," --item-separator="," --align=left \
--field="Select ardop file:SFL" $HOME/Radio/ARDOP \
--field="PTT Method::"CB "SOCAT-RIGCTLD,VOX,RTS,CAT" \
@@ -672,7 +687,7 @@ 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 \
--image=$DIR/images/corps-icon.png \
--wrap \
--title="Easy Button" \
--button="Yes:0" \
@@ -685,7 +700,7 @@ ${c} ${r} ||
fi
yad --center --wrap --title="ARDOP Location" --text="Please answer the following selections:" \
--image=/tmp/banner.png \
--image=$DIR/images/corps-icon.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." \
+3
View File
@@ -1,4 +1,7 @@
# PAT-GUI Changelog
# Version 0.5.2
- Changed to pull Corps icon from local instead of the web.
# Version 0.5.1
- Initial release
+6
View File
@@ -1,3 +1,9 @@
# Version 0.6.1
- Re-enabled YAAC
- Fixed typos and formatting.
- Fixed error not displaying PyBitmessage instructions
- Added note in CLI if no failures found instead of "no such file"
# Version 0.6.0
- Changed build dependencies for FLDIGI suite and HAMLIB. This no longer requires enabling source code repositories. That menu has been disabled for now and will be removed after further testing.
- JS8Call dependencies not compatible with Ubuntu 19.10 at this time.
+4
View File
@@ -1,4 +1,8 @@
# Tri-Mode Setup Changelog
# Version 0.6.1
- Changed to pull Corps icon from local instead of the web.
# Version 0.6
- Added "Easy Button" for quick setup of USB controlled radios with FLRIG control.