Persistent Growl notifications for long tasks

Oct 14, '10 07:30:00AM

Contributed by: tedw

I have a tendency to forget that I'm in the middle of a backup -- I use an rsync script that runs in the background -- so I needed a way to keep a reminder on screen for the duration of the task so I don't accidentally disconnect the external backup drive.

This turned out to be easy using Growl and the growlnotify utility. By creating the note as sticky (using the -s option) and giving it an identifier (using the -d option), the notification will stay on screen and can be updated periodically as desired.

The Installer package for growlnotify is in the growlnotify folder in the Extras folder on the Growl disk image. A demonstration script (this assumes that growlnotify is installed in /usr/local/bin; more interesting code would replace the sleep commands, obviously):

#! /bin/bash

# open a new sticky growl notification with the designator 'note'
/usr/local/bin/growlnotify -d note -s 'Begin the Beguine'
sleep 10

# update notification 'note'
/usr/local/bin/growlnotify -d note -s 'Still doing that "Beguine" thing...'
sleep 10
 
# update notification 'note' again
/usr/local/bin/growlnotify -d note -s -m "beguiners can't be choosers." 'Beguine, Beguine, Beguine... '
sleep 10

# update notification 'note', again, and remove stickiness so it disappears
/usr/local/bin/growlnotify -d note "Eh. I'm over it.'"
The same thing can be done with AppleScript if you create long-running stay open scripts; just make sure you set the sticky and identifier properties.

[crarko adds: I tested this, and it works as described.]

Comments (5)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20101013175759981