Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

More cool pmset command line sleep and wake options UNIX
The other day I was fiddling around with pmset on an iMac to try to make the harddrive sleep right away. I forgot the syntax for pmset since I hadn't used it since 10.2. So I called up its man page, and I noticed it contained many more options than I was used to. I'm not sure when this new version of pmset came along, but I am using Mac OS X 10.3.2 and I can tell you that it has a lot of nice extra preferences.

For instance -- this is really for PowerBook and iBook owners -- one can now set the computer NOT to wake up when the lid is opened (lidwake) or when the AC power is connected (acwake). For all other Macs, one can now set the machine NOT to sleep when the power button is pressed (powerbutton). Another nice feature is the ability to dynamically change processor speed -- again on portables only -- dependant on the load on the system (dps).

I couldn't find any of these new features hidding in System Preferences or even on this site yet. So here they are! All I really want now is an option for portables to stay awake when the lid is closed!

PS. I tested and verified that the portable-only options work on a PowerBook G4 800 DVI.
    •    
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[48,276 views]  

More cool pmset command line sleep and wake options | 35 comments | Create New Account
Click here to return to the 'More cool pmset command line sleep and wake options' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
awake with lid closed
Authored by: rhowell on Jan 28, '04 11:30:33AM

"All I really want now is an option for portables to stay awake when the lid is closed!"

That's like putting a wool hat on in the summer. Even sitting in front of a fan won't help much.

Carefull...



