Skip to content

Instantly share code, notes, and snippets.

@ibrahima
Created October 29, 2012 23:36
Show Gist options
  • Select an option

  • Save ibrahima/3977351 to your computer and use it in GitHub Desktop.

Select an option

Save ibrahima/3977351 to your computer and use it in GitHub Desktop.
A function that lets you call make and have it play a sound on successful or unsuccessful completion.
function make(){
/usr/bin/make "$@"
EXITCODE=$?
QUIET=false
OPTIND=1
while getopts ":q" opt; do
case $opt in
q)
QUIET=true
;;
esac
done
if ! $QUIET; then
if [ $EXITCODE -eq 0 ]; then
ogg123 -q /usr/share/sounds/freedesktop/stereo/complete.oga
else
ogg123 -q /usr/share/sounds/ubuntu/stereo/dialog-warning.ogg
fi
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment