3 ms·
> for me that tool could only ever fake it by changing the pixels rather than the backlight (on every piece of hardware I have tried) I'm curious - I've done i
by ColanR 7y ago
> for me that tool could only ever fake it by changing the pixels rather than the backlight (on every piece of hardware I have tried)
I'm curious - I've done it both ways, scripting /sys/class and using xbacklight. On my X230 I used xbacklight, and it seemed to work fine. How would I tell if it wasn't changing the backlight itself? I'd rather use /sys/class to get it right.
Also, here's my /sys/class code - not sure where I got it, but I probably adapted something I found. I assume it works, but it's been commented out above the xbacklight version for some time. :)
bindsym XF86MonBrightnessDown exec bctl="/sys/class/backlight/intel_backlight/brightness" && echo $((`cat $bctl`-68)) | tee $bctl
bindsym XF86MonBrightnessUp exec bctl="/sys/class/backlight/intel_backlight/brightness" && echo $((`cat $bctl`+68)) | tee $bctl
- tomxor 7y ago> How would I tell if it wasn't changing the backlight itself? With the exception of OLED (no idea if laptops use that stuff yet), when the LCD is fully opaque on i.e rgb 0,0,0 the backlight LED will still bleed through - Modern LCDs are much better at blocking out the LED than they used to be so it's not always obvious in a well lit room. If you reduce the brightness to 0 with xbacklight and then sleep the computer: The display will perceptibly dimm much further as it turns off (since this guarantees the back-light is turned off). If you use sys/class method it's possible to turn the backlight completely off so that there is no perceptible difference when you sleep/poweroff the computer. On the older LCD panels when poor contrast ratios were common it's very obvious that xbacklight is only affecting pixels. I've never seen this tool affect the actual backlight but maybe it does have that mode? Your script is essentially using the same method although in theory it's not as portable since the path is exact and it uses a hardcoded interval, you may have to tweak both for different machines. My one uses bash path expansion that is more likely to match other path names, and derives the interval from the max value... I honestly haven't looked at the variety of possible paths for /sys/class/backlight and max values so maybe I was over anticipating when i wrote this.
- ColanR 7y agoInteresting. Thanks for the explanation. And I agree, my script isn't that flexible. I believe that " | tee" was left in there from when I tried to skip the sudoers entry...it's definitely not pretty.