Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My system specifications are: Ubuntu 12.04, 64-bit, Acer Aspire One D270, Intel Atom CPU

The usual brightness increase/decrease key combination using Fn key doesn't work in Ubuntu as many pointed out.

I had found two solutions on this forum to set the screen brightness.

One was to make the usual key combination work answer is given here:

Is there a way to set a hotkey to change screen brightness?

and the other is using the command

sudo setpci -s "00:02.0" F4.B=20

where the 20 is a hexadecimal number representing brightness.

It's only the latter that worked in my case.

I observe that the original brightness setting is restored after resumption from sleep mode.

All I want is to keep my brightness setting permanent. How do I do that?

Try 1: Tried Alok's suggestion. It just sits there as a startup application. Doesn't figure as an icon on the topbar of the screen, like the dropbox icon (my dropbox account it is linked to ubuntu) so that I can conveniently change the brightness.

Try 2: Also I must add, that the method System Settings -> Additional Drivers gives an empty list. In my earlier install (which I had to overwrite-reinstall :-(), the list had (I think) Intel Cedarview Graphics Driver. So must I install before trying the methods in any of the answers below?

Update: I read somewhere Intel CedarView is only for 32-bit OS!

Try 3: Just tried the quiet_splash etc that I had to add to /etc/default/grub, even read the thread given in one of the answers below!

Temporarily settled myself with this method:

  • Pasted the setpci brightness command in a bash file brightness.sh
  • Created a .desktop file for the command bash brightness.sh
  • Made it an executable file.

    Try 4a: I created an environment variable BRI ensured using env it's there in the list, and tried using it, here's the bash file brightness.sh

    #!/bin/bash
    echo "Set Brightness (Values 00-FF): "
    read s
    sudo setpci -s "00:02.0" F4.B=$s
    export BRI=s
    

    However I have to give the administrative password, and have yet not succeeded in making it a permanent setting and am working on these aspects!

    Try 4b: I even tried (in vain)

  • pasting the export BRI into /etc/default/grub and /etc/grub.conf
  • appending the same to ~/.bashrc and to /etc/bash.bashrc through the shell script brightness.sh that I made

    as I in each case restart and find BRI to still have its old value, and not the one given by executing brightness.sh via the launcher!

  • share|improve this question
        
    Well, it does work - on my laptop (Thinkpad). What laptop are you using? –  January Oct 1 '12 at 5:39
        
    I use Acer Aspire One –  Host-website-on-iPage Oct 1 '12 at 5:41
        
    Alok's suggestion worked for me, but the maximum value looks like 7 for my Sony VAIO. So my values are between 0 and 7. –  user147550 Apr 7 '13 at 17:48
        
    Can you add what model laptop it is to your question? –  Jorge Castro Jun 1 '13 at 14:18
        
    Does it happens also in Ubuntu 13.04? Try with a Live CD/USB. –  Leo Jun 3 '13 at 21:42

    8 Answers 8

    Possibly, the second solution posted in this thread applies to your laptop as well: passing the options acpi_osi=Linux acpi_backlight=vendor to grub. Try to edit the line starting with "GRUB_CMDLINE_LINUX" in the file /etc/default/grub to:

    GRUB_CMDLINE_LINUX="quiet splash acpi_osi=Linux acpi_backlight=vendor"
    

    and then run

    sudo update-grub
    

    Maybe this will help.

    share|improve this answer
        
    I found that the commands were executed free of errors, but to no avail :-( I looked up this thread askubuntu.com/questions/56155/… where it asks you to set backlight preferences in the folder /sys/class/backlight I find that this folder is empty. How do I get started adding stuff to this folder, in order to solve my issue? –  Host-website-on-iPage Oct 1 '12 at 13:15
        
    It seems as long as you have "acpi_backlight=vendor" in your /etc/default/grub file, ../backlight will gonna remain empty. try removing it if you have added it and then update-grub –  22lk94k943 only Jun 2 '13 at 13:55
        
    Tried that too! –  Host-website-on-iPage Jun 3 '13 at 11:25
        
    Thanks for your help! –  Host-website-on-iPage Jul 8 '13 at 13:51

    Optionally you can install XBACKLIGHT

    XBACKLIGHT Install xbacklight

    The review : "For those of you whos laptop starts up with the screen brighter than the surface of the sun, this one is it. You can easily set this terminal program to stop your eyes from being bleeched by your laptop's screen brightness. Download the app, then go to the system tab, which is the cog shaped thing in the top right corner of your screen. Go to startup applications, and then set the command line to "xbacklight -set 0" (or whatever percentage you want your backlight to snap to on start up) and obviously, remove the quotes from that command. Wallah, that should straighten all of those pesky backlight problems out. Tell your friends, because this one is a keeper"

    Edit: The following solution seems to work for some Acer Computers.

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux i915.i915_enable_rc6=1"

    in /etc/default/grub (and then updating with sudo update-grub) [the first option enables hardware control of backlight, the second implements a workaround for Intel graphics]

    Source : http://ubuntuforums.org/showthread.php?t=1850190

    share|improve this answer
        
    I created a startup application, left the name and description fields empty, and wrote xbacklight -set 3 in the command field and restarted. But I'm not experiencing any change! I even executed this in the terminal trying numbers from -2 to 7 (see my desperation!) to see no change in the brightness! –  Host-website-on-iPage Jun 2 '13 at 3:16
        
    Have you tried -inc and -dec parameters ? –  22lk94k943 only Jun 2 '13 at 8:22
        
    I have updated my answer. –  22lk94k943 only Jun 2 '13 at 11:35
        
    I tried xbacklight -dec 20 and xbacklight -inc 20 to find it had no bearing on the screen brightness! I tried xbacklight -get too, nothing showed up :-( The command xbacklight continues to be inert. Need to restart system after sudo gedit-ing and sudo updating? –  Host-website-on-iPage Jun 2 '13 at 11:50
        
    have you tried the updated answer? –  22lk94k943 only Jun 2 '13 at 13:56

    I've kept this thread bookmarked and I check it from time to time. I finally found a way to solve this problem (for my hardware), so I'm writing this answer for archive and hopefully help someone else.

    I've been struggling with the same problem for nearly a year and a half. I have an Acer Aspire 5750G running Ubuntu 12.04.04 (64 bits), Debian Wheezy (64 bits) and Windows 7 Ultimate.

    The problem with the backlight sliding bar that should appear when hitting Fn+Left/Right arrow keys never worked for me except in Windows (I had to install Acer drivers after a fresh reinstall). I've put together something that seems to work using things I found here and in other places.

    First: get the widget to show up

    This method worked both in Debian Wheezy and Ubuntu 12.04

    Edit /etc/default/grub and add at the end of the GRUB_CMDLINE_LINUX line acpi_backlight=vendor, and then run sudo update-grub2 (please notice the 2 at the end, since I'm using GRUB2). And this should work after next boot.

    Second: preserve backlight

    Make sure there's something in /sys/class/backlight. I have there a symlink intel_backlight that points to ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight

    This folder has some files in it:

    $ cd /sys/class/backlight/intel_backlight
    $ ls
    actual_brightness  bl_power  brightness  device  max_brightness  power  subsystem  type  uevent
    

    When I dim the brightness, the value in file actual_brightness decreases

    $ cat  actual_brightness
    976
    $ cat  actual_brightness
    304
    $ cat  actual_brightness
    160
    

    976 is the value in max_brightness, and it's the max allowed value, so it won't go any further.

    I made a little script and tried to set it up as a cron job. It stored the value as it was supposed to but was unable to restore it on boot.

    A few days ago I found this book: Upstart Intro, Cookbook and Best Practices

    So I made two upstart jobs to save and restore the value of the screen brightness.

    Upstart is packaged on Ubuntu since version 6.10 (I think) and is an option on Debian. Check you have upstart and its version:

    $ sudo initctl --version
    initctl (upstart 1.5)
    Copyright (C) 2012 Scott James Remnant, Canonical Ltd.
    
    This is free software; see the source for copying conditions.  There is NO warranty; not even for     MERCHANTABILITY or FITNESS FOR A PARTICULAR
    PURPOSE.
    

    You can call it anything you like: anything.conf and it must be placed in /etc/init/ This job is triggered when the computer is shutting down or rebooting and copies the file /sys/class/backlight/intel_backlight/actual_brightness to /var/backups/actualb (this too can be changed to whatever you like, but on the second job it has to be same).

    # upstart job to save the actual screen brightness on shutdown
    # file: /etc/init/backlightsave.conf
    
    start on runlevel [!2345]
    
    script
        cp /sys/class/backlight/intel_backlight/actual_brightness /var/backups/actualb
    end script
    

    This job loads the value that has been stored and sets the screen backlight according to it. You can call it whatever.conf and place it in /etc/init/ too.

    # upstart job to restore the screen brightness on boot
    # file: /etc/init/backlightrestore.conf   
    
    start on runlevel [2345]
    
    script
        read brightness < "/var/backups/actualb"
        pkexec /usr/lib/gnome-settings-daemon/gsd-backlight-helper --set-brightness $brightness
    end script
    

    You can test the jobs by typing in a terminal:

    $ sudo initctl name_of_the_job
    

    Now everything works fine for me, the screen backlight is restored even before the login screen shows up.

    Hope this helps

    share|improve this answer

    If you have Samsung in addition to acpi_backlight=vendor look at https://launchpad.net/~voria/+archive/ppa and install samsung-tools and samsung-backlight.

    Also no need to add acpi_osi=Linux.

    share|improve this answer
        
    Thanks for your help! –  Host-website-on-iPage Jul 8 '13 at 13:50

    I myself made a geeky solutions for "brightness restoration" problem on my Acer 5755......

    paste the following code in text file, make it executable, & add to startup applications....done

    pkexec /usr/lib/gnome-settings-daemon/gsd-backlight-helper --set-brightness 800
    

    Your display brightness now set on startup, change "800" as per Your requirement.

    share|improve this answer
        
    Thanks for your help! –  Host-website-on-iPage Jul 8 '13 at 13:51

    as the brightness is moving all around, there is directory in /sys/class/backlight giving you semi-direct control of your devices. go to the one with your monitor name and you will find the file brightness. change the value in it...

    in some cases linux cant change it on one device, so just go out and into another directory in /sys/class/backlight in order monitor, graphics, Xorg. Do not put values to high, try it gradually thou I would like to know what will happen. Probably kernel panic

    share|improve this answer
        
    I did cd /sys/class/backlight followed by ls Got an empty list :-| –  Host-website-on-iPage Jun 2 '13 at 13:29
        
    look in /sys/class in grapfics/device inside folders for folder graphics and backlight in there. Openthem in file manager, I am dyslexic and may have made typos –  Tomas Jun 2 '13 at 13:40
        
    I found two folders in /sys/class/graphics/device: fb0 and fbcon –  Host-website-on-iPage Jun 2 '13 at 13:49
        
    enter the fb0 and then device –  Tomas Jun 2 '13 at 15:41
        
    Did aneesh@nb-14:/sys/class/graphics/fb0/device$ ls and ended up with the directories/files driver graphics modalias power subsystem uevent Tried checking the driver folder found uevent and vesafb.0, the former isn't openable, the latter is itself a driver. Checked graphics and couldn't get any headway. –  Host-website-on-iPage Jun 3 '13 at 4:27
    up vote 0 down vote accepted

    Home Sweet Home!

    I am back to the 32-bit OS! I had accidentally deleted /bin/sh resulting in a booting problem. So I decided to install Ubuntu 12.04 LTS 32-bit OS overwriting the entire 320 GB HDD. All my data is safe, for which I am profusely thankful to Dropbox and my cell phone!

    The brightness increases and decreases smoothly and even the brightness widget showing the level appears while adjusting the brightness.

    share|improve this answer
        
    Thank you one and all for your inputs. Else I might have not known that this graphics problem was a 32-bit-OS-versus-64-bit-OS issue. Thanks Jorge Castro for your kind gesture to draw attention to this problem. –  Host-website-on-iPage Jul 8 '13 at 14:04

    In my case: Dell Inspiron N4050, 12.04, I had to execute the command in @Alok's answer. The difference is that the values vary from 0 to 15, so, his 800 didn't work.

    The code is:

    pkexec /usr/lib/gnome-settings-daemon/gsd-backlight-helper --set-brightness 2
    

    I put this as a "Startup applications..." (does not require root password) and now I don't have to configure every time after boot.

    One can get maximum brightness value for one's backlight with the option

    pkexec /usr/lib/gnome-settings-daemon/gsd-backlight-helper --get-max-brightness

    share|improve this answer

    Your Answer

     
    discard

    By posting your answer, you agree to the privacy policy and terms of service.

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