tmux-plugins / tmux-battery

Plug and play battery percentage and icon indicator for Tmux.
MIT License
503 stars 98 forks source link

This hopefully fixes the percentage not showing on macOS sierra problem #34

Closed jutkko closed 8 years ago

jutkko commented 8 years ago

The new if condition should hopefully break the existing percentage script for other macOS versions other than macOS sierra.

jbleuzen commented 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...

martinbeentjes commented 8 years ago

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

jbleuzen commented 8 years ago

Yeah something like : pmset -g batt | grep -o "[0-9]*%" might be working on both Sierra and previous version...