How set brightness on startup – Ubuntu 12.04

by John
Published on: January 2, 2012
Categories: How To
Tags: No Tags
Comments: 15 Comments

1. Create a file in /etc/init.d/file_name,


sudo nano /etc/init.d/file_name


2. Copy and paste the code below and save.


setpci -s 00:02.0 F4.B=50

3. Now lets set some permissions.


sudo chmod 755 /etc/init.d/file_name

4. We want the script to run on boot up.


sudo update-rc.d file_name defaults

Now restart your Ubuntu and the script we created will run on boot-up automatically.

  • Raphael

    Does it work fot 11.10 too?

    • Raphael

       *for

  • http://www.erickjohncuevas.com erickjohncuevas

    yes.

  • http://www.erickjohncuevas.com erickjohncuevas

    btw. there was a type in the “sudo chown 755 /etc/init.d/file_name”

    should be sudo chmod 755 /etc/init.d/file_name.

  • Toan Ngo

    it doesnt work for me though…
    for me, i’ll just use this:
             echo 4 > /sys/class/backlight/acpi_video0/brightness
    and it does work :)
    Reference: https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/923940

    • http://www.gintongaral.com/ Gintong Aral

      probably because of step 3 which is a typo. it should be chmod and not chown.

  • Suho
  • David

    How would one undo this? didn’t work for me but this did “http://ubuntuforums.org/showthread.php?p=11994828#post11994828″

    • Paul

      sudo rm -f /etc/init.d/brightness
      sudo update-rc.d brightness remove

      • Paul

        brightness is your file_name

  • http://twitter.com/bleeblooblahhh bleeblooblahhh

    This was very useful to me, but at step two, I needed to enter:
     setpci -s 01:00.0 F4.B=50
    Obtained by running:
    lspci | grep VGA

  • Alex

    would this work if you put it in /etc/init.d/rc.local?

  • http://www.gintongaral.com/ Gintong Aral

    This works with Linux Mint 13

  • Stéphane Gourichon

    This is system-dependent and somehow dangerous as explained on http://askubuntu.com/questions/66751/how-do-i-set-default-display-brightness/232668#232668 . There, an alternative is proposed without the drawbacks, for 11.10 and up.

  • Mohammed

    Superb script works great!!!!!!



Celebrate SFD with us on September 15! I'll be celebrating 20 years of Linux with The Linux Foundation!

RECENT COMMENTS


Welcome , October 21, 2014