Disable Wake From Sleep When Opening the Lid of a MacBook Pro
If you don’t want your MacBook Pro to wake from sleep when you open the lid of the machine, all you need to do is launch the Terminal and type the following command:
sudo pmset lidwake 0
Changes take effect immediately, and you can verify this is working by using the -g profiles flag below, or just by closing the lid to force the MacBook to go to sleep. Now when you open the lid, the Mac will not wake from sleep. This will work on the MacBook, MacBook Pro, and MacBook Air.
You can set this back to default behavior (ie: waking from sleep when the lid is opened) with the following command:
sudo pmset lidwake 1
Again, changes take affect immediately.
If you want to check your pmset settings, use the following command:
pmset -g profiles
You’ll see something like this, grouped by Battery and AC power sources:
womp 0
sms 1
hibernatefile /var/vm/sleepimage
ttyskeepawake 1
acwake 0
sleep 0
autorestart 0
halfdim 1
hibernatemode 3
disksleep 10
displaysleep 15
lidwake 0
Anything with a 1 next to it indicates that feature is enabled, a 0 is disabled. The ‘hibernatefile’ or sleepimage is where the contents of your Mac are kept when you sleep the machine, this serves as a cache file and can grow quite large depending on your RAM. If you want to learn more about the rest of the pmset functions, use ‘man pmset’ at the command line.
pmset is a powerful utility that offers a lot of customization for Mac OS X power management. Using pmset, you can temporarily prevent a Mac from sleeping, schedule Mac boot and sleep/wake times, disable the sudden motion sensor, and much more.
my lidwake is not working suddenly and when I close my display it doesn’t go to sleep mode.. please can u help me out ..
“You can set this back to default behavior (ie: waking from sleep when the lid is opened) with the following command:”
Hmm… How can I use the Terminal if the Mac is sleeping?
hmm… you wake it up by pressing the power button
Anybody knows a command to prevent the mac from waking up when adding or removing usb devices?
Or maybe event prevent it from waking up on key presses?
I want my macbook to only wake up when opening the lid or pressing the power button.
This is an absolute MUST tip to use if the hinge is damaged on your MacBook Pro preventing it from keeping shut as well as it should.
As slunce says, some of the lids will pop open and your MacBook will wake up from sleep if stored in a case or backpack while you’re walking around, once the Mac wakes up it doesn’t sleep and it will drain your battery. This prevents that from happening.
But why?
“Because you can” sounds like something I would expect to hear from Apple’s competitors.
because 2007 macbook pro has got crappy lid and wakes up not only when opened but also when the notebook is carried whilst closed.