You are not logged in.

#1 2020-02-20 22:32:00

scippie
Member
Registered: 2019-06-07
Posts: 138

How to take control over backlight turning on/off on screen lid?

To make my laptop lock when the lid closes, I followed the procedure described on https://wiki.archlinux.org/index.php/Po … CPI_events.
I changed HandleLidSwitch to lock and made sure that xss-lock goes to my script that uses i3lock to lock the laptop.

My laptop has an OLED screen and when the lid is closed, X (or whomever is responsible for that) isn't able to turn of my screen as an OLED screen doesn't have a backlight to turn off.
That's also the reason why I can't use xbacklight to control brightness and have created my own script that uses xrandr to change the brightness of the screen.
Lowering the brightness on an OLED screen has the same power-saving advantage (you can actually see that in the power usage statistics) and I guess it is also better for screen lifetime.

So I was thinking: if I adapt my script so that it changes the brightness to 0.0 before locking when the lid is closed, that would be the same.
But then, there doesn't seem to be an event for when the lid opens to change it back to the previous value.
And even if there were, the locked state might even prevent me from executing anything...

So, I wondered: is there a way to override what X (or whomever is...) does when the lid is closed/opened with a custom script/command so that instead of turning off/on the backlight, I can just set xrandr brightness to 0/previous value?
Or is there another way?

Offline

Board footer

Powered by FluxBB