Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Sleep soundly with GeekTool via SleepWatcher Apps
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.
    •    
  • Currently 3.67 / 5
  You rated: 3 / 5 (6 votes cast)
 
[23,903 views]  

Sleep soundly with GeekTool via SleepWatcher | 5 comments | Create New Account
Click here to return to the 'Sleep soundly with GeekTool via SleepWatcher' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Sleep soundly with GeekTool via SleepWatcher
Authored by: algernon on Oct 21, '08 09:30:42AM

Thank you! Thank you! Thank you! Thank you! I've been having sleep problems for so long and could not for the life of me figure out the cause. I never considered GeekTool.



[ Reply to This | # ]
Sleep soundly with GeekTool via SleepWatcher
Authored by: ianeiloart on Oct 22, '08 12:38:56AM

This tip will also help prevent GeekTool from swallowing huge chunks of RAM, which it has a tendency to do. Less frequent checks can also help.

---
Ian Eiloart



[ Reply to This | # ]
Very important change!
Authored by: Balthamos on Oct 23, '08 07:50:31AM

I just figured this out today:

There is an issue with the way SW works with the display, and as a result, focus will be taken off the frontmost application if the display dims (or should dim) and you hit the keyboard or move the mouse to get full brightness again.

It's really simple to fix. Just change:

displaywakeup=open -a GeekTool

to

displaywakeup=open -g -a GeekTool

The -g option tells the opening application (GeekTool) not to come to the foreground.



[ Reply to This | # ]
In case it doesn't work...
Authored by: Balthamos on Nov 24, '08 11:15:55AM

In the event opening just won't work, point directly to the executable.

open -g -a "/Users/YOU/Library/PreferencePanes/GeekTool.prefPane/Contents/Resources/GeekTool.app"

or, if you have GeekTool elsewhere on your system:

open -g -a "/Library/PreferencePanes/GeekTool.prefPane/Contents/Resources/GeekTool.app"

[ Reply to This | # ]
Sleep soundly with GeekTool via SleepWatcher
Authored by: georgegumpert on Feb 25, '09 10:40:55AM

Balthamos, thanks for the tips!

Same goes to you, author! I never knew about SleepWatcher, this is a VERY useful tool!



[ Reply to This | # ]