6

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!

  • Karthik C
    • 2,827

    8 Answers8

    4

    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.

    January
    • 35,952
    • I found that the commands were executed free of errors, but to no avail :-( I looked up this thread http://askubuntu.com/questions/56155/how-can-i-change-brightness-through-terminal 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? – Karthik C Oct 01 '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 02 '13 at 13:55
    • Tried that too! – Karthik C Jun 03 '13 at 11:25
    2

    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

    22lk94k943 only
    • 1,113
    • 4
    • 16
    • 25
    1

    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

    Carlos G
    • 1
    • 2
    0

    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.

    martini
    • 138
    0

    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.

    Alok
    • 19
    0

    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

    Tomas
    • 121
    • 3
    • I did cd /sys/class/backlight followed by ls

      Got an empty list :-|

      – Karthik C Jun 02 '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 02 '13 at 13:40
    • I found two folders in /sys/class/graphics/device: fb0 and fbcon – Karthik C Jun 02 '13 at 13:49
    • enter the fb0 and then device – Tomas Jun 02 '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. – Karthik C Jun 03 '13 at 04:27
    • Its as far as I can do by distance. Sorry This has newer failed me yet. it sounds like your card isnt set-up, but why monitor org xorg won show I do not know – Tomas Jun 03 '13 at 11:37
    • Clarify "monitor org xorg won show" for me? Who knows!? This might be the clincher! I am unable to move this discussion to a chat so I can solve my problem quicker, as I can chat with a user, not a community! – Karthik C Jun 03 '13 at 14:27
    0

    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.

    andrew.46
    • 38,003
    • 27
    • 156
    • 232
    Karthik C
    • 2,827
    • 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. – Karthik C Jul 08 '13 at 14:04
    0

    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