Battery indicator for PinePhone keyboard
Pine64 provides an official accessory - a keyboard that connects via pogo pins on the back of the phone and contains a 6000mAh battery. But we currently we display only charging level for the built-in battery. It would be great to display the charging level for keyboard as well. Here are some thoughts:
- The ideal solution from user perspective would be to have two indicators. But @devinlin said the we currently don't have support for multiple batteries. But maybe we could somehow handle this special case?
- Alternatively it could be a widget that just displays the keyboard capacity.
- Alternatively we could display the average since the keyboard can act as additional capacity for the phone via megi's kernel driver. See details in this post.
But the tricky part is to how to obtain it's capacity. In order to do it you need to read JSON from /sys/kernel/debug/kbpwr/state
(works only if the megi's driver is enabled and reports the correct value). Or from /sys/class/power_supply/ip5xxx-battery/capacity
, but with bad accuracy.