Feb 13 2008

Growling

growlnotify is a little program that comes with Growl which allows you to submit Growl notifications from the command line or from scripts. Unfortunately, it doesn’t seem to work properly in Leopard—the notification only shows up maybe ⅓ of the time. There’s a hint in the logs, but I have no idea what it means:

2008-02-13 10:09:15 GrowlHelperApp[17821] *** -[NSMachPort handlePortMessage:]: dropping incoming DO message because the connection or ports are invalid

Apparently the devs are pretty clueless about the problem too, as it’s been reported but not yet fixed. The folk(s) over at hasseg.org came up with a workaround, which is all well and good, but I observed a simpler workaround than using the network (which requires configuring growl to allow network connections, if I’m not wrong). This little wrapper script does the trick, at least in my initial tests:

#!/bin/sh
wrappee=/usr/local/bin/growlnotify
exec $wrappee -w "$@" &

Basically we tell it to wait for notification from growl that the message is now off the screen, and then go in the background so we don’t have to actually wait for it. This has the side effect of essentially rendering the -w option useless when using the wrapper, so I’ve decided to wrap it with a different name instead of a transparent wrapper. I call it growl, which is both shorter to type and not nearly as ugly as growlnotify. Enjoy.