Notification at the end of builds

Posted by Cliff Brake on 2009-11-05 | 2 Comments to Read

I do quite a few OpenEmbedded project builds during the course of a week.  This process usually takes 3-5 minutes.  That is just enough time to get distracted doing something else and forget about the build until an hour later when you realize — oops, I was supposed to send out a release email once the build was finished and uploaded.  It occured to me that it would be nice if my computer played a distinct sound at the end of the build.  With Linux this is incredibly easy:

  • wget http://upload.wikimedia.org/wikipedia/commons/7/76/Ding_Dong_Bell.ogg
  • sudo mv Ding_Dong_Bell.ogg /usr/local/
  • sudo aptitude install cplay
  • sudo echo “cplay /usr/local/Ding_Dong_Bell.ogg” > /usr/local/bin/bell
  • sudo chmod 775 /usr/local/bin/bell

Now, when I have a long build, I simply do something like:

bitbake my-image; bell

There is probably something better than cplay that does not start a UI — any suggestions?

  • John Connolly said,

    Funny, I do similar things for writing a rootfs to my SD card.

    jconnolly@jconnolly-linux:/tmp$ cat `which writebug.sh`
    #!/bin/bash
    EXPECTED_ARGS=2
    E_BADARGS=65
    # Make sure only root can run our script
    if [[ $EUID -ne 0 ]]; then
    echo “This script must be run as root” 1>&2
    exit 1
    fi
    if [ $# -ne $EXPECTED_ARGS ]
    then
    echo “Usage: `basename $0` image-file partition”
    exit $E_BADARGS
    fi
    dd if=$1 of=$2
    e2fsck -f -y $2
    resize2fs $2
    beep -f 450 -l 50 -r 3
    notify-send “writebug.sh done”
    mplayer /home/jconnolly/message.mp3 &>/dev/null &

  • Cliff Brake said,

    tried mplayer, seems a little more friendly than cplay for this application — thanks.