2011/03/30

Growl fun on Mac

Growl is a general accepted way of notifying something to users in Mac. You are probably using (for example the twitter app can send you updates via Growl) but what you might not now is that you can easily script. It is quite easy although I haven't figured out the details.

First you need to install the library. You can compile it yourself but you can also easy install it
sudo easy_install-2.6 py-Growl

Then you can test it
>>> import Growl
/Library/Python/2.6/site-packages/py_Growl-0.0.7-py2.6-macosx-10.6-universal.egg/Growl.py:17: DeprecationWarning: the md5 module is deprecated; use hashlib instead
>>> gn = Growl.GrowlNotifier("overtime",['overtime'])
>>> gn.register()
>>> gn.notify("overtime","Are you still working?","Yes I am!")

(Code from http://prehensile.co.uk/blog/?p=92)
This should display a message if you have installed Growl

I also created a small script that you run directly from cli if you don't like python. You can run it like this in the terminal
$ ./gnotify "Some Test" "A very good test"

BTW SQLAlchemy also install easily via easy_install-2.6 on Mac :)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.