Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions getardoplist
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ VARATWENTY=$MYVARA'20mvaralist.txt'
VARATHIRTY=$MYVARA'30mvaralist.txt'
VARAFM=$MYVARA'varafm.txt'

GRID=$(grep locator $XDG_CONFIG_HOME/pat/config.json | sed 's/"locator"://;s/"//g;s/,//;s/ //g')
echo "GRID=$GRID" > $HOME/patmenu2/.grid
GRID=$(jq -r .locator "$XDG_CONFIG_HOME"/pat/config.json)
echo "GRID=$GRID" > "$HOME/patmenu2/.grid"

#check internet connection
echo "Please wait while we check your internet connection"
Expand Down
32 changes: 18 additions & 14 deletions patmenu
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,34 @@
#20200427 KM4ACK
#side note: written during covid-19 outbreak of 2020

# some OS don't set this var
if [ -z "$XDG_CONFIG_HOME" ]; then
export XDG_CONFIG_HOME="$HOME/.config"
fi

export MYPATH=$HOME/patmenu2
LOGO=$MYPATH/pmlogo.png
MAIN=$MYPATH/./patmenu
VERSION=$(cat $MYPATH/changelog | grep release | head -1 | sed 's/release=//')
LOGO="$MYPATH/pmlogo.png"
MAIN="$MYPATH/./patmenu"
VERSION="$(grep release "$MYPATH"/changelog | head -1 | sed 's/release=//')"

source $MYPATH/config
source "$MYPATH/config"

#verify pat is at least v0.12.0
PAT_VER=`pat version | awk '{print $2}' | awk -F "." '{print $2}'`
PAT_VER=$(pat version | awk '{print $2}' | awk -F "." '{print $2}')

if [ $PAT_VER -lt 12 ]; then
if [ "$PAT_VER" -lt 12 ]; then
#give user notice
yad --form --width=420 --text-align=center --center --title="Pat out of Date" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--image "$LOGO" --window-icon="$LOGO" --image-on-top --separator="|" --item-separator="|" \
--text="Pat Menu only supports Pat Winlink\rversion 0.12.0 or later\r<b>Please update Pat Winlink</b>" \
--button=gtk-ok
exit
fi

if [ $WARN = 'yes' ] && [ ! -f /run/user/$UID/patwarn.txt ]; then
if [[ $WARN = 'yes' ]] && [[ ! -f /run/user/$UID/patwarn.txt ]]; then
#give user warning message
yad --form --width=420 --text-align=center --center --title="WARNING!!" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--image "$LOGO" --window-icon="$LOGO" --image-on-top --separator="|" --item-separator="|" \
--text="<b>${WARNMSG}</b>" \
--button=gtk-ok
touch /run/user/$UID/patwarn.txt
Expand All @@ -42,15 +46,15 @@ yad --title="N0CALL" --width=400 --height=100 \
fi

#get name of current config file
source $MYPATH/.currentconf
CONFIG=$(echo $CONF | sed 's/.config//')
CURRENT_GRID=$(grep locator $XDG_CONFIG_HOME/pat/config.json | sed 's/"locator": "//;s/ //g;s/",//')
if [ -z $CONFIG ]; then
source "$MYPATH/.currentconf"
CONFIG=$(echo "$CONF" | sed 's/.config//')
CURRENT_GRID="$(grep locator "$XDG_CONFIG_HOME"/pat/config.json | sed 's/"locator": "//;s/ //g;s/",//')"
if [ -z "$CONFIG" ]; then
CONFIG=default
fi

yad --form --width=420 --text-align=center --center --title="Pat Menu" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--image "$LOGO" --window-icon="$LOGO" --image-on-top --separator="|" --item-separator="|" \
--text="<b>Pat Menu</b> by KM4ACK\rv$VERSION" \
--field="Start/Stop Modem":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/modems"' \
--field="Find Winlink Gateways":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/find2"' \
Expand Down
7 changes: 3 additions & 4 deletions setup
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ fi
if ! hash jq 2>/dev/null; then
sudo apt install -y jq
fi
if ! hash wwl 2>/dev/null; then
sudo apt install -y wwl
fi

if [ -f $HOME/patmenu/config ]; then
#get patmenu config file and copy to patmenu2
Expand Down Expand Up @@ -54,7 +57,3 @@ sudo cp /run/user/$UID/patmenu.desktop /usr/share/applications/patmenu.desktop

#download RMS List
$MYPATH/getardoplist

#remove this script
rm $MYPATH/setup