Instructions
batterystat is a commandline tool to print battery status information.
The following options are available:
- -a
- Connect to remote battery address.
- -c
- Prints the count of locally installed batteries and exits.
- -m
- Prints additional battery hardware information like manufacturer, manufacture date etc.
- -n #
- Request information for battery at position #. This is only meaningful for multiple battery systems like Pismo laptops. Default is 1.
- -p
-
Return the value of a single property. Allowed property names are: charge, amperage,
capacity, maxCapacity, designCapacity, voltage, cycleCount,
plugged, charging, manufacturer, manufactureDate, serial, deviceName,
timeToEmpty, timeToFullCharge. If not used, all properties are returned.
- -t
- Include time information.
- -v
- Prints version information and exits.
- -x
- Prints output in XML format.
Sample output:
maia:~ delphine$ batterystat
Charge: 97 %
Capacity: 2666 mAh
Max Capacity: 2727 mAh
Design Capacity: 4400 mAh
Amperage: 0 mA
Voltage: 12374 mV
Cycle Count: 131
Power Source: AC Power
Charging: No
maia:~ delphine$ batterystat -c
1 installed batteries.
maia:~ delphine$ ./batterystat -h
batterystat (c) Claudio Procida 2006-2008
Usage: batterystat [options ...]
Options:
-a Connect to remote battery address.
-c Prints count of local batteries and exits.
-m Include battery hardware manufacturing information.
-n Index of battery for which you want information. Defaults to 1.
-p Return the value of a single property. Allowed property names are: charge,
amperage, capacity, maxCapacity, designCapacity, voltage, cycleCount,
plugged, charging, manufacturer, manufactureDate, serial, deviceName,
timeToEmpty, timeToFullCharge. If not used, all properties are returned.
-t Include time information.
-v Prints version number and exits.
-x XML output.
-?/-h Prints this screen and exits.
maia:~ delphine$ ./batterystat -n2
No such battery.
maia:~ delphine$ ./batterystat -p charge
97
maia:~ delphine$ ./batterystat -p manufacturer
Sony
maia:~ delphine$ ./batterystat -x
<?xml version="1.0" encoding="utf-8"?>
<battery xmlns="http://burgos.emeraldion.it/mbl/">
<charge>97</charge>
<capacity>2666</capacity>
<maxCapacity>2727</maxCapacity>
<designCapacity>4400</designCapacity>
<voltage>12378</voltage>
<amperage>0</amperage>
<cycleCount>131</cycleCount>
<plugged>1</plugged>
<charging>0</charging>
<timeToEmpty>-1</timeToEmpty>
<timeToFullCharge>-1</timeToFullCharge>
<manufacturer>(null)</manufacturer>
<manufactureDate>(null)</manufactureDate>
<deviceName>(null)</deviceName>
<serialNumber>(null)</serialNumber>
</battery>