[ Reply to This | # ]
awake with lid closed
Authored by: drock3800 on Jan 28, '04 11:48:04AM

agreeing with the last commenter:

according to the Powerbook Project Manager from apple (who visited my college campus last week), the powerbook cannot sufficiently cool itself if on while the lid is closed. If such an option were activated, the 'book would probably damage itself. Obviously this is not an acceptable option, and so is not included in the feature set (and probably never will be).



[ Reply to This | # ]
awake with lid closed
Authored by: Xeo on Jan 28, '04 01:46:22PM

That would be odd for the PowerBook Project Manager to say it will damage the computer when PowerBooks are designed to run with the lid closed. If you walk into an Apple Store, you can find a 23" Cinema Display and keyboard with a 17" powerbook shut and between the legs of the display. iBooks are the only ones that don't have this feature and I think it's simply to make the PowerBooks look more appealing.

So, if Apple were to allow the PowerBooks to be run w/o an external display hooked up (ie, for carrying), I don't see how it would damage the computer any more than running it w/ one.



[ Reply to This | # ]
Screen off = much less power?
Authored by: MattHaffner on Jan 28, '04 11:48:01PM

My guess is that when the LCD is off (i.e., you're running an external monitor), the power consumption is much less and the heating is not as much of an issue. That being said, I've certainly gotten the fan to run even in this state with CPU or GPU intensive tasks.

It would be nice if they clarified the situation.



[ Reply to This | # ]
awake with lid closed
Authored by: ahbe on Jan 28, '04 02:17:30PM
Ok, fair enough. Supposedly this guy from Apple said you can't run your PB with the lid closed. Then explain this article (Apple Support) to me please? I use my 12" PB all the time with the lid closed connected to an external monitor. In fact one of the grips about the 12" was a lack of ADC connector, which the new one's have. Now why would you need that I wonder? It's not often your going to find a projector with a ADC connection on it. No, it's to use your PB, lid closed, connected to a nice Apple Display. Now I'm not saying your lying, It's just that I wish Apple would get on the same page. Either say once and for all, yes or no to running your PB with the lid closed. And if we can run it with the lid closed, than why not let us set it up so it will say on when we close the lid? One other thing. I never used to run it with the lid closed until this recent OS update. Since than I notice the fan runs allot more and my little PB stays allot cooler. Before I was a little worried about the LCD, but not anymore.

[ Reply to This | # ]
awake with lid closed
Authored by: drock3800 on Jan 28, '04 07:51:43PM

All I can confirm is that this WAS brought up to the Product Manager at the meeting and she flatly shot us all down by bringing up the cooling issue. Basically, Apple is not ready to support a feature that could potentially damage the unit. According to her (the Product Manager), the computer vents almost all of its heat through the keyboard. Prolonged running with the keyboard pressed against the screen (i.e. when the screen is closed) could both, cause the unit to overheat (due to lack of ventilation), and the screen itself to warp due to prolonged exposure to processor heat. Obviously it may be possible to run it this way, but I wouldn't expect AppleCare to cover a warrantied repair on a warped display that happened as a product of running with the screen down. Obviously it may work well for a while, but I can't blame apple for not wanting to cover ALL the potential problems that can arrise from such a setup.



[ Reply to This | # ]
awake with lid closed
Authored by: ecammit on Jul 24, '04 10:33:25PM

How about this? Close your powerbook and either turn it upside down, or stand it up on end like a book. Since heat rises, if you change the orientation of your powerbook so that the heat rises away from your screen, should that not prevent the screen from burning up?



[ Reply to This | # ]
awake with lid closed
Authored by: chrismo on Jan 23, '06 09:29:40PM

There must be some way to modify the firmware so that when the lid is closed the energy saving preferences are altered, reducing cpu speed and turning off the display, instead of full blown sleep. I also believe it is possible to modify the fan setting from a file in OS 10.3 to choose at what temperature and at what speed the fans are activated. Making the fans spin up at a lower temperature could help keep it cool with the lid shut. I intend to experiment with this more next time I get my hands on an iBook/PowerBook.



[ Reply to This | # ]
awake with lid closed
Authored by: johnsawyercjs on Dec 26, '08 09:49:20PM

Speaking as a Mac repair tech since before the first Powerbook: yes, lots of heat is dissipated through the keyboard, but never enough to warp the display. For one thing, the display contains a glass sheet, and a metal frame, and those aren't going to warp. There's also some relatively soft plastic in the LCD display's frame, but the metal frame and the glass sheet prevent that plastic from warping. There's a remote, theoretical possibility that if a Mac portable were to get ESPECIALLY hot for some reason (like the battery overheating, like a rare few do), the heat might go up through the keyboard and cook the LCD, causing it some damage like discoloration of the displayed colors, but it's very unlikely, and I've never heard of it happening.



[ Reply to This | # ]
awake with lid closed
Authored by: karenwallace on Jan 28, '04 12:00:57PM

Apple seems to presume that we want to close the lid and run it for hours that way. I would like to be able to close it and carry it down the hall without losing all my network connections and remote desktop windows. Instead I'm carrying an open laptop, which means I can't use that arm for anything else.



[ Reply to This | # ]
awake with lid closed
Authored by: aranor on Jan 28, '04 12:52:07PM

No, I think they're well aware of why people would want this feature. However, there will always be people who *will* close it and forget about it, and break their computer by leaving it that way for hours, and then they'd get mad at Apple and perhaps sue them (hey, if people sue Apple over the fact that batteries don't last forever, they'll sue over this). I think Apple made the right decision in not making this available.



[ Reply to This | # ]
awake with lid closed
Authored by: r0adrage on Jan 28, '04 01:22:42PM

I do want to close my powerbook and run it for hours that way.

I want to keep iChat running while the lid is closed. If someone messages, I can reach over and open it up, but while I'm not actively using it, the screen and keyboard are protected (from my pets, in particular). An open laptop is such a huge target.

It would also make my powerbook available via Rendevous for XCode compilation.. I have a 1.25Ghz G4 sitting here, which could cut a huge chunk out of compile times, if it wasn't always asleep.

Every non-Apple laptop I have ever owned has been able to run with the lid closed, and none of them have ever overheated. That feature alone isn't enough for me to dump OSX for linux on x86, but it is probably my #1 gripe over Apple laptops.



[ Reply to This | # ]
awake with lid closed
Authored by: mivok on Jan 28, '04 02:45:53PM

For some network connections - most notably ssh connections in the terminal and my jabber IM client (I don't have any other connections left open) I can close the lid for up to 10 minutes (I haven't tested exactly how long, I just open the lid and am surprised to see I can still type in my ssh connection) and still keep the connection.
I'm connected via airport extreme and through an adsl router if that would affect things - obviously the ip address would need to stay the same between the two locations of the laptop as well.



[ Reply to This | # ]
Here's How to do it
Authored by: SOX on Jan 28, '04 12:52:52PM

ActuallyI use my powerbook with the lid closed about 95% of the time its in use. It works quite well.

You can get the computer to stay awake with the lid closed by connecting an external screen/ keyboard/ and power. Start with the machine sleeping with the lid closed and plug in all thes items. if nothing happens, move the mouse and press some keys. The machine will wake and use the external screen even thought the powerbook is closed. At this point if you want to open the powerbook the built-in screen will remain off. I have not had any problems with overheating. the fan does not run exccessively with the lid closed.



[ Reply to This | # ]
Another Way To Do It
Authored by: harrisonrhw@nurv on Jan 28, '04 05:37:41PM

Another way to prevent your apple laptop to stay awake while lid is closed is to get "NoSleep" (No Spaces) from versiontracker. It downloads and installs a patch designed for your system. However there are some laptops out there that may not work as well with it. It is recomended that you use a powerbook G4 or iBook Dual USB or later



[ Reply to This | # ]
awake with lid closed
Authored by: keppie on Jan 29, '04 12:52:21PM

Yeah, I dunno about this, Apple's gone back and forth so much it seemed to be random whether a particular model since the wall streets would work with the lid closed. I actually really wanted this feature to 2 clients I was buying systems for a while back, so I emailed a contact in the NE High-Ed sales at apple. He looked into it and told be that the 500MHz Dual USB 12" iBooks did support lid-closed operation... That worked fine through OS 9.1, but in 9.2 and all versions of 10, it does not work. I can't really belieive that the OS makes the hardware run hotter, so either they had an incidence of these being damaged by being used in a way that was originally supported and so quietly disabled it future updates, or they just decided to be consistent even though it did no harm... any body has more info let me know, I'm about to try that NoSleep thing... hadn't heard of that before.



[ Reply to This | # ]
"dps" option is in System Prefs
Authored by: Xeo on Jan 28, '04 01:54:24PM

The option "dps" is set to "1" when you change the processor performance to "Automatic" instead of "Highest" or "Reduced" in the Energy Saver System Pref.

The other options you mentioned don't seem to have a GUI.



[ Reply to This | # ]
"dps" option is in System Prefs
Authored by: ahbe on Jan 28, '04 02:03:59PM

What version of OS X are you running? I'm on 10.3.2 on a 867Mhz 12" PB and I only have the option of Highest or Reduced. What gives?



[ Reply to This | # ]
"dps" option is in System Prefs
Authored by: wrzlbrnft on Jan 28, '04 02:45:22PM
Hey, yeah... stumbled accross the same question... BUT : 'man pmset' does tell you this one :
The -g flag outputs the settings currently in use (same as -g live ). -g disk will tell you the settings on disk. -g cap will tell you which power management features the machine supports. -g sched will show scheduled startup/wake and shutdown/sleep events.
So... just entering 'pmset -g cap' tells us :
Capabilities:
dim
spindown
sleep
reduce
womp
ring
acwake
autorestart
lidwake
... I'm sorry to say so... no dynamic cpu speed settings for us 12" PB users... but WHY ???

[ Reply to This | # ]
"dps" option is in System Prefs
Authored by: nick on Jan 28, '04 06:13:03PM

i have dps=1 on my GHz 12''...



[ Reply to This | # ]
"dps" option is in System Prefs
Authored by: wrzlbrnft on Jan 29, '04 04:19:04AM

?

Is the dps option listet when querying with pmset -g cap ?!?

If yes... what could be the reason for this difference ?

using pmset -c dps 1 doesn't give me an error... but pmset -g
tells me it's a) still reduced and b) there is no dps option listet
on the capabilities list.

Any ideas ?



[ Reply to This | # ]
What About...
Authored by: craigsheppard on Jan 28, '04 04:00:04PM

Is there any way to immediatelty dim the screen? I don't mean sleep the PB, but just turn off the backlighting (like energy saver does after the pre-set time).

Right now I have a cumbersome script open the energy saver and set the screen time to 1 minute, but it would be nice not to have to do this...

I've been searching since the public beta, so any insight would be great ;)

Craig



[ Reply to This | # ]
dimming the screen
Authored by: MordEth on Jan 28, '04 04:58:36PM

using pmset from Terminal is easy to do...first of all, you're going to want to run 'visudo' either as root or with sudo (i.e. sudo visudo), and add this line to the end of that file:

%admin ALL=(ALL) NOPASSWD: /usr/bin/pmset

this will prevent you from having to type a password every time that you go to change pmset's settings, since you have to run it either as root or with sudo.

i also recommend that you alias 'pmset' to 'sudo pmset', to save yourself typing.

then all you have to do is:

pmset -a dim 1

if you're really lazy like i am, you can alias this to something, also, and not have to type the whole line out every time that you want to use it. to turn off the timed display sleep, you'd use the same command with "0" in place of the "1".

you might also want to look at http://wincent.org/article/articleview/36/1/8/

i found that extremely helpful when i was looking to make pmset a bit more GUI-friendly for my girlfriend's iMac, on which i'm using ScriptGUI-wrapped versions of the command above so that she can run them from FruitMenu. it works great.



[ Reply to This | # ]
dimming the screen
Authored by: arifsaha on Dec 08, '08 10:00:34AM
The referred page has changed, it is now http://web.archive.org/web/20050628193758/http://wincent.org/article/articleview/36/1/8/

In the forum there is also very nice trick to do exactly what OP wants: http://forums.macosxhints.com/showthread.php?p=507337#post466891

---
- http://www.arifsaha.com/


[ Reply to This | # ]

More cool pmset command line sleep and wake options
Authored by: seann on Jan 28, '04 04:58:29PM

Is there a, "Run these items on wake from sleep"
Option?



[ Reply to This | # ]
More cool pmset command line sleep and wake options
Authored by: Basilisk on Jan 28, '04 10:43:25PM

SleepWatcher does this.

http://home.t-online.de/home/bernhard.baehr/



[ Reply to This | # ]
set start up time?
Authored by: UCMacGuru on Jan 28, '04 06:53:01PM

I have a lab where users are constantly turning off thier machines when they are finished. Other users see the machines switched off and think they are down. Is there any way from the CLI to set the start up time in the power manager? If I could, I could have a cron job run every couple of minutes and set the power on time to 2 minutes from "now".



[ Reply to This | # ]
Re: powerbutton
Authored by: MJCube on Jan 28, '04 10:05:46PM

At least one of these is presented in Panther: In System Prefs > Energy Saver > Options, there is check box for "Allow power button to sleep the computer" that comes checked by default. I unchecked it as soon as I found it.



[ Reply to This | # ]
Re: powerbutton
Authored by: rfattaleh on Feb 01, '04 06:34:33PM

where do you see this; I do not see this option on PB G4 10.3.2



[ Reply to This | # ]
Re: powerbutton
Authored by: n8gray on Mar 03, '04 11:56:46PM

I don't see this either. OS X 10.3.2



[ Reply to This | # ]
Battery vs AC
Authored by: pauljlucas on Jan 29, '04 01:43:11AM

What I want is the ability to set a certain screen brightness level based on whether the PowerBook is currently running on battery of AC power, e.g., when on battery, 50%; when on AC, 100% brightness.

---
- Paul



[ Reply to This | # ]
Dimming the screen
Authored by: bakalite on Jan 29, '04 02:21:01AM

I don't know what your guys problem is with using the keyboard to do this. It is fast and easy and works. What is a hassle is that on my Tpb there doesn't seem to be a way to set the processor speed to respond to load. It's either full or reduced, so it sucks down power while you are sitting there reading a web page.



[ Reply to This | # ]
Dimming the screen
Authored by: pauljlucas on Jan 29, '04 10:38:39AM
There is no "problem" with using the keyboard. It just seems silly to have to constantly be adjusting it. I have my CPU set to full speed on AC power and reduced on battery. I should also be able to set the screen brightness in the control panel for different power sources.

Under Linux, you can run any script you want upon a power status change.

---
- Paul

[ Reply to This | # ]

More cool pmset command line sleep and wake options
Authored by: Ken OShea on Jan 29, '04 11:19:53PM

where can I change the default scheduled shutdown delay (600 seconds!!)?



[ Reply to This | # ]
More cool pmset command line sleep and wake options
Authored by: johnsawyercjs on Dec 26, '08 09:43:31PM

Install FruitMenu, and use its Apple menu options labeled "Reset", "Sleep" or Shut Down" instead of the Apple-default "Reset...", "Sleep...", and "Shut Down...". However, Fruitmenu's options will remove any delay time before these options are executed, instead of giving you the ability to change the timeout.



[ Reply to This | # ]