LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How do I stop the screen brightness being set at DIFFERENT time-points during the boot on Debian 9? (https://www.linuxquestions.org/questions/linux-general-1/how-do-i-stop-the-screen-brightness-being-set-at-different-time-points-during-the-boot-on-debian-9-a-4175717892/)

winger9 10-18-2022 03:55 PM

How do I stop the screen brightness being set at DIFFERENT time-points during the boot on Debian 9?
 
1. On my Acer laptop, on Debian 9, out of the box, the screen brightness is set
during the boot - you can see the screen dim.

Well, during SOME boots the brightness is set EARLY in the boot process, before
X is started; but during other boots, it is set about 10 seconds later, after X
and lxpanel are fully up and running.

2. My Questions:

a) How can I make the dimming occur consistently EARLY in the boot?
b) What is causing the brightness to be set at DIFFERENT times?
c) My system is systemd. What controls WHEN processes and actions are performed
at boot, and where in my filesystem do I look to find the thing that is setting
the screen brightness?

3. To help you fathom things out, it might help to say that after the boot, I
can MANUALLY set the screen brightness with the following command:

Code:

$ sudo sh -c "echo 400 > /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-
LVDS-1/intel_backlight/brightness"

where the "400" can be a value from 0 to 976.

GazL 10-20-2022 05:54 PM

I can't speak for what debian/systemd does as I have little experience with it, but on my systems I use a custom udev rules file to set the backlight value very early during boot when the blacklight device is detected by udev.

/etc/udev/rules.d/81-backlight.rules:
Code:

# Set the initial backlight level.

SUBSYSTEM!="backlight", GOTO="backlight_end"
ACTION!="add", GOTO="backlight_end"

# Don't use the intel_backlight if the acpi backlight control is present:
TEST=="/sys/class/backlight/acpi_video0/brightness", GOTO="backlight_acpi"

KERNEL=="intel_backlight", ATTR{brightness}="364"

LABEL="backlight_acpi"
SUBSYSTEM=="backlight", KERNEL=="acpi_video0", ATTR{brightness}="39"

LABEL="backlight_end"

You might want to also grep for 'backlight' in /lib/udev/rules.d/* (or whatever location debian puts those files) just to see if there's anything similar already in there for the backlight.

Other than that, an xbacklight command may be being executed as part of the X11/DisplayManager startup scripts, but that's likely distro specific, so again, I'm not best placed to help you track that one down.

Hopefully, that gives you some starting points for your search, until someone with a debian background can offer more specific advice.


All times are GMT -5. The time now is 01:41 PM.