How set brightness on startup – Ubuntu 12.04

by John
Published on: January 2, 2012
Categories: How To
Tags: No Tags
Comments: 16 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


  • erickjohncuevas


  • 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 :)

    • 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 “″

    • Paul

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

      • Paul

        brightness is your file_name

  • 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?

  • Gintong Aral

    This works with Linux Mint 13

  • Stéphane Gourichon

    This is system-dependent and somehow dangerous as explained on . There, an alternative is proposed without the drawbacks, for 11.10 and up.

  • Mohammed

    Superb script works great!!!!!!

  • Andrew Chunis

    it doesnt work for me though…

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


Welcome , March 30, 2015