sys-power/
upower

D-Bus abstraction for enumerating power devices, querying history and statistics

https://upower.freedesktop.org/