My main work laptop is a Thinkpad X1 Carbon running Debian 9, which usually works pretty well but I've also been procrastinating on getting it to run perfectly.
One thing I had forgotten to configure was the screen brightness keys with my
window manager i3. I had forgotten that I tried to configure it before, but got
stuck on some extremely unhelpful error messages from xbacklight
. Anyhow,
this short blog post documents a workaround for the issue in case anyone else
has a similar setup.
First, the problem. The backlight on a Thinkpad with an Intel GPU can be adjusted
with the xbacklight
command. On Debian stretch, this doesn't work so well though:
$ xbacklight -inc 10
No outputs have backlight property
It turns out this is a known bug (#833508)
and has a straightforward solution. The solution, from the Arch wiki,
is to add the following config stanza in a .conf
file in /etc/X11/xorg.conf.d/
:
Section "Device"
Identifier "Card0"
Driver "intel"
Option "Backlight" "intel_backlight"
EndSection
This tells xbacklight
which directory in /sys/class/backlight
should be used.
BTW, in case you want to know how to configure the key binding in i3, you can add
something like this in ~/.i3/config
:
# brightness
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 10
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 10
Alternatively, I've recently started to just run parts of GNOME from i3 in order to get support for backlight (and multimedia, etc) keys working. Something like the following works on Debian stable:
# gnome compat
# see https://github.com/csxr/i3-gnome
# works with gnome 3.22, but likely needs updating with newer
# versions that split the daemon into several smaller daemons
exec --no-startup-id gnome-flashback
exec --no-startup-id gnome-settings-daemon
# policykit for password dialogs
exec --no-startup-id /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 &