Debian 9 Stretch on Macbook Pro save Screen brightness


Macbook resets to full brightness every reboot, instead of remembering brightness settting.


*OS: Debian 9 Stretch
*System: 2011 Macbook Pro, with Nvidia 320M
*Xorg.conf includes this line in the Device section:     Option         “RegistryDwords” “EnableBrightnessControl=1”
*The current backlight value is recorded in:  /sys/class/backlight/apple/backlight/brightness


During shutdown systemd should save the brightness setting in: /var/lib/systemd/backlight/
and load it during startup. This action can be done manually using the following command:

sudo /lib/systemd/systemd-backlight load backlight:apple_backlight
sudo /lib/systemd/systemd-backlight save backlight:apple_backlight

If the above commands work but the system does not restore brightness value during reboot then udev is not working correctly to identify or action the hardware/button presses. We can write our own systemd service unit to do the commands for us:

Description = Load/Save apple_backlight settings
Type = oneshot
ExecStart = /lib/systemd/systemd-backlight load backlight:apple_backlight
ExecStop  = /lib/systemd/systemd-backlight save backlight:apple_backlight

WantedBy =

Enable and start the new service:

systemctl enable my-monitor-brightness
systemctl start my-monitor-brightness