Chris,
Shouldn't you be able to get this info from your computer itself?
Something like:
cat /proc/acpi/battery/BAT0/state
Or maybe google for acpi or acm ... ?
The battery widgets which show you whether your battery is in use or charging, must make use of this info.
Peter.