Overtherailing. RSS

I hope you find the answers faster than I did.

Archive

Sep
4th
Fri
permalink

NEAT-O: bash + Growl == love

If you’re not familiar with Growl, it’s a non-intrusive little notification system for OSX:

http://growl.info/

Now, check out this Gist:

http://gist.github.com/180943

function n {
  "$@"
  status=$?

  if [ "$status" == "0" ] ; then
    result="completed"
  else
    result="FAILED ($status)"
  fi
 
  growlnotify -m "Script $result" -s "$@"
}

This snippet of bash shell scripting will use Growl to notify you when a long-running command completes. Simply slap that snippet into your .profile, open a new shell (or run “source ~/.profile” in an existing one), run “n yourcommandhere” and blammo!

For even more shell sexiness, be sure to check out Visor, a Quake-style OSX terminal that pops down with the stroke of a keycombo:

http://visor.binaryage.com/

(Thanks to Sean for pointing this out to me.)

/edit “growlnotify” is not included in a default Growl installation. Look on the Growl installation image under “Extras/growlnotify” folder for “install.sh”

  1. overtherailing posted this