Check battery status from the command line

Oct 13, '03 10:19:00AM

Contributed by: Kynn

A useful script I came across because, well, I needed it recently -- my laptop's screen was dead, I was in via ssh, and I needed to check on my remaining power. Goran Larsson has written battery, which provides you command-line access to the current status of your battery.

[mysa:~] % battery long 
Battery 1 
  Battery:  battery installed, above warning level 
  Charger:  charger not connected, not charging 
  UPS:      UPS not installed 
  Voltage:  11.751V 
  Current:  0.544A (approx 4:49) 
  Capacity: 2.623Ah of 3.488Ah (75.2%) 

You can download battery from Angry Kitchen Appliances. It's a free shell script.

On a related note, you can modify your power settings from the shell using pmset -- see man pmset for details.

Comments (3)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20031009143314321