pwrcheck

pwrcheck: A simple, scriptable, command-line utility to determine if you are running on battery or not. For Mac OS X.

Download: Current Version (.tar.gz) Older Versions

pwrcheck Returns 0 if the computer is running on AC power, or 1 if it is running on battery. The source code includes a trivial shell script check.sh that shows one way how to use pwrcheck to determine if running on battery.

% cat check.sh #!/bin/sh if pwrcheck ; then echo "On Mains" else echo "On Battery" fi % ./check.sh On Mains %

pwrcheck is released under the GNU General Public License.

 
Copyright © 2005-2009 Branden J. Moore <bmoore-web@forkit.org> [gpg key]
Document last modified on Sun, 18 Feb 2007 14:23:22 -0500.
This page has been Verifed XHTML 1.1 Strict as well as Valid CSS If it is not rendered as you would expect, contact your browser's author(s) and complain.