diff --git a/autopat b/autopat index bf2390a..2082315 100755 --- a/autopat +++ b/autopat @@ -10,32 +10,20 @@ MAIN=$MYPATH/patmenu source $MYPATH/config -if [ $RIGCONTROL == 'no' ] -then - -yad --title="NO RIG CONTROL" --width=400 --height=100 \ - --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \ - --center --form --text="\r\r\r\rRig Control is needed for auto pat.\rPlease configure rig control and try again." \ - --button=gtk-ok - -exit -fi - -#Check if FLRIG is running if user has it set in config file -if [ "$RIGCONTROL" = 'yes' ]; then -echo "rig control is on" -FLRIG=$(echo $RIG | grep "\-m 4") - if [ -z "$FLRIG" ]; then - echo - else +if [ $RIGCONTROL == 'no' ]; then + yad --title="NO RIG CONTROL" --width=400 --height=100 \ + --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center\ + --center --form --text="\rRig Control is needed for auto pat.\rPlease configure rig control and try again." \ + --button=gtk-ok + exit +else + #Check if FLRIG is running if user has it set in config file + echo "rig control is on" FLRIG=$(pidof flrig) - if [ -z "$FLRIG" ]; then - yad --title="FAILED" --width=400 --height=100 \ - --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \ - --center --form --text="Please start FLRIG and try again" \ - --button=gtk-ok - exit - fi + if [ -z $FLRIG ]; then + #needs to be open + echo launching flrig for you + flrig fi fi diff --git a/pat-functions b/pat-functions index 5f30558..68a6a94 100644 --- a/pat-functions +++ b/pat-functions @@ -7,16 +7,22 @@ PATCONFIG=$XDG_CONFIG_HOME/pat/config.json AUTOPAT(){ source $MYPATH/config -if [ $RIGCONTROL == 'no' ] -then - -yad --title="NO RIG CONTROL" --width=400 --height=100 \ - --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \ - --center --form --text="\r\r\r\rRig Control is needed for auto pat.\rPlease configure rig control and try again. \ - \rRig control can be configured using\rManage Pat Menu" - --button=gtk-ok -$MAIN & -exit + +if [ $RIGCONTROL == 'no' ]; then + yad --title="NO RIG CONTROL" --width=400 --height=100 \ + --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center\ + --center --form --text="\rRig Control is needed for auto pat.\rPlease configure rig control and try again." \ + --button=gtk-ok + exit +else + #Check if FLRIG is running if user has it set in config file + echo "rig control is on" + FLRIG=$(pidof flrig) + if [ -z $FLRIG ]; then + #needs to be open + echo launching flrig for you + flrig + fi fi