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
  • 70,711
  • This did not change a thing. The screen brightness on startup is still full. Now I think my only option is to setup a script to turn down the brightness so that it runs on every startup. – Vin Raghav Apr 09 '22 at 03:05
  • @VinRaghav See Update #1 in my answer. It's a .service that I run on my system to set brightness to 80. Minor customization will be required. – heynnema Apr 09 '22 at 12:13
  • @heynnema The update is vague. Doesn't explain what's happening. – Vin Raghav Apr 18 '22 at 11:56
  • @VinRaghav It's a .service that sets the brightness level to a desired level. I set it to 80 (where mine can go from 1 to 100), your setting might be different. Two parts... a .service file and the .sh script. You just have to tailor it to your specific system... like the path with dell_uart_backlight is not right for your system. – heynnema Apr 18 '22 at 14:32
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).