Is there a way to set a hotkey to change screen brightness?

33,567

This is a generic way to set arbitrary brightness up/down keys on Ubuntu 12.04 using the Keyboard settings app.

sudo apt-get install xdotool

Open "Keyboard" settings app, go to Shortcut tab, click Custom Shortcut, then the little + button to add a shortcut.

name: Brightness Up
command: xdotool key XF86MonBrightnessUp

and another:

name: Brightness Down
command: xdotool key XF86MonBrightnessDown

Click where it says "Disabled" and then hit the key-combo you want, I ended up using F2 and F3.

In Ubuntu 16.04 use --clearmodifiers with the command, i.e.,

name: Brightness Up command: xdotool key --clearmodifiers XF86MonBrightnessUp

and

name: Brightness Down command: xdotool key --clearmodifiers XF86MonBrightnessDown

Share:
33,567

Related videos on Youtube

postfuturist
Author by

postfuturist

Wrote AI for Godzilla:Unleashed for the Wii. I worked in the visual effects department of the Coraline project at Laika. Professionally, I've used C++, C#, Delphi, Java, Python, and PHP. Currently I am doing mostly web development with PHP.

Updated on September 18, 2022

Comments

  • postfuturist
    postfuturist over 1 year

    Possible Duplicate:
    How to change the shortcut to adjust brightness?

    The brightness keys on my laptop are not recognized by Ubuntu, which is a common problem for a variety of laptops, is there a way to set an arbitrary key shortcut to change brightness in Ubuntu 12.04? I looked in the Keyboard settings app under the shortcut tab, and I couldn't find one.

    I am able to set brightness in the Brightness and Lock settings app, but it would be much more convenient if I could just assign a key shortcut, like Ctrl+F2 and Ctrl+F3.

  • Meredith
    Meredith about 10 years
    Doesn't appear to work for an out-of-box Toshiba Satellite S55-A5375
  • dreme
    dreme over 8 years
    Worked for me on a Toshiba Satellite L305 laptop (which is 7 years old)
  • chaseadamsio
    chaseadamsio almost 8 years
    Worked on Acer C720 Chromebook booting with OpenSUSE
  • bteo
    bteo over 3 years
    It works perfectly well on Ubuntu 20.04. Anyway, I noticed that it lags a little bit. What can the reason for lagging be?