Skip to content

Instantly share code, notes, and snippets.

@liuanyou
Last active August 11, 2017 06:26
Show Gist options
  • Save liuanyou/1980530cff57a38d9223 to your computer and use it in GitHub Desktop.
Save liuanyou/1980530cff57a38d9223 to your computer and use it in GitHub Desktop.
Ubuntu 12.04 LTS - a workaround to save brightness

####Issue :

My Dell OptiPlex 3030 Unbuntu machine cannot save brightness, it goes to maximum brightness every time I save to lower brightness and reboot. It looks like related to Ubuntu. I found out a solution for it.

####Workaround :

  1. Modify grub file

    In terminal, type command to open grub file

    sudo gedit /etc/default/grub

    then change GRUB_CMDLINE_LINUX to

    GRUB_CMDLINE_LINUX="acpi_backlight=vendor"

    save the changes, then type

    sudo update-grub

    to reflect the changes

  2. Get brightness value

    Adjust brightness for machine, type command in terminal and then check the value

    sudo gedit /sys/class/backlight/intel_backlight/brightness

    it is 1917 in my machine

  3. Setup sudo with no-password

    Type command to open sudoers file

    sudo gedit /etc/sudoers

    then change %sudo ALL=(ALL:ALL) ALL to

    %sudo ALL=NOPASSWD: ALL

    save the changes

  4. Modify profile file

    Type command to open profile file

    sudo gedit /etc/profile

    at the end of file, add below lines

    sudo -S sh -c 'echo 1917 > /sys/class/backlight/intel_backlight/brightness'

    save the changes and reboot the machine to verify the result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment