Brightness is reset to maximum on every restart
You could try adding a line to /etc/rc.local that will set the desired brightness level. To edit the file, run
sudo -H gedit /etc/rc.local
and add the following
echo X > /sys/class/backlight/intel_backlight/brightness
so that the end result looks like this
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
echo X > /sys/class/backlight/intel_backlight/brightness
exit 0
Substitute X
by the desired brightness level.
In case /etc/rc.local doesn't exist, as is the case with new Ubuntu releases, you'll need to create it, and make eecutable with the following commands:
printf '%s\n' '#!/bin/bash' 'exit 0' | sudo tee -a /etc/rc.local
sudo chmod +x /etc/rc.local
PS: Alternatively, there may be /sys/class/backlight/acpi_video0/brightness
instead of the above. Brightness levels vary wildly, and may range from 0 to 10 or to 1000. To find the maximum value, try
cat /sys/class/backlight/acpi_video0/max_brightness
or
cat /sys/class/backlight/intel_backlight/max_brightness
I converted my small script for saving and restoring backlight (brightness) level to Ubuntu package. It is located in my PPA and named sysvinit-backlight
.
It contains sysvinit init-script, placed in /etc/init.d/sysvinit-backlight
.
It is compatible with Ubuntu 12.04 LTS and 14.04 LTS.
For newer versions of Ubuntu my PPA is not needed as they use builtin systemd-backlight service.
You can install my script with the following commands:
sudo add-apt-repository ppa:nrbrtx/sysvinit-backlight
sudo apt-get update
sudo apt-get install sysvinit-backlight
You can remove it by
sudo apt-get purge sysvinit-backlight
Please note: if you have installed the previous version of my script, please remove it by
sudo rm /etc/rc?.d/?25backlight /etc/init.d/brightness /etc/rc?.d/?25brightness
The script functionality is:
- save backlight (brightness) levels of all video adapters and keyboard on reboot and shutdown (runlevel 0 and 6)
- load backlight (brightness) levels for all video adapters and keyboard on boot (runlevels S, 1, 2, 3, 4 and 5)
The script options are:
sudo service sysvinit-backlight status
(show current brightness levels and saved in files values)sudo service sysvinit-backlight start
(set saved levels from files)sudo service sysvinit-backlight stop
(save current levels to files)
You can contact me here or on launchpad.
Easiest way:
Open a terminal window.
Type in the following command then hit Enter after it.
sudo apt-get install xbacklight
Open the Startup Applications Preferences menu.
Click the Add button and add the following information:
- Name: Brightness
- Command:
xbacklight -set 60
Replace 60 with whatever brightness level you prefer.
Source: Set Startup Display Brightness