Friday, 10 April 2015

Adjust screen brightness in Ubuntu using hotkeys

In almost all laptops you can find hotkeys(combination of function and other special key in your laptop that varies according to the manufacturer) that provide you special features like adjust sound, adjust brightness, toggle wifi and bluetooth. Now when you install Ubuntu in such laptop many time all hotkeys combination may not work.

I have Acer aspire series laptop and I installed Ubuntu in it. All the hotkeys combinations are working fine except brightness hotkeys using function key. But I can alter screen brightness using following command in terminal. 

        sudo setpci -s 00:02.0 F4.B=xx

In above command xx= all hexadecimal value between 00 to ff [00=highest brightness  ff=lowest brightness(total dark)]. For more information check my post

But for that you need to remember this command or need to write down it somewhere and enter it every time you start Ubuntu. So the hotkeys will be more preferrable over this solution.

For that you need to edit grub file. To open that grub file enter the following command in the terminal.

        sudo gedit /etc/default/grub

It will ask for the password of you user and it open gedit with grub file. You need to find two variable and add their value as below. If the variables are already there just mark them as comment by writing # at the start of the line.

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"


Save the file and close it. Now you have to update the changes in grub file by firing following command.

        sudo update-grub

Now when you restart the Ubuntu and open it next time, the hotkeys for brightness should be work fine. 

No comments:

Post a Comment