Backlighting on Ubuntu 20.04 with an Dell XPS

When I installed Ubuntu on my current machine, Dell XPS15 2020, I could not control the amount of backlight on my screen with the keyboard shortcuts. For a while I was using Xorg still, and xrandr worked fine. Since this weekend I’m trying Wayland again, so xrandr wasn’t an option anymore. Time to debug!

Running ls -al /sys/class/backlight/ I noticed there were multiple entries symlinked, while I expected one. There was both a dell_backlight and intell_backlight. Following the former, I noticed that pressing the hotkeys to change the brightness changed the dell_backlight/brightness file contents.

It seems the kernel was prioritizing the dell backlight over the intel one, which I hoped would be fixed by adding acpi_backlight=intel as kernel parameter to /etc/default/grub and executing update-grub. But, it didn’t. What I did notice is that the dell_backlight directory symlink was gone from /sys/class/backlight.

Browsing some more there were more Kernel params to try:

  • acpi_backlight=video
  • acpi_backlight=vendor
  • acpi_backlight=native
  • acpi_backlight=none
  • video.use_native_backlight=1

None of these worked, and I was on the wrong track.

Actual fix

After a series of reboots, and back to square 1 I ran: sudo -i && echo 1000 > /sys/class/backlight/intell_backlight/brightness which did change the value in the file, but didn’t change the brigntness. That gave me new ideas to try, and after a while I found a repository with a python script at github.com/idifuchs/icc-brightness. Running it had effect, changing the intel_backlight/brightness value changed the actual screen brightness. Given it was fairy late already in my day, for now I don’t know what this code does, and why it didn’t work out of the box for Ubuntu. That’s for another day to figure out.