Closed JanAhrens closed 9 years ago
I decided to add my changes to battery_icon.sh
to this pull-request, because they concern the same feature: multi battery support for upower
. If you like to discuss this in seperate pull-requests I'm happy to create those.
Thanks, this is a nice feature and the code is not that complex at all.
I've added you to the list of contributors in the readme.
My laptop has two batteries: One exchangeable and a built-in one. The exchangeable battery will unload before the internal. Unfortunately
BAT0
is the internal battery andBAT1
is the external one. Without this patch,battery_percentage.sh
displays 100% until the exchangeable battery ran out of power.I'm suggesting to display all batteries that
upower
knows about. With this patch all batteries percentage levels will be displayed with a seperating space: "14% 85%".If there is only one battery, the behavior of this script does not change. The for-loop will yield exactly one line and
xargs echo
won't change it.I tested this on my system by pretending what would happen if it had only one battery.
This is how the
upower -e
output looks on my machine: