8

Everything I can find on this subject prevents your Mac from going to sleep until you specify when you want it to go to sleep. Sometimes I close the lid of my laptop then realize I forgot to do something and I immediately open it back up. But then it has already gone to sleep and it is ~30 seconds before I can use it again. Is there any way I can delay it from going to sleep for a minute or two?

Edit for clarification: There is period of time after closing the lid (30 seconds or so) where when I open it back up, the screen is black with only a mouse. But after 30 seconds to about 10 minutes, I can use it within a second or two of opening it. If it helps, I have MBPR and all software is up to date.

1
  • I think they lock this for two reasons, heat dissipation and safety of HDD transport. If you move a laptop with a hdd still spinning, your chances of ruining the drive increase exponentially. Also, a closed laptop doesn't dissipate heat very well - which can ruin electronics. You might consider leaving the lid open until you transport the laptop.
    – Ben Plont
    Sep 16, 2013 at 2:44

3 Answers 3

2
+50

If you mean that you want to be able to close the screen without putting the MBA to sleep, then that's not supported. There is a hack that will prevent sleep:

http://www.macupdate.com/app/mac/22211/insomniax

but as with any such hack, you use it at your own risk (and it's not been updated in a couple of years so it may not work with current Macs). The MBA, while quite capable, isn't designed to run 24/7, so if you never let it sleep, you may encounter heat issues at some point.

If that's not what you mean, please clarify what it is you wish to accomplish.

Regards.

2

As far as my understanding of the Mac sleep mechanism goes, there are several modes of sleep. The most modern one, the standby mode, is built for immediate wake-up, by leaving the RAM powered up and writing nothing to disk during the first hour of sleep. Only after this hour has passed is the RAM written out to disk and powered-down. Both the write and read operations of the RAM are each said to take about 20-25 seconds.

You could verify the sleep parameters by issuing the command :

pmset -g

Of special interest should be the following parameters :

standbydelay : The delay in seconds until regular sleep goes over to standby mode. The default value is 4200 seconds, or 70 minutes.

hibernatemode : controls the hibernation mode, and its values are as follows :

  • 0 - Old style sleep mode, with RAM powered on while sleeping, safe sleep disabled, and super-fast wake.
  • 1 - Hibernation mode, with RAM contents written to disk, system totally shut down while “sleeping,” and slower wake up, due to reading the contents of RAM off the hard drive.
  • 3 - The default mode on machines introduced since about fall 2005. RAM is powered on while sleeping, but RAM contents are also written to disk before sleeping. In the event of total power loss, the system enters hibernation mode automatically.

Verify that your values are standbydelay=4200 and hibernatemode=3. If you wish to change hibernatemode to 3, this is done as follows :

sudo pmset -g | grep hibernatemode > ~/Desktop/current_mode.txt
sudo pmset -a hibernatemode 3

The first command is just there for being cautious.

There is also the usual advice about ensuring that your Mac and drivers are fully patched.

More information:

Set newer portable Macs' sleep mode
“Fixing” Slow Wake for MacBook Pro W/ Retina Display

2
  • These are good tips. I think they would want hibernatemode 0 to speed up the wake from sleep cycle, no? There are some tips here rowlandblogs.org/users/robertquiroz/weblog/be6de and there is also an older system extension which automatically re-enables safe mode if your battery is low, and disables it if the battery is charged.
    – beroe
    Sep 16, 2013 at 14:35
  • @beroe: hibernatemode 0 might be dangerous when the battery is low. 3 is supposed to be a good compromise. For the system extension, did you mean Low Battery Saver? An alternative might also be something along the lines of this Applescript.
    – harrymc
    Sep 16, 2013 at 15:14
1

I don't know any way to add a delay for going to sleep when the lid of a laptop is closed.

If others search for how to temporarily or permanently prevent sleep when the lid is closed, you can use NoSleep or InsomniaX.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .