Battery State displays your FreeBSD laptop battery status in text styleat
The Battery State application can be integrated in any WM application who accepts text style output like wmii, ratpoison and many others. The application was wrote for FreeBSD in plain C and uses the sysctl interface to query the battery state.
battery.c: Download the source code
The code is delivered under BSD License
The information about the battery state are provided by the “hw.acpi.battery.life” sysctl.
Those values are the power remaining in the battery in percent, and the charging state as a numeric value as displayed in the following array.
|We are using the battery
|We are charging the battery
|Something really weird, but what
|Not present / max
|Another unknown state