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

Add fallback for charge calculation when capacity sysfs is missing #446

Merged
merged 3 commits into from
Feb 12, 2025

Conversation

peterdk
Copy link
Contributor

@peterdk peterdk commented Feb 12, 2025

On my Dell XPS 13 9345 Snapdragon X, the capacity sysfs file is empty. So Resources doesn't show the charge.
However, Gnome does show proper charge. That charge can be calculated properly from energy_now/energy_full. So this PR adds logic for that.

My battery doesn't show up in Resources at all by the way, cause the path is /power_supply/qcom-battmgr-bat, but that's for another PR.

This is my first PR on a Rust project, so let me know if there are things missing or whatsoever.

@peterdk
Copy link
Contributor Author

peterdk commented Feb 12, 2025

Screenshot From 2025-02-12 14-49-11

@peterdk
Copy link
Contributor Author

peterdk commented Feb 12, 2025

Energy usage also fails, but that is yet another PR.

@nokyan
Copy link
Owner

nokyan commented Feb 12, 2025

Hi, thank you very much for your PR and congrats for your first Rust-related PR!
From what I can see it looks good, I'll give it a spin later today. :)

@nokyan nokyan merged commit e3c9740 into nokyan:main Feb 12, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants