Screen brightness control on i3wm for Lenovo X240 (Ubuntu)

First ensure that you have the right permissions to write to the device by adding a new rule for udev (create a new file like /etc/udev/rules.d/99-backlight) with these lines:

ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="leds", RUN+="/bin/chgrp video /sys/class/leds/%k/brightness"
ACTION=="add", SUBSYSTEM=="leds", RUN+="/bin/chmod g+w /sys/class/leds/%k/brightness"

You'll have reboot your system for the changes to take effect.

Now you need to add you user to the video group.

You've to install the tool light :

sudo apt install light

And finally you have to add this to your i3wm config

bindsym XF86MonBrightnessUp exec light -A 10
bindsym XF86MonBrightnessDown exec light -U 10
This entry was posted in Uncategorized. Bookmark the permalink.