-
-
Notifications
You must be signed in to change notification settings - Fork 696
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 widget, "wrong" value on low battery notification #4876
Labels
Comments
Can you send a patch? |
I'm afraid I don't know how to do that. I haven't used github for this kind of things yet. If you point me in the right direction I can give it a try |
fjpavon
pushed a commit
to fjpavon/qtile
that referenced
this issue
Jun 20, 2024
- Replace the 'percent' variable in the notification string with 'status.percent' - Format the variable as % in the string This should fix qtile#4876
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue description
For the Battery widget, the value shown in the low level notification differs (by 1%) from the one shown in the widget itself.
This is not a bug per se, but something that is slightly annoying and should be fairly easy to solve.
After looking at the code, I think this is caused by the way the percentage is printed on the notification and on the widget. i.e.
percent = int(status.percent * 100)
is what goes to the notification, while something like'{percent:2.0%}'.format(percent=status.percent)
is what goes to the widget.One method always rounds down while the other rounds up and down.
I think this could be solved by changing one line in the poll function of the Battery class:
should change to:
Version
0.26.0
Backend
Wayland (experimental)
Config
Logs
Required
The text was updated successfully, but these errors were encountered: