From 7a3390a3cfa90931962b0c9a220271c82f876845 Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Tue, 21 Sep 2021 11:56:11 -0500 Subject: [PATCH] initial commit --- manage-forms | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 manage-forms diff --git a/manage-forms b/manage-forms new file mode 100755 index 0000000..0a3aaa1 --- /dev/null +++ b/manage-forms @@ -0,0 +1,31 @@ +#!/bin/bash + +export MYPATH=$HOME/patmenu2 +LOGO=$MYPATH/pmlogo.png +source $MYPATH/manage-pat-functions +MAIN=$MYPATH/patmenu +FILE=/run/user/$UID/tempcron.txt +crontab -l > $FILE +STATUS=$(grep updateforms $FILE | awk '{print $1}') +rm $FILE + +if [ $STATUS = 0 ]; then +STATUS=Weekly +elif [ $STATUS = '@reboot' ]; then +STATUS="At boot" +else +STATUS="Not Set" +fi + +yad --form --width=420 --text-align=center --center --title="Manage Pat" --text-align=center \ +--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \ +--text="Manage Pat by KM4ACK" \ +--field="Download Latest Forms":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-form-functions; DOWNLOAD"' \ +--field="Auto Download Forms $STATUS":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-form-functions; AUTO-DOWNLOAD"' \ +--button="Main Menu":1 +BUT=$? + +if [ $BUT = 1 ]; then +$MAIN & +exit +fi \ No newline at end of file