I'm sure everyone knows about GeekTool and how amazing it is. However, getting my computer to fall asleep with this application running is somewhat challenging -- because it is running shell commands every 15 seconds, OS X has a hard time believing that the machine isn't idle. As a result, the computer develops a case of insomnia. I have gone to great lengths to try and get my sleep working how I wanted it.
I was developing a bash script that allowed the user to monitor CPU activity, HDD activity, and the most active process in order to determine whether the machine was in a "sleep-able" state. Then, a friend walks by and asks what I was doing. I explained my problem, and he came up with a brilliant solution: just turn off GeekTool. Sometimes, the simplest solution works best.
This solution uses the ever-so-useful SleepWatcher. For information on how to set up the SleepWatcher side of things, just check that hint I linked above. Here's the SleepWatcher conf file entry:
# sleepwatcher.conf file
displaysleep=killall GeekTool
displaywakeup=open -a GeekTool
It really is as simple as it looks. When the display goes off, you won't be needing to look at GeekTool, so it kills the process. When the display comes back on, GeekTool is activated. It's brilliantly simple. And that's all there is to it. You might be able to make this all inline so you can sidestep the conf file, but this works equally well. I hope you find this hint as helpful as I have.
Mac OS X Hints
http://hints.macworld.com/article.php?story=2008101819445660