1
0
mirror of https://github.com/km4ack/patmenu2.git synced 2025-05-16 06:40:10 -07:00
patmenu2/manage-forms
2021-09-21 11:56:11 -05:00

31 lines
900 B
Bash
Executable File

#!/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="<b>Manage Pat</b> by KM4ACK" \
--field="Download Latest Forms":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-form-functions; DOWNLOAD"' \
--field="Auto Download Forms <b>$STATUS</b>":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