O'Reilly Network    


 Published on The O'Reilly Network (http://www.oreillynet.com/)
 http://www.oreillynet.com/pub/wlg/7306

Command-line Growl Notifications

by Nitesh Dhanjani
Jun. 28, 2005

Growl is a “global notification system” for OS X. Applications can use the Growl framework to display notifications to the user. I use Growl with Adium, and it works wonderfully.


The Growl package (download) includes a utility called growlnotify, which can be used to display notifications using the command-line. I use the following bash script (growlexec) to run a specified command and display a notification when done:

#!/bin/bash


$*


if [ $? -eq 0 ]
then /usr/local/bin/growlnotify -m "\"$*\" done (SUCCESS)"

else /usr/local/bin/growlnotify -m "\"$*\" done (FAILED)"
fi

Here is a screen-shot of growlexec causing a Growl notification to be displayed after a successful nmap run:


image

Nitesh Dhanjani is a well known security researcher, author, and speaker. Dhanjani has been invited to talk at various information security events such as the Black Hat Briefings, RSA, Hack in the Box, Microsoft Blue Hat, and OSCON.

oreillynet.com Copyright © 2006 O'Reilly Media, Inc.