Changing Screen Brightness Through Keyboard Functions on My Notebook

25,343

Solution 1

It seems quite common for brightness Fn keys to not work on Asus machines. On my Asus X205TA the brightness function keys don't work natively but I can use xbacklight as a workaround:

sudo apt install xbacklight

commands:

get current brightness:

xbacklight -get 

set brightness to 50%

xbacklight -set 50

increase brightness by 10%

xbacklight -inc 10

decrease by 10%

xbacklight -dec 10

If these work, you can get the function keys to change brightness by assigning them as shortcuts to the commands.

In keyboard settings click Custom Shortcuts and click the + button to add a new one

Name: Brighter
Command: xbacklight -inc 15

Click OK, then click where it says 'Disabled' next to the new shortcut and press the key combination you want (Fn will probably not work) for example ctrl+F6 or just F6

Name: Dimmer
Command: xbacklight -dec 15

And make this one F5 or whatever combination you want.

Solution 2

I am on 20.04 and I used dconf-editor to adjust the screen brightness from keyboard shortcuts.

Open dconf-editor and search for screen-brightness-up and screen-brightness-down, and under custom-value change the value to the shortcut you want to set (will tell later how to know what to enter).

enter image description here

I don't know the exact syntax followed by dconf-editor, but I will tell you how to find the syntax. Head over to settings > Keyboard shortcuts. Now search for volume up, and choose the shortcut which you want to use for screen brightness up. Then head over to dconf editor and search for volume-up, and now see the string in the custom value for volume-up, and now copy paste this string to the screen-brightness-up > custom value field. We have to do this as we can access the shortcuts for volume and not for brightness.

So we manipulate the value for volume from settings and then use that value for screen-brightness-up in the dconf editor. And then remove that custom value from dconf-edtor for volume-up (or set it back to its previous value).

Hope this helps. I was finding this for a very long time and the other answer didn't work for me, but I was finally able to figure this hack out, and hopes this helps many other people.

youtube.com/watch?v=rZl2PJ8Vt1w. I made a video to do this. If it is difficult to follow.

Share:
25,343

Related videos on Youtube

Mek Vala
Author by

Mek Vala

Updated on September 18, 2022

Comments

  • Mek Vala
    Mek Vala over 1 year

    I've installed Ubuntu 16.04 on my Asus X555LJ.

    But I don't know how to install drivers or how to enable function keys to controls screen backlight brightness.

    • Admin
      Admin almost 8 years
      any news? I would be interested to know if you found anything as it might work for me too :)
    • Admin
      Admin almost 8 years
      No, Now News On That. Currently I Using Solution Suggested By You :)
    • Admin
      Admin almost 8 years
      :) I'll remember to come back here and let you know if I hear of a better way!
    • Admin
      Admin almost 3 years
      youtube.com/watch?v=rZl2PJ8Vt1w. I made a video to do this.
  • Scimonster
    Scimonster over 7 years
    For me, i was able to xbacklight -dec until the screen went off, so i wrote a small bash script to run instead that adds a lower limit of 10%.
  • Zanna
    Zanna over 7 years
    Nice work @Scimonster I decided I want to be able to reduce brightness until screen goes off, but many people will not want this. Share your script somewhere? Q&A? Shall I write a question for you ti answer?
  • Scimonster
    Scimonster over 7 years
    a=$(xbacklight);printf -v a %.0f "$a";b=10;if [ "$a" -gt "$b" ];then xbacklight -dec 5;fi; It limits it at 10 (b=10) and decrements by 5% each time.
  • Porcupine
    Porcupine almost 6 years
    doesn't work in 18.04
  • Pablo Bianchi
    Pablo Bianchi almost 3 years
    On GNOME instead of xbacklight you can use D-Bus
  • Admin
    Admin almost 2 years
    smoothly worked. I have Thinkpad T15 laptop with Ubuntu 22.04. For unknown reason, the screen brightness up/down was not working. Now I set it back to F5 and F6.