Closed jutkko closed 8 years ago
This fix won't work for future release of Sierra... You are doing a too restrictive test only for version "16.0.0"... Should test something like osrevision, but not sure it's a good idea either...
I changed the awk for the output ofpmset
in #32. As you mentioned, this will not work for only macOS Sierra. Could we not better just a regular expression to detect the percentage? Something like the following:
/([0-9]{0,3}%)/g
See example here. @hoop33 implemented this in #25
Yeah something like : pmset -g batt | grep -o "[0-9]*%"
might be working on both Sierra and previous version...
The new
if
condition should hopefully break the existing percentage script for other macOS versions other than macOS sierra.