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

Battery segment showing wrong percentange on MacOS #2139

Closed
1 task done
hferreira23 opened this issue Apr 23, 2022 · 5 comments
Closed
1 task done

Battery segment showing wrong percentange on MacOS #2139

hferreira23 opened this issue Apr 23, 2022 · 5 comments
Assignees
Labels
🐛 bug Something isn't working

Comments

@hferreira23
Copy link

Code of Conduct

  • I agree to follow this project's Code of Conduct

What happened?

I'm using the oh-my-posh on macOS Big Sur (Intel CPU) and the battery segment is reporting the wrong percentage.

pmset -g batt reports 96% and the segment reports 91%

Theme

Modified Bubblesline

What OS are you seeing the problem on?

macOS

Which shell are you using?

No response

Log output

The only relevant log I see using debug is this:

/04/24 00:53:12 BatteryInfo duration: 24.318434ms, args:
@hferreira23 hferreira23 added the 🐛 bug Something isn't working label Apr 23, 2022
JanDeDobbeleer added a commit that referenced this issue Apr 24, 2022
JanDeDobbeleer added a commit that referenced this issue Apr 24, 2022
JanDeDobbeleer added a commit that referenced this issue Apr 24, 2022
JanDeDobbeleer added a commit that referenced this issue Apr 24, 2022
@hferreira23
Copy link
Author

hferreira23 commented Apr 25, 2022

Wow, that was quick! The percentage issue is now fixed.

One small thing I found (I don't if its a bug or intended behavior), when the macOS holds the laptop charging at X% (and doesn't charge to 100% to save up battery cycles) the discharge icon and background color show up even though the laptop is not discharging the battery.

pmset -g batt reports:

Now drawing from 'AC Power'
 -InternalBattery-0 (id=xxxxxxxx)	80%; AC attached; not charging present: true

@JanDeDobbeleer
Copy link
Owner

JanDeDobbeleer commented Apr 25, 2022

@hferreira23 I treat that as discharging, but we can easily map that to something else as maybe not charging?

@hferreira23
Copy link
Author

@JanDeDobbeleer in this specific case the battery is neither charging or discharging so a separate state would be nice.

@JanDeDobbeleer
Copy link
Owner

@hferreira23 the AC attached state maps to NotCharging so you only need to adjust the logic in the config.

Copy link

github-actions bot commented Feb 5, 2024

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues.
If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants