This is a ‘make’ wrapper I use to make my life easier.
It notifies me with desktop notification of failed build and of successful build that took longer than 30 seconds (and I got bored watching “The Matrix”). It requires colormake and notify-send installed and is activated by:
alias make=make-wrapper
#!/bin/bash
MINIMUM=30
START=$SECONDS
time colormake $*
ERR=$?
case $ERR in
0)
[[ $(($SECONDS - $START)) -gt $MINIMUM ]] && notify-send -t 3000 -u critical -i gtk-ok "make $1 OK"
;;
141)
tput setaf 1
echo "make stopped by ^C"
tput sgr0
;;
*)
notify-send -u critical -i gtk-dialog-error "make $1 FAILED:$ERR"
;;
esac
exit $ERR