Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to set the default display brightness so you don't have to re-adjust it everytime you reboot? My laptop display is killing my eyes at the login screen already because it starts at 100% brightness every time.

share|improve this question
possible duplicate of How to make GNOME remember brightness setting – Jorge Castro Oct 15 '11 at 11:32
Try this… – Afshin Hamedi Jul 6 '14 at 21:30
@jeremy why don't you accept the ans as my answer seems to be a valid one – Tummala Dhanvi Dec 15 '14 at 19:25
@Jeremy Can you mark one of the answers as accepted? It's good for your profile stats, too. – Stéphane Gourichon Apr 1 at 17:44

Review of solutions and offering a (hopefully) better one

Previous solutions

/sys/-based : good for console


This works echo 5 > /sys/class/backlight/acpi_video0/brightness but does not play well with X. More specifically, X is not aware about your preferred settings and you may end up needing to set the brightness manually again at least once, similar to bug #1042359 .

setpci-based : system-dependent, dangerous


Solutions based on things like setpci -s 01:00.0 F4.B=50 are dangerous. There, 01:00.0 is actually an ID targeting a particular board on the PCI bus. And it is system-dependent. That means blindly following this may write configuration registers on some other boards where it may mean anything, from just nothing to crashing the system at some point in the future. Anyway it does not play well with X either.

Proposed solution


The solution below has these advantages:

  • plays nice with X which is fully aware of the settings chosen
  • is more readable, thus maintainable
  • does not contain system-specific address, etc, and as a result may work on a wider range of hardware (e.g. where kernel does not know about backlight, or that don't even use PCI-based video board, think Ubuntu for ARM )

It assumes: Ubuntu using lightdm (that is 11.10 and beyond)

It only sets backlight when lightdm starts. But it can be combined with the /sys-based solution above if you really need to set backlight earlier.

The solution

Copy-paste of this should do what you need (sudo will probably ask your password).

# Install xbacklight in case it is not already installed (small).
sudo apt-get install xbacklight
# You should test xbacklight with command-line to see if it works. For example:
# xbacklight = 100 ; sleep 2 ; xbacklight = 30
# Try to figure out a suitable value for your hardware and lighting conditions.

# This creates a small script running xbacklight.
# You can change the =30 into another value if you wish. 
# The "|| true" ensures that if xbacklight fails for any reason, X can still start.
sudo bash -c '{
echo "#!/bin/bash"
echo "xbacklight =30 || true"
} >> /etc/lightdm/ '

# This makes that script executable
sudo chmod a+rx /etc/lightdm/

# This instructs lightdm to run the script when starting X.
# Specifically, it adds a line display-setup-script in a lightdm configuration file/, but only if there is not one already.
if grep -ri ^display-setup-script /etc/lightdm/
  echo "There may be already a display-setup-script. It may already do what you need. Else please adjust manually" ; 
  if [[ -d /etc/lightdm/lightdm.conf.d ]]
    # Ubuntu 13.10 and above have lightdm.conf.d. 14.04 *only* have lightdm.conf.d
    # Ubuntu 12.04, 12.10, 14.10 do not have lightdm.conf.d, we change main configuration file
  echo "Writing into $DESTCONFFILE"
  sudo bash -c "{ echo '[SeatDefaults]' ; echo display-setup-script=/etc/lightdm/ ; } >>$DESTCONFFILE" ; 

May be tested by restarting lightdm from a root session on the console. Or, more simply, by rebooting.

Tested on Ubuntu 12.04, 12.10, 13.10, 14.04, 14.10.

Please provide feedback about your experience.

share|improve this answer
On a freshly installed Ubuntu 12.10, copy-paste of the lines above just works. – Stéphane Gourichon Jan 2 '13 at 15:38
Works for me too. – Pawelmhm Sep 21 '13 at 11:01
On a freshly installed Xubuntu 13.10, copy-paste of the lines above just works. – Stéphane Gourichon Nov 7 '13 at 5:41
Adjusted just now for Ubuntu 14.04, tested, works. If xbacklight fails, does not prevent X from starting. – Stéphane Gourichon Jul 6 '14 at 21:46
Works on 14.10. (Strangely enough, Ubuntu 14.10 reverts to having /etc/lightdm/lightdm.conf but not /etc/lightdm/lightdm.conf.d. This solution still works anyway.) – Stéphane Gourichon Aug 13 '15 at 9:45


actually echoing some value to doesn't help in the brightness as the value will differ from system to system

first what you need to do is to set the brightness of the screen to the level comfortable to you, which can be easily done by in system settings --> brightness and lock or by using the function keys.

now go to the /sys/class/backlight/your_folder (mine was intel_backlight)

screen shot of the folder

in this folder you can see hte actual_brightness file and the max_brightness file (don't forget to refresh the files Ctrl+R or F5 to see the actual settings if you have done any changes to the brightness after opening this file)

Now we need the same value as in the brightness every time we start our system this can be done by changing every time the value in this folder at the startup we need to change the rc.local file

first type this command in the terminal (can be opened by searching for terminal in the dash or by pressing the shortcut Ctrl+Alt+T)

sudo -i
gedit /etc/rc.local

and make sure that you add the line

echo 900 > /sys/class/backlight/intel_backlight/brightness

Please replace the 900 value with what ever value you need (the value you get when see in the above procedure also the intel_backlight with what ever the folder name in the backlight folder)

screen shot of the gedit

the line rfkill block bluetooth was added in my rc.local file as I don't use bluetooth at all but ubuntu starts bluetooth everytime it reboots(even if the bluetooth was in off condition before), to avoid such thing I have used it. You can also add it (in case you wanted to use bluetooth you can always start it again even if this line is include in you rc.local)

Don't change the value of exit 0 in the ending if it doesn't exist just add it in the ending

Now even if you have restarted the system you will have the same value that you need (the value that you have given after the echo)

Be-careful don't give the value of brightness greater that max_brightness value as that will through you an error saying that it is an Invalid argument.

share|improve this answer
Thanks dhanvi. This not only solve brightness problem but bluetooth as well. – VRR Apr 4 '15 at 13:34
the rfkill block bluetooth i have added it to the this file as i don't want to on my Bluetooth every time i started a system hope this too helped you :) – Tummala Dhanvi Apr 5 '15 at 14:05
This is an excellent post. Thanks for sharing this method! I'd already used this to stop bluetooth starting up every time - and can confirm it works. – BubbleMonster Aug 20 '15 at 21:29

It isn't default. Whenever I reboot my brightness is set to 100%. Luckily I saw

$ echo 5 > /sys/class/backlight/acpi_video0/brightness

and before that,

$ chmod o+w /sys/class/backlight/acpi_video0/brightness
share|improve this answer
Changing the permission of /sys is a very bad approach as /sys is actually a virtual FS provided by kernel itself, changing permission of /sys has various security implications. Use sudo to write to the file if needed.. – heemayl Aug 19 '15 at 20:43

this works in my 12.04 How set brightness on startup – Ubuntu 12.04

every time i boot up, it is set already. hope it will help you.

share|improve this answer

This should do the trick:

System settings -> Screen -> Brightness

Use the slider to adjust default setting.

enter image description here

share|improve this answer
Doesn't "stick" for reboots, at least for me on Precise (12.04) for an HP Envy Ultrabook – hobs Aug 11 '12 at 18:14
Same with Acer Aspire One – Martin Delille Nov 11 '14 at 13:40

Have you look at redshift? It's designed for another purpose (make the screen less bluish at night), but it might solve your problem as well.

To install:

sudo apt-get install redshift

My configuration file (~/.config/redshift.conf):



If you change brightness-day and brightness-night to a value you like and set temp-day and temp-night to the same value, you will effectively use redshift to set your brightness only.

To make redshift autostart at login, select Applications/System tools/Preferences/Startup applications/Add. Name: redshift. Command: /usr/bin/redshift.

share|improve this answer
Not sure what you mean. redshift changes the color temperature of the screen and it may also change its brightness. – Niclas Börlin Aug 25 '15 at 5:57
brightness doesn't work as you think see this and known bugs and limitations – Tummala Dhanvi Aug 27 '15 at 6:34
Redshift has a brightness adjustment setting, but it does not work the way most people might expect. In fact it is a fake brightness adjustment obtained by manipulating the gamma ramps, which means that it does not reduce the backlight of the screen. Preferable only use it if your normal backlight adjustment is too coarse-grained. – Tummala Dhanvi Aug 27 '15 at 6:34

protected by Community Feb 13 '12 at 12:24

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.