diff options
author | Robby Russell <robby@planetargon.com> | 2014-03-16 18:49:07 -0700 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2014-03-16 18:49:07 -0700 |
commit | 12415a99d25beee8957fb93a49390901e3e134b2 (patch) | |
tree | 875f90102c29677f10682aa2f437a44502ab6dee | |
parent | dcae31d0710fe04773d9c6fe3b64937a0458cccb (diff) | |
parent | fdd864bd5b5444848c492454e025257f3c4fa675 (diff) | |
download | zsh-12415a99d25beee8957fb93a49390901e3e134b2.tar.gz zsh-12415a99d25beee8957fb93a49390901e3e134b2.tar.bz2 zsh-12415a99d25beee8957fb93a49390901e3e134b2.zip |
Merge pull request #2539 from chriswiggins/master
Update battery plugin to show calculating - OSX
-rw-r--r-- | plugins/battery/battery.plugin.zsh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh index ae2261ecd..b16a75c5b 100644 --- a/plugins/battery/battery.plugin.zsh +++ b/plugins/battery/battery.plugin.zsh @@ -34,7 +34,11 @@ if [[ $(uname) == "Darwin" ]] ; then local smart_battery_status="$(ioreg -rc "AppleSmartBattery")" if [[ $(echo $smart_battery_status | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then timeremaining=$(echo $smart_battery_status | grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //') - echo "~$((timeremaining / 60)):$((timeremaining % 60))" + if [ $timeremaining -gt 720 ] ; then + echo "::" + else + echo "~$((timeremaining / 60)):$((timeremaining % 60))" + fi else echo "∞" fi |