A Mac’s ability to start up nearly instantly after being woken from sleep is one of its strong points, but it can cause major problems if the laptop’s lid opens accidentally.
A while back my precious Macbook Pro was the victim of a couple unfortunate “incidents” shall we say, which led to one of the two hooks on the top lid being broken off. Aside from being devastated that it was no longer in pristine condition, I found myself dealing with an inconvenient problem. Any time I would put my Macbook Pro in a bag to travel with, I would later find the lid ajar and screen already turned on. This could be potentially damaging to any kind of notebook computer because the heat generated while it’s in a closed environment like a case might fry the machine’s internal components. Ouch.
I’m not sure about the Macbook and Macbook Air since they use Apple’s new magnetic latch, but I know of a surprising number of people who own a Macbook Pro or older Mac laptop and have similar broken latch troubles. Completely shutting down every time we want to take it somewhere is an option, although not particularly user-friendly. So what are we to do? A useful little Unix program that’s built into Mac OS X called pmset can help us out.
Using Terminal (located in Applications > Utilities), we can make our desired change with a single command.
sudo pmset -a lidwake 0
Once this is copied and pasted into Terminal, press enter/return on your keyboard. Next, Terminal will ask you for your administrator password. Don’t be alarmed when you start typing it and the text cursor doesn’t move. Terminal is registering your keystrokes even though they’re not being shown. Press enter/return again and you’ll be good to go. It won’t show a confirmation or any sign that the setting was changed, but rest assured that it was. To wake your Mac from sleep now, press any key on the keyboard and it will turn on like normal. If your laptop’s lid is open and flopping around in a bag, OS X won’t care — nothing will happen until you make a keystroke.
Now, depending on the kind of person you are and how much you like to really understand what’s going on behind the scenes, there is an explanation for what the pieces of this command mean. Let’s go through them one-by-one:
Tells Terminal to execute the command through the root user. The root user is the system administrator account.
As I briefly mentioned before, pmset is a Unix application that handles power management settings in OS X.
Specifies that you want your laptop to make the requested change across all power sources. The other options you could use here are -b for battery only, -c for AC power charger only, and -u for UPS only (uninterruptible power supply, or battery backup).
The setting which enables automatic wake-ups after the laptop’s lid is opened. Zero (0) turns this functionality off, while a one (1) would turn it back on. So if you decide to go back to allowing your Mac notebook to return from sleep when the lid is opened, use the same Terminal command and substitute the 0 with a 1.