battstats is a simple little shell script wrapper for MacOS X around ioreg, a command line IOKit registry tool. What it does, is query your battery’s charge, then optionally reports this via both screen, and exit level codes. The following exercept is most likely only useful to UNIX geeks, don’t be afraid if it makes absolutely no sense:
20:46 [procyon] /Users/shawn/Documents/code/battstats%sh battstats.sh battstats.sh v0.1.1 by Shawn Holwegner – NO WARRANTY. > Battery is at 70.92%, and charging. 20:46 [procyon] /Users/shawn/Documents/code/battstats%sh battstats.sh -s -q;echo ‘Battery status is roughly ’$?’.’ Battery status is roughly 71.If this is something you might find more useful than the tiny menubar widget, feel free to snag it here.