3

After every reboot, my laptop, on startup is on with 100% brightness. I have to manually turn it down using the function keys everytime. Generally, the default start-up brightness used to be around 20% which too I had used to turn down, but now after a recent update it has reached to 100% on its own.

My other laptop running the same version is still at 20% default start-up brightness. I know there can be user made scripts that will automatically turn down the brightness for me on each start-up. But I want to do this natively and permanently from system settings or something.

I'm running Ubuntu 20.04 on Dell 5559 laptop.

2 Answers2

3

The problem is that there's a process that runs at boot, and also at shutdown, that tries to restore/save backlight settings. On some configurations the restore happens incorrectly, and can cause the brightness problem that you see. Here we will add a minor kernel option so that this process doesn't restore an invalid brightness setting.

man systemd-backlight

Rather than using the script that you found, (that I probably wrote), do this:

Edit /etc/default/grub:

sudo -H gedit /etc/default/grub

Locate the line that looks like:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

And change it to:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash systemd.restore_state=0"

sudo update-grub

Set your brightness to the desired level.

reboot

Update #1:

/etc/systemd/system$ more set_brightness.service

[Unit]
Description=Set screen brightness to work around bug

[Service] Type=oneshot ExecStart=/bin/sh /etc/rc.local/set_brightness.sh

[Install] WantedBy=multi-user.target

/etc/systemd/system$ more /etc/rc.local/set_brightness.sh

#!/bin/sh

Set specific brightness level to work around bug

See /etc/systemd/system/set_brightness.service

sleep 15; echo 80 | tee /sys/class/backlight/dell_uart_backlight/brightness

heynnema
  • 73,649
3

In my case on Ideapad Gaming 3 it was also broken, but I found that /sys/class/backlight/acpi_video1/brightness has the correct value after a reboot, in the 0-50 range, while /sys/class/backlight/amdgpu_bl0/brightness has a range of 0-255.

So I wrote a small .deb, which you can find in the Releases section of my GitHub repository, for restoring and fixing the issue by using the correct ratio at startup. You can customize the installed service for different paths and ratio (see the description for details).