Re:Ask HN: Should I unplug my laptop charger at 100%?
by jffry on Monday May 04, 2015 @04:52PM
(#9489118)
running
gives me
I'm guessing MaxCapacity or CurrentCapacity (I'm at 100% charged on a ~1 year old MBP, so I don't know which number is appropriate)
[ Parent
| on HN ]
Re:Ask HN: Should I unplug my laptop charger at 100%?
by ChristianBundy on Tuesday May 05, 2015 @12:04AM
(#9490791)
Your battery percentage is going to be:
100 / DesignCapacity * MaxCapacity
Or, in the way that makes way more sense to me: MaxCapacity / DesignCapacity * 100
Which, with your results, yields something to the effect of: 98.68%
It's kind of (read: very) dirty looking, but you can get the same result with: echo $(ioreg -l -n AppleSmartBattery -r | grep MaxCapacity | awk '{print $3}') / $(ioreg -l -n AppleSmartBattery -r | grep DesignCapacity | awk '{print $3}') \* 100 | bc -l