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-2022 Branden J. Moore <bmoore-web@forkit.org>
Document last modified on Fri, 11 Feb 2022 01:56:45 +0000.
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.