New! SafeSleep 1.0
| SafeSleep
This is a nifty little AppleScript front-end I wrote up that automates the process of putting your Mac into hibernation. I’ve been using it for months without a hitch. I got most of my information for the underlying terminal commands from the following places: Now, it’s pretty cool how this works. And as I’ve said I haven’t had any problems yet. But this usage of MacOS X’s safe sleep is not officially supported by Apple. That being said, you’ll need MacOS X 10.4, and a laptop. I’ve tried it on a couple desktop macs and it hasn’t worked at all, but it didn’t have any adverse consequences either. |
How does SafeSleep relate (or not relate?) to closing the lid?
Also if Apple doesn’t support it as such, does that mean they could refuse Applecare service if they find it on your system?
Thanks.
Comment by Lance Lawton — May 31, 2007 @ 1:33 am
Tomis Responds
Normally when you close the lid the system suspends-to-ram. This halts processing and other energy draining procedures but it still takes up battery life.
With SafeSleep the system will suspend-to-disk. Eating up as much power as if it were completely shut down. The upshot is in battery savings, the downside is it takes longer to suspend/resume from disk than to ram.
Considering SafeSleep works by using built-in system commands, simply enables a feature that is already present but hardly used, and doesn’t involve “hacking” the system in any way, I seriously doubt it would void the AppleCare warranty. And I can’t imagine any issues it could cause that the normal trouble-shooting procedures wouldn’t fix. But you’d definitely want to read through the AppleCare agreement thoroughly to be sure.
Comment by Tomis — May 31, 2007 @ 1:52 am
Is this project open source? i would love to see how you implemented the system as i would like to add similar functionality into my InsomniaX
Comment by Andrew James — May 31, 2007 @ 10:50 am
Tomis Responds
It’s “open source” in the sense that it’s an AppleScript that’s been saved as editable. Just drop it on ScriptEditor.app and you’ll get the complete source code along with a nice little header and comments. I figured other coders would like to know how it works as well.
But really the hard work was done by the guys at the URLs I cited. I just wrote a nice AppleScript to wrap up the terminal commands. If you use any of this in your project then, at the very least, cite those URLs so others can learn how the underlying system works. Thanks!
Comment by Tomis — May 31, 2007 @ 10:59 am
Why the first 2 steps in those links you provide? I’ve been using software suspend (just another name for it) for about 18 months on both an AlBook and a MBP and I just pop into Terminal and input
sudo pmset -a hibernatemode 1
And it works just fine. Am I missing something?
Comment by Jack — June 2, 2007 @ 5:25 am
Tomis Responds
I think you might be referring to the steps which have you enable safe sleep. On the PowerBook and MacBook Pro this functionality is enabled by default for certain situations (battery swapping is one). However, my SafeSleep script lets you put your system into suspend-to-disk on demand, just putting the system to “sleep” only does a suspend-to-RAM by default. Use the “Always use Safe Sleep” option if you want the system to go directly into safe sleep when you put the system to sleep.
The links provided go into depth about the differences between them, and the comments on those articles cover the questions and confusion people have had with this feature.
Comment by Tomis — June 2, 2007 @ 9:35 am
After using the “Safe Sleep Now” option, your program doesn’t set the old hibernate mode correctly, it stays at 1, although it should be 3 in my case.
Can you fix this please?
Comment by Frank Groeneveld — June 15, 2007 @ 10:15 am