Skip to Content

Terminal Tip: Keep your Mac portable from waking when the lid is opened

Although I'm a Mac Geek by trade, I tend to avoid the terminal unless I'm out of other options. I'm a GUI kind of girl. It's the Mac OS that I love, not its Unix underpinnings. I appreciate the power of the command line - I just don't want to spend all day there. Still, once in a while I come across a tip like the one, which Glenn Fleishman posted in the most recent TidBITS, and I find myself unable to resist the urge to fire up the Terminal.

This tip solves a problem that I've experienced myself and many of my clients have complained about - laptops waking from sleep while in their cases because the latch won't keep the lid closed. This can cause overheating, which can lead to a variety of other problems, like hard drive failures, etc. My solution is, of course, to fix the latch! But there are times when that isn't convenient and even if it's convenient it doesn't happen often enough for some people to even bother stressing about it. By harnessing the power of pmset, the command line app that controls power management settings, you can fix it so that your sleeping beauty stays asleep, even when the latch isn't doing its job.

The command is an easy one - a single line. Ready for it?

sudo pmset lidwake 0

By setting the lidwake value to 0 you prevent the machine from waking until you tap a key on your keyboard, and since the value gets written just to a plist file, it takes hold right away. Of course you'll need administrator privileges since you'll be asked for an admin password before the command is executed.



For more pmset options, have a look at the "man" pages at Apple's Darwin Reference library, or open your Terminal and type "man" (without the quotes), hit return and then type "pmset" (without the quotes.)

Although I'm a Mac Geek by trade, I tend to avoid the terminal unless I'm out of other options. I'm a GUI kind of girl. It's the Mac OS...
 

Add a Comment

*0 / 3000 Character Maximum

25 Comments

Filter by:
benaroia

I have a iBook G4 with 10.4.11 and Insomnia just shuts the computer down instead of not sleeping it. By the way laura, when you close the lid, it turns the screen off due to a small reed switch in the case. This prevents overheating too much. It will be warm, but it won't break it.

November 21 2007 at 8:50 AM Report abuse rate up rate down Reply
agapean

I cannot seem to get this to work on my PB. I still use 10.2.8, does that make a difference? I would think it wouldn't because it's a unix command, right? Any help?

October 11 2006 at 12:41 AM Report abuse rate up rate down Reply
Jay

I'm the same as wackybit - using InsomniaX - and it's worked perfectly for me, but unfortunately, after installing the recent Mac OS update, Insomnia's not working. I assume they'll work on a fix...hopfully soon. Wacky, does yours still work?

October 11 2006 at 12:35 AM Report abuse rate up rate down Reply
Laurie

I didn't mean to imply that you can't ever run the machine with the lid closed. for years we've all been able to close the lid on our powerbooks and use only an external display. My pismo ran almost exclusively like that for 3 years. what i said was you can't close the lid and have iTunes running (or, as mike points out) the display active - because you will burn the machine up. trust me. it's designed to run like that for an external video source, but not really advisable to do that for any other reason.

October 10 2006 at 2:29 PM Report abuse rate up rate down Reply
niclet

@ presodent

sudo pmset lidwake 1

October 10 2006 at 1:43 PM Report abuse rate up rate down Reply
presodent

does anyone know how to "undo" or turn off this command after I have enabled it and used it on my laptop?

October 10 2006 at 1:24 PM Report abuse rate up rate down Reply
aron t

From the "detailed comparison chart" viewable online: "When you connect an external display or projector to a MacBook or MacBook Pro, you can make presentations to large groups, extend your workspace, or work with the lid closed."

=aron=

October 10 2006 at 11:23 AM Report abuse rate up rate down Reply
niclet

@ peekytoe

I think it's fine: I carry my PB almost exclusively in sleep mode for about two years now and it still working A1. Sure if it is abused, it probably won't help, but to drop a PB/MBP/iB/MB on the floor in sleep mode or not doesn't make a big difference. Then, a good padding sleeve and bag to protect it from the blows is a solution.

October 10 2006 at 10:45 AM Report abuse rate up rate down Reply
Mike R.

a) Yes you can run your laptop closed with an external display, mouse & keyboard connected: see here --

http://docs.info.apple.com/article.html?path=Mac/10.4/en/mh1963.html

b) Yes, if the machine ACCIDENTALLY wakes up and is running display, etc. while in a knapsack or other enclosed location, overheating is a real danger.

Thanks for the heads-up Laurie! I know you had to hold your nose to give us a Terminal-related tip. :-)

October 10 2006 at 10:33 AM Report abuse rate up rate down Reply
Aly

Had a look around the pmset commands but couldn't see what I'm looking for. A command to stop my mac waking when USB is connected or disconnect? Anyone?

October 10 2006 at 10:16 AM Report abuse rate up rate down Reply
Buy an ad here

Hot Apps on TUAW

Tweets

© 2012 AOL Inc. All Rights Reserved.