# cat runmon
!/bin/bash
COMMAND="$*"
eval "$COMMAND"
if [ $? -eq 0 ]
then
notify-send -t 0 -u normal "$COMMAND Done!"
else
notify-send -t 0 -u critical "$COMMAND Failed!"
fi
Use it like this:
# runmon make all
# runmon cdrecord -v speed=2 dev=2,0 cdimage.raw
# runmon wget http://download.fedoraproject.org/.../Fedora-9-x86_64-DVD.iso
It is useful for monitoring the tasks that take long time. Like build of entire product or burning of a CD. When I leave something to build and get to other work, I would like to be notified when it's done - even if it is running in some background screen session.
2 comments:
great snippit
cool baby. :)
Post a Comment