I have been building up a number of commands that I can use in GeekTool. One that I wanted but couldn't find in other lists was the current battery capacity. This works for me:
ioreg -l | grep -i capacity | tr '\n' ' | ' | awk '{printf("%.2f%%", $10/$5 * 100)}'
[robg adds: This worked as shown on my 10.6.2 on my MacBook Pro. To get it work in 10.5, though, I had to modify the command a bit; I found that this version works in 10.5:
ioreg -l | grep -i capacity | grep -v Legacy| tr '\n' ' | ' | awk '{printf("%.2f%%", $14/$7 * 100)}'Mac OS X Hints
http://hints.macworld.com/article.php?story=20100130123935998