Commit 12415a99 authored by Robby Russell's avatar Robby Russell
Browse files

Merge pull request #2539 from chriswiggins/master

Update battery plugin to show calculating - OSX
parents dcae31d0 fdd864bd
......@@ -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"\ =\ //')
if [ $timeremaining -gt 720 ] ; then
echo "::"
else
echo "~$((timeremaining / 60)):$((timeremaining % 60))"
fi
else
echo "∞"
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment