When I use GeekTool, my computer won't go to sleep because my hard drive keeps getting accessed. Since I don't want to let this tool go, I have devised an alternate way to get my Mac to sleep. This remedy uses Bernhard Baehr's SleepWatcher. Now, there has been a hint about using this utility in the past, but it doesn't address a key point: your computer falling asleep when you are using it.
If you are doing a lengthy activity that doesn't involve touching the keyboard or mouse (watching a movie, for instance), your computer should stay awake. SleepWatcher doesn't know that, so in the middle of your movie, your computer falls asleep. The easy way around this is to tell SleepWatcher to sleep only when your monitor is off.
Here is my SleepWatcher config file:
timeout=6000
displaysleep=echo "1" > /tmp/displayOff.txt
displaywakeup=echo "0" > /tmp/displayOff.txt
idle=if [ `cat /tmp/displayOff.txt` -gt 0 ]; then /usr/local/sbin/sleepwatcher -n;fiRunService ()
{
ConsoleMessage "Starting Sleep Watcher"
/usr/local/sbin/sleepwatcher -d -f /path/to/your/config/file
/etc/rc.wakeup
return 0
}
. /etc/rc.common
StartService ()
{
ConsoleMessage "Starting Sleep Watcher"
/usr/local/sbin/sleepwatcher -d -f /path/to/your/config/file
/etc/rc.wakeup
return 0
}
Alternatively, you could put all the preferences from your config file inline with the command execution, but I find it easier to do it like this.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20080803215929830