electrickite / batsignal

Lightweight battery daemon written in C
ISC License
175 stars 20 forks source link

Feature request: Support multiple batteries #4

Closed croissong closed 3 years ago

croissong commented 4 years ago

Hi, awesome utility!

It would be great if multiple batteries were supported, i.e. report the average percentage. For example i3-status-rust supports this by using UPower and its DisplayDevice, which treats all physical power sources as a single logical battery: https://github.com/greshake/i3status-rust/blob/master/src/blocks/battery.rs#L283.

electrickite commented 4 years ago

I like this idea, but I don't want to introduce a dependency on upower. It should be easy enough to create an array of available batteries and their charge remaining based on sysfs data.

bograt commented 3 years ago

I just came here to request this as well. I would like to say that there's a simple shell script to average out batteries for use with Polybar, so I don't know if UPower would be necessary. The script in question pulls this information from /sys/class/power_supply.

electrickite commented 3 years ago

Multiple battery support from PR #11 is included in v1.3.0