How to create keyboard shortcuts for screen brightness in Xubuntu (XFCE Ubuntu)?
You can use xbacklight to control the screen brightness. In XFCE, open the settings and add calls to xbacklight
under “Keyboard” → “Application Shortcuts”: something like xbacklight -dec 5 -steps 1
for BrightnessDown and xbacklight -inc 5 -steps 1
for BrightnessUp.
A few graphics drivers don't support xbacklight
. If it doesn't work on your system, you can ask about it on this site, mentioning your exact graphics card model.
A generic method that works with any desktop environment (or none at all) is to run xbindkeys (available in most distributions, including Ubuntu). Xbindkeys only consumes CPU when it starts up or when a key is pressed, and very little at that; it isn't a battery drain at all. (This would be the case for any remotely decent software providing the same functionality.) In ~/.xbindkeysrc
, put something like
"xbacklight -dec 5 -steps 1"
XF86MonBrightnessDown
"xbacklight -inc 5 -steps 1"
XF86MonBrightnessUp
and add xbindkeys
to your startup applications in your desktop environment, or to ~/.xsession
or ~/.xinitrc
if you don't use a desktop environment.
XFCE backlight buttons
First, install xbacklight
$ sudo apt install xbacklight
Then, check whether you have control over the backlight.
$ xbacklight -1
$ xbacklight +5
Should these commands result in a No outputs have backlight property
error,
then follow these remediating steps before proceeding.
Once xbacklight -1
and xbacklight +1
work from the command line, proceed with assigning these commands to respectively the XF86MonBrightnessDown
and XF86MonBrightnessUp
keys. This is done by hitting those keys when asked by the Settings → Keyboard → Application Shortcuts application.
Finally, reboot for these changes to take effect.