Published on Jun 24, 2018
in category programming
In this post I will describe the steps I had to follow to be able to change the brightness on my iMac using the related keyboard function keys.
After installing Debian 9.4 (stretch) or Ubuntu 18.04 LTS on my iMac, I was no longer able to control the brightness from the keyboard (
F2 keys). When pressing these keys, although a notification was shown for increasing/decreasing it, the brightness was not changing.
In my case, I had two entries for the backlight class in my system.
$ ls /sys/class/backlight/ acpi_video0 radeon_bl0
The keyboard keys were affecting the brightness value stored in the file
brightness located in the
I tried to change the brightness level manually in the
brightness file located in the second directory, the one named
radeon_bl0 and the iMac’s brightness did actually change.
echo 190 | sudo tee /sys/class/backlight/radeon_bl0/brightness
So, all I had to do was to set my grub configuration to pass the
vendor value in the
acpi_backlight kernel parameter upon boot so that the vendor specific driver (in my case
Radeon) is preferred instead of the default
I edited the grub configuration file with vim:
sudo vim /etc/default/grub
In the line starting with
GRUB_CMDLINE_LINUX_DEFAULT I appended the desired kernel parameter
Finally, I had to update grub to produce the actual configuration file being loaded at boot.
After rebooting, I was able to manage the brightness with the brightness function keys.
In addition, the
/sys/class/backlight directory now lists only one directory, the vendor’s one
The steps described in this post, have been tested on my system with:
and I can’t know if they are valid for other cases. Follow them at your own risk :)
To find your iMac model, use:
sudo dmidecode | grep -A 9 "System Information"
and your VGA compatible controller:
lspci | grep "VGA compatible controller"
That’s all, cat photo: