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.)
Share
Categories
Tips and tricks iBook PowerBook Terminal Tips Macbook Pro MacBook
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
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 Permalink rate up rate down ReplyI 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 Permalink rate up rate down ReplyI'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 Permalink rate up rate down ReplyI 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 Permalink rate up rate down Reply@ presodent
sudo pmset lidwake 1
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 Permalink rate up rate down ReplyFrom 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=
@ 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.
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. :-)
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 Permalink rate up rate down ReplyHot Apps on TUAW
Deals of the Day
more deals- miFrame Picture Frame Dock for iPad for $64 + $8 s&h
- Refurb Apple iPod nano 8GB MP3 Player for $99 + free shipping, 16GB for $119
- Bling Diamond Snap-On Shell Case for iPhone 4 / 4S for $2 + $2 s&h
- Hannspree Apple-Shaped 28" 1080p LCD HDTV for $270 + free shipping
- Philips wOOx Alarm Clock Radio for Apple iPod / iPhone for $60 + free shipping
- iWatchz Elemetal Collection Bracelet for iPod nano for $75 + free shipping
Software Updates
more updates- EFI Firmware Update brings Lion Internet Recovery to 2010-model Macs
- OS X Lion 10.7.3 released with Safari 5.1.3, Wi-Fi bug fix
- Aperture updated to 3.2.2, addresses Photo Stream issue
- Apple updates Keynote to address Lion issues
- Google Search app gets new look on iPad
- Apple releases Apple TV Software Update 4.4.3



25 Comments