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
Fixed battery status in MacOS X. #476
Conversation
Tested & verified this fix works on Sierra 10.12.5 (16F73). |
Is this going to get merged? Looks good to me. |
👍 |
…/kubernetes-context
We have a ton of reviewers that supposedly have tested this patch on new versions of MacOS, but none that have tested on a version before the change to |
@Rycieos In what OS version was the behavior changed? Is it possible to add a conditional to change the behavior only for OS versions after the change? |
In this particular commit, though, it seems that anything that would match the old |
The change looks well made, and I think it would work correctly on older versions. I would like a test to make sure though. We don't know what version broke |
@Rycieos I've upgraded all my machines to High Sierra 10.13.3. |
I don't have any systems older than Sierra (10.12.x) available to test. @Rycieos, does that mean we're stuck here unless we find someone with an El Capitan machine? It's pretty frustrating to have all these broken 10.12 shell environments if that's all we're waiting for... |
I could probably test in a VM. 🤷🏻♂️ |
@augmentedfourth The situation we want to avoid is breaking environments for old MacOS X versions, and have someone be affected and make a bug report. That said, since we have so many vocal users about this issue, and since normal practice is to update MacOS, I would recommend merging this, and if it does somehow break old versions and someone is actually using an old version, we can cross that bridge then. |
👍🏻 |
I have tested this patch on MacOS version 10.9.5, and got the following output: |
Thanks @cmrnpref! I'm comfortable with merging this, since we have a test on an older version. We will need @dolmen to take a look at it and merge it. Based on how many people have tested this, I would recommend this patch to be merged. I do not think we should take parts from the other PR, since it does a lot more modifications and has only one tester. |
@Rycieos et al I think the comment I made in #536 also applies to this. according to the comments at line 1314 and to the expected behavior in the rest of the code, the
As it is now, if will return 1 when charging and below, and 2 when charging and above, as In other words, the function returns the same ( |
@cvigo I hadn't looked too deeply at it before, but now I can say that it looks like you are right. The refactoring done by commit 4636e0e seems to have introduced an off-by-one error that has the consequences you describe. I have only looked at the code and haven't done any testing yet. However, this issue is not limited to MacOS, since the same logic, and therefore the same error, is used for the Linux version. This should probably be reported as it's own issue/PR, since this issue+PR are solely about MacOS issues. |
Resolves liquidprompt#476 and partially addresses liquidprompt#481
@Rycieos Who can accept this pull request? I'm really looking forward to fixed battery status on my Mac. |
@augmentedfourth as I said previously, @dolmen is the sole maintainer on this project at the moment, so only he can merge pull requests. @dolmen, as this is a bugfix, and we have had numerous testers on this patch, I would recommend we merge this. |
@dolmen Can you please review/merge this? Lots of Mac users have been frustrated for a very long time with this. |
@dolmen Pinging yet again. Please merge... |
Merged on develop, thanks! |
This is now in master as fefbe01 and in v1.12-beta.1. |
Some time ago battery status under MacOS was broken due to changes in pmset output. In last MacOS X Sierra we have battery id an output of pmset looks like: