From c5de52aef3c8abb6de21db5a630eba7ecba78324 Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Fri, 25 Mar 2016 10:13:16 -0500 Subject: [PATCH] Changing to output 100% for full battery on OS X. This commit ensures that `battery_percentage` has the same output on both Linux and OS X. Thanks @jfmcarreira for finding this! --- plugins/available/battery.plugin.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/available/battery.plugin.bash b/plugins/available/battery.plugin.bash index 826b9b15..85af5097 100644 --- a/plugins/available/battery.plugin.bash +++ b/plugins/available/battery.plugin.bash @@ -52,7 +52,7 @@ battery_percentage(){ local IOREG_OUTPUT=$(ioreg -n AppleSmartBattery -r | awk '$1~/Capacity/{c[$1]=$3} END{OFMT="%05.2f%%"; max=c["\"MaxCapacity\""]; print (max>0? 100*c["\"CurrentCapacity\""]/max: "?")}') case $IOREG_OUTPUT in 100*) - echo '99' + echo '100' ;; *) echo $IOREG_OUTPUT | head -c 2