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

Possible bug when decreasing brightness level #66

Closed
ZOulhadj opened this issue Apr 19, 2021 · 2 comments
Closed

Possible bug when decreasing brightness level #66

ZOulhadj opened this issue Apr 19, 2021 · 2 comments

Comments

@ZOulhadj
Copy link

ZOulhadj commented Apr 19, 2021

I am using Sway + Waybar and I have setup my brightness key bindings as follows:

bindsym XF86MonBrightnessDown exec "brightnessctl set 5%-"
bindsym XF86MonBrightnessUp exec "brightnessctl set +5%"

The issue is when starting at a brightness level of 0% and going up it increases by 5% as expected. However, when going from 100% down, it initially goes down to 94% which not is not right as that it a decreased of 6%. What is weird is that after the first decrease it goes returns to normal decreasing by 5%.

So 100%, 94%??, 89% and so on....

@ZOulhadj ZOulhadj changed the title Possible bug when decreasing brightness level by 5% Possible bug when decreasing brightness level Apr 19, 2021
@trygveaa
Copy link

This is an issue with waybar, not brightnessctl as far as I can see. On my machine the max brightness is 19393. 5% of that is 969.65, and when the backlight is on max brightness and I reduce it by 5% with brightnessctl, it rounds 969.65 to 970 (since it can't set fractions) and sets it to 18423. 18423 divided by 19393 is 0.94998195225081214871, which apparently waybar shows at 94%.

So the issue is that waybar truncates/rounds down the percentage fraction, instead of rounding it to the nearest whole number.

@ZOulhadj
Copy link
Author

Can confirm that I see this issue with other programs such as PulseAudio. Does seem to look like a Waybar issue. I will open an issue with them. Thank you for confirming.

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

No branches or pull requests

3 participants