ErikReider / SwayNotificationCenter

A simple GTK based notification daemon for SwayWM
GNU General Public License v3.0
1.3k stars 62 forks source link

Use rounding to prevent incorrect backlight percentage calculation #236

Closed Mirei124 closed 1 year ago

Mirei124 commented 1 year ago

Suppose the brightness of screen is 15%, correspondingly the value of /sys/class/backlight/amdgpu_bl0/brightness is 38, and max_brightness is 255, 38/255 = 0.149, but the output of the calc_percent function is 14, causing the screen brightness will be decreased by 1% when open panel every time.

ErikReider commented 1 year ago

I'll try to get to this tonight. If not, ping me :)