diff --git a/manage-pat-functions b/manage-pat-functions index fc155cd..cd13778 100644 --- a/manage-pat-functions +++ b/manage-pat-functions @@ -402,7 +402,44 @@ exit } - +MANUALGPS() { + +WHO=$(whoami) +CONFIG=$HOME/.wl2k/config.json + +GRID=$(yad --form --width=400 --text-align=center --center --title="Set Grid" --text-align=center \ +--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \ +--text="Update Pat Grid by KM4ACK" \ +--field="Six Character Grid": "$NEWGRID" \ +--button="Update Grid":2 \ +--button="Cancel":1) +BUT=$? + +if [ $BUT = 252 ]; then +exit +fi + +if [ $BUT = 1 ]; then +$MAIN & +exit +fi + +NEWGRID=$(echo $GRID | awk -F "|" '{print $1}') + +NEWGRID=${NEWGRID^^} + + +sed -i "s/\"locator\": \".*\",/\"locator\": \"$NEWGRID\",/" $CONFIG +echo "GRID UPDATED" +sudo killall pat +sudo systemctl start pat@$WHO +yad --form --width=400 --text-align=center --center --title="Grid Update" --text-align=center \ +--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \ +--text="Grid Updated to $NEWGRID" \ +--button=gtk-ok + +$MAIN +}