8

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.

Zanna
  • 70,465

2 Answers2

5

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.

Zanna
  • 70,465
  • 1
    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%. – Scimonster Aug 26 '16 at 09:15
  • 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? – Zanna Aug 26 '16 at 09:23
  • 1
    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. – Scimonster Aug 26 '16 at 09:38
  • doesn't work in 18.04 – Porcupine Jul 01 '18 at 20:10
  • 1
    On GNOME instead of xbacklight you can use D-Bus – Pablo Bianchi Jul 11 '21 at 20:02
4

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.

Abhay Patil
  • 2,705
  • 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. – bim Jun 03 '22 at 19:28
  • This should be as upvoted as the accepted answer. The former only works on Intel but this works beautifully on amd based machines. Cheerio ! – gordon_freeman Mar 01 '23 at 23:15