Commit Graph

4 Commits

Author SHA1 Message Date
Sandy Mossgrave
15a20da1aa Quicksaving before I add the -f option.
Added ability to log the battery level continuously.
Added compile-time option #define USE_LIBNOTIFY to post a low-battery warning with libnotify.
2023-06-06 15:05:52 +00:00
Sandy Mossgrave
4a942d92f7 Added units to verbose output and changed battery level from a fractional
float to a percentage.
2023-03-22 05:22:41 +00:00
Sandy Mossgrave
006725f4a3 Added recipes 'install' and 'uninstall' to Makefile. 2023-03-14 20:47:03 +00:00
Sandy Mossgrave
50fdb142dd Initial commit. Works.
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.
2023-03-14 18:17:58 +00:00