Watchdog script is now powered by Zenity

"Lucas Mazzardo Veloso" <[email protected]>
Newsgroups gmane.comp.gnome.garnome
Message-ID <[email protected]>
Hi guys,

Now the convenience script 'watchdog' is powered by Zenity
because I've found just the 'beep!' approach itself ineffective warning
me, especially with a (loud) music on the background!

Avoid letting your CPU idle again 'cause you was stuck in middle of
something really important and you didn't realize the build has stopped.

Hopefully it could help you to:
1) Always have a complete log (to unattended builts)
2) Answare the "How much does it take to finish?" question
3) And warn you as soon as it stops/finishes.

So, it's almost an 'all-your-problems-has-gone' thing.. :)
Joke aside, just grab it.

Cheers,
Lucas

PS: Does 'watchdog' mean correctly in this context?

garnome@crossfire:/opt/garnome-2.17.90/desktop$ ../watchdog.sh make
paranoid-install
Running    : make paranoid-install
Started at : 20:24 01/25/07

 (...)




-----------------------------------------
DIN - WebMail.
http://www.din.uem.br/

-- 
garnome-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/garnome-list
watchdog.sh (application/x-shellscript, 1.3 KB)
#!/bin/bash
#
# Script by Lucas Mazzardo Veloso (lmveloso at din uem br)
#
# Example usage:
#        ./watchdog.sh make parnoid-install
#
# If you want to see the output run:
#       tail -f $LOG_FILE
#
# Dependencies:
#       'zenity' to display graphical dialog boxes
#       'beep' to ... Beep! :)

LOG_FILE=garnome-build.log

ERROR_SONG="beep -l 50 -n -f 370 -l 50 -n -f 523.2 -l 50 -n -f 662.3 -l 50 -n -f 937 -l 50 -n -f 349.2 -l 50 -n -f 493.9 -l 50 -n -f 587.3 -l 50 -n -f 884.4 -l 50 -n -f 329.6 -l 50 -n -f 466.2 -l 50 -n -f 554.3 -l 50 -n -f 834.7 -l 150"

SUCCESS_SONG="beep -f 261.6 -n -f 329.6 -l 100 -n -f 392 -l 150 -n -f 523.2 -l 300 -n -f 392 -l 200 -n -f 523.2 -l 300"

echo "Running    :" $1 $2
echo Started at : `date +"%R %D"`

$1 $2 > $LOG_FILE 2>&1 && \
(       \
        echo Finished at: `date +"%R %D"`; \
        echo >> $LOG_FILE; echo Finished at: `date +"%R %D"` >> $LOG_FILE; \
        `$SUCCESS_SONG` &\
        zenity --info --text "Garnome command '$1 $2' has successfully finished!"\
)       \
 ||     \
(
        echo "Failed at  :" `date +"%R %D"`;\
         echo >> $LOG_FILE; echo Failed at: `date +"%R %D"` >> $LOG_FILE; \
        `$ERROR_SONG`& \
        zenity --error --title "Garnome command '$1 $2' has Failed!" --text "`tail $LOG_FILE`" \
)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.