The Kettle Dilemma and Growl

December 4th, 2004

I can be a little distracted at times, but the sight of a heavy, solid black kettle glowing an eery incandescent orange tends to rivet my attention.

I don’t know about you but I have a habit on these cold wet nights to put a kettle on, and then start a project while waiting for the water to boil. And I get distracted, and come back a view hours later. So inspired by a comment on Remind as command-line iCal replacement, I wrote a simple bash script to growl at me 5 minutes after I run it.

Growl

Download Growl, and GrowlNotify. Install the Growl.dmg, and extract the growlnotify binary and copy it /usr/local/bin (or somewhere else in your path). Now go to System preferences and turn on the Growl framework.

No at

My first attempt was going to use at, but after fiddling for a bit (and reaching out for expert assistance from Josh) I found the following line at the top of at man pages:

at, batch, atq, atrm are all disabled by default on Mac OS X.

pure bash

Rather then fiddle with overriding Apple’s descision in this matter, I did a little googling and figured out how to simulate what I wanted in bash.

Without further ado, my kettleison script.

#!/bin/sh

DELAY=300
TITLE='Time to take the kettle off'
MSG='Seriously, new kettles are expensive'

{
sleep $DELAY
echo $MSG | growlnotify $TITLE 2>/dev/null
} &

Copy this into your path, and you should be all set.

Obvious Improvements

Obviously it would be nice if the script took arguments on the command line. Even better would be if the notifications stuck around a little longer then the default 5 seconds. But those are both for another night (wasted too much time on at)

Additionally this script is entirely incompatible with a good book, as with most other non-OS X running devices.

Comments are closed.