Makefile copied from pokemath project
Reads two files from sysfs: charge_now and charge_full under BAT0,
then divides them using float math.
Output is guaranteed to be stable across major versions.
Supported options:
-v gives verbose output for debugging purposes
-h shows help text and exits
-t gives terse output
Known issues:
The path to charge_now and charge_full is hard-coded. This utility will not work with batteries that do not happen to be named BAT0.
The float value given by this program is not actually a percentage.
TODO:
Move help text #defines into a header file
Add support to traverse /sys/class/power_supply and locate
batteries
Possibly add support to store default battery paths in /etc/battery_percent.conf
DISCLAIMER:
This program is already too overcomplicated and shows no signs of slowing down.