Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated method of getting battery stats on mac to work properly. #490

Closed

Conversation

dogeared
Copy link

@dogeared dogeared commented Nov 21, 2016

Fixes #489

@@ -1299,7 +1299,8 @@ case "$LP_OS" in
{
(( LP_ENABLE_BATT )) || return 4
local percent batt_status
eval "$(pmset -g batt | sed -n 's/^ -InternalBattery[^ ]*[ ]\([0-9]*[0-9]\)%; \([^;]*\).*$/percent=\1 batt_status='\'\\2\'/p)"
read percent batt_status <<< $(echo $(pmset -g batt) | awk -F'[;\t %]' '{print $7, $10}')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awk is forbidden (too slow).

@dolmen dolmen added battery Related to battery data or display MacOS X Related to MacOS X specific implementation labels Nov 27, 2016
@dolmen
Copy link
Collaborator

dolmen commented Nov 27, 2016

Could you test the patch proposed in #476?

@dogeared
Copy link
Author

@dolmen - I will look. Thanks.

@dogeared
Copy link
Author

@dolmen - #476 works on my machine. I will close this PR. Please merge 476! ;) Thanks to you and @thrushcat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
battery Related to battery data or display MacOS X Related to MacOS X specific implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants