Why do you need a script? Granted my system is using ACPI but...
Battery Status: ${battery BAT1} $alignr ${battery_time BAT1}
Screenshot is here:
http://harrea.100webspace.net/Shot-3.png
incidentally, the powers that be indicated the battery_bar only works in current SVN for conky.
Bookmarks