Open MegaManSec opened 1 month ago
Yeah, I can see similar backlight control on MacOS. Probably they control more carefully. I don't think it's possible to reproduce the same. Your idea looks reasonable for me.
The asmctl code is old and cluttered. I'm going to rewrite and implement your idea.
Yeah, I agree with you. I don't have a MacOS system to test, but I think they control it using the ambient light detected from the macbook as well -- e.g. if the room is really bright and you disconnect the power adapter, it won't lower the brightness so you can't even see the screen.
I think it's not possible for asmctl to reliably reproduce this; I can't even seem to retrieve the ambient light :
$ sysctl -ad dev.asmc.0.temp.ALSL
dev.asmc.0.temp.ALSL: Ambient Light
$ sysctl -a dev.asmc.0.temp.ALSL
dev.asmc.0.temp.ALSL: 0
But any improvements, I'm grateful for:)
I implemented the backlight control policy on an ACPI event. Could you test the master branch?
seems to work for me
Thanks for testing. I'll implement adjustments depending on the ambient light if a nice idea comes to my mind.
At the moment, if you are using battery and your
backlight_current_level=76
andbacklight_economy_level=76
andbacklight_full_level=40
, and you plug in the ac adapter, your current brightness will be changed to 40 -- lower than what it is currently without the adapter.My suggestion is:
asmctl [video|key] acpi
is used andhw.acpi.acline=1
.asmctl [video|key] acpi
is used andhw.acpi.acline=0
.In both cases it should just set the correct economy/full level to the current level.