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

10.4: Use new power management features System 10.4
Tiger only hintIn Tiger, there's a new option for extending your laptop's battery life. You can tell Tiger to automatically dim your display when the laptop's drawing from battery power. Just pop over to the "Energy Saver" prefs pane, choose Settings for: Battery, click Show Details, and select the Options pane. Finally, check the "Reduce the brightness of the built-in display when using this power source" checkbox.

Additionally, the pmset command-line utility has gained some new abilities. One of the nicest, in my opinion, is a simple way to find out if your machine is on battery or AC power:
$ pmset -g ps
Currenty drawing from 'AC Power'
 -InternalBattery-0     96%; AC attached; not charging
This can be a very handy thing to examine when setting up periodic scripts that are power-hungry -- you want to be sure that they won't start in the middle of that trans-Atlantic flight.
    •    
  • Currently 2.75 / 5
  You rated: 5 / 5 (4 votes cast)
 
[13,081 views]  

10.4: Use new power management features | 10 comments | Create New Account
Click here to return to the '10.4: Use new power management features' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Use new power management features
Authored by: shavenyak on May 16, '05 12:27:27PM

Umm, my iBook is running Panther, and has the option to reduce display brightness when on battery power in Energy Saver.



[ Reply to This | # ]
10.4: Use new power management features
Authored by: chabig on May 16, '05 12:59:23PM

Are you speaking from memory? Because my brand new Powerbook running 10.3.9 doesn't have that option.

Chris



[ Reply to This | # ]
10.4: Use new power management features
Authored by: freebee on May 16, '05 01:13:19PM

ditto



[ Reply to This | # ]
10.4: Use new power management features
Authored by: diamondsw on May 16, '05 02:31:41PM

Don't see that on an iBook G3/800 running 10.3.9.



[ Reply to This | # ]
10.4: Use new power management features
Authored by: Anidel on May 16, '05 03:38:16PM

I think the replies' talking about "manually" reduce the brightness and set it to a lower value when in battery mode.
What he doesn't know is that Tiger as a new option to just dim the brightness.

---
Anidel



[ Reply to This | # ]
10.4: Use new power management features
Authored by: sweyhrich on May 16, '05 07:07:14PM

This uncovered one of my annoyances about my PowerBook G4 since changing to Tiger: I couldn't understand WHY I was seeing the screen get dim, even when it was plugged in, prior to the screen saver coming on, and then eventually going dark completely. Unchecking that box for when I am plugged into a power adapter makes me much happier!

---
Steven Weyhrich
http://apple2history.org



[ Reply to This | # ]
Anyone smart enough to hack this a little bit?
Authored by: bethri on May 16, '05 11:25:20PM

Since I bought the marvellous book Mac OS X Panther Hacks, I've been running a hack to do exactly this. It involved a ruby script which called a bit of GUI Applescripting to dim the screen every time the power supply changed from AC to battery. The side effect was that you actually saw the whole process: System Prefs launched, switched the brightness, and quit. The advantage over the new Apple setting is that you could define just how dim the screen would be set.

Since I generally want to aim for maximum battery life when I move away from AC, I had it dim quite a bit lower than Apple's new default of 3 steps below whatever your current brightness setting is.

Apple's implementation of this fairly essential feature is much slicker than the hack was (though the hack still works on Tiger) so I'd like to switch. My question is: is anyone clever enough to figure out which cryptic system preference file holds the "reduce the brightness by 3 clicks" instruction so we can change it, say to 8 clicks lower?



[ Reply to This | # ]
pmset, @AppleNotOnBattery, cron
Authored by: moritzh on May 17, '05 10:45:45PM

Very intersting info about pmset indeed. Just a quick side note regarding running cron jobs only when your Mac is connected to the power supply which can be useful for 10.3 and 10.4 users alike:

In the crontab file, you specify when you want to run your cron jobs. E.g., you could have something like this

0 22 * * * root /bin/foo.sh
to run /bin/foo.sh as root at 10 pm. By changing it to
0 22 * * * root @AppleNotOnBattery /bin/foo.sh
you will get the same, except this time /bin/foo.sh is only executed when the computer is not running on battery. Obviously, this is an Apple-specific extension and does not work on other UNIX flavors. Type man 5 crontab and man cron to learn more.

Note that this should work both in 10.3 and 10.4. I know that the way cron jobs are executed has changed from 10.3 to 10.4, but from what I understand the functionality in 10.4 should not be adversely affected. I haven't tested, though...

Also, as a general note, keep in mind that cron jobs are executed at fxed times. Usually the jobs are scheduled at times such as midnight or 3 in the morning, and since not everyone is running their computer at these times, the chances of actually running them decrease a lot, especially for users of portable computers (basically the only ones for whom the setting @AppleNotOnBattery really makes sense...). This problem is addressed by tools such as anacron or XJanitor.pl - do some google searching on these, and there also some good hints on this site on this topic, but I am too lazy to find them now, gotta do it yourself if you are interested...

Since @AppleNotOnBattery only works for cron jobs and not other custom mechanisms to launch your scripts, using the results obtained from the pmset command presented in the original hint (on 10.4) is certainly the more universal choice.



[ Reply to This | # ]
10.4: Use new power management features
Authored by: barrysharp on May 23, '05 05:32:11PM

I was curious to find out just how much battery charge life was being saved by this "Reduce the brightness..." when in Battery setting.

My computer is a Ti 1GHz PB approx 1.5 years old and with original battery.

Starting at a battery charge level of 96% and with Battery only with "Reduce the brightness..." box checked I monitored the pmset -g ps output until battery strength arrived at 85%. The result was

At 85% remaining battery life was 4:44.

I then reconnected the A/C and charged the battery back to 95% and repeated the test with the "Reduce the brightness..." unchecked. The result was

At 85% remaining battery life was 4:05. (Interesting enough the value at 84% was 3:16)

I monitored the battery level using a simple while loop in the Terminal.app

while true
do
pmset -g ps
sleep 60
done

During the test I did nothing on the computer and only a few trival background processes were active for both "Reduce the brightness..." settings.

Another interesting fact was that during both tests the battery life peaked at around 5:00. That is, when test started the battery life slowly climbed up to 5:00 and gradually reduced down to the numbers I gave above.

---
Regards... Barry Sharp



[ Reply to This | # ]
Battery levels w/pmset -g pslog
Authored by: victory on May 10, '08 03:30:29AM
[Seeing as the original hint was posted several years ago, I'll leave this mini-hint here largely for posterity]

The pmset utility in OSX 10.5 now includes a new feature to loop through a continuous series of battery level updates w/o having to use a separate sleep command:

pmset -g pslog

Which will display battery stats and loop every minute or so.

If you need to monitor battery life (say for troubleshooting) and you don't want to watch the batt. level indicator constantly, here's a quick way to have OSX's text-to-speech tell you the current value every 2 minutes:

ruby -e 'loop do;if %x(pmset -g batt)=~/(\d+%)/;%x(say "battery at #{$1}");end;sleep 120;end'

(This works with the Leopard version of pmset. I haven't tested it w/any other. Why use Ruby instead of a shell script w/pipes to awk/sed/etc? I dunno -- why not? Ruby is awesome :-)

[ Reply to This | # ]