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!
pull/692/head
Travis Swicegood 2016-03-25 10:13:16 -05:00
parent 18beb7f5d3
commit c5de52aef3
1 changed files with 1 additions and 1 deletions

View File

@ -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