[solved] Brightness Control Debian10 i3 on ThinkPad X201?

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
saljut7
Posts: 22
Joined: 2015-11-14 15:29

[solved] Brightness Control Debian10 i3 on ThinkPad X201?

#1 Post by saljut7 »

Hi,

I'm using Debian with i3 window manager and was able to adjust the display brightness of a Lenovo ThinkPad X201 with the following ~/.i3/config under Debian9:

Code: Select all

##Screen brightness controls (Pos1/End), needs "apt install xbacklight"
bindsym XF86MonBrightnessUp exec xbacklight -inc 10
bindsym XF86MonBrightnessDown exec xbacklight -dec 10
My system config:

Code: Select all

$ inxi -F
System:    Host: x201 Kernel: 4.19.0-6-amd64 x86_64 bits: 64 Desktop: i3 4.16.1 
           Distro: Debian GNU/Linux 10 (buster) 
Machine:   Type: Laptop System: LENOVO product: 4492BD2 v: ThinkPad X201 serial: <root required> 
           Mobo: LENOVO model: 4492BD2 serial: <root required> BIOS: LENOVO v: 6QET70WW (1.40 ) date: 10/11/2012 
Battery:   ID-1: BAT0 charge: 19.6 Wh condition: 19.6/71.3 Wh (27%) 
CPU:       Topology: Dual Core model: Intel Core i5 M 560 bits: 64 type: MT MCP L2 cache: 3072 KiB 
           Speed: 1270 MHz min/max: 1199/2667 MHz Core speeds (MHz): 1: 1274 2: 1260 3: 1261 4: 1270 
Graphics:  Device-1: Intel Core Processor Integrated Graphics driver: i915 v: kernel 
           Display: x11 server: X.Org 1.20.4 driver: modesetting unloaded: intel 
           resolution: 1280x800~60Hz, 1280x1024~60Hz, 1280x1024~60Hz 
           OpenGL: renderer: Mesa DRI Intel Ironlake Mobile v: 2.1 Mesa 18.3.6 
Audio:     Device-1: Intel 5 Series/3400 Series High Definition Audio driver: snd_hda_intel 
           Sound Server: ALSA v: k4.19.0-6-amd64 
Network:   Device-1: Intel 82577LM Gigabit Network driver: e1000e 
           IF: enp0s25 state: up speed: 1000 Mbps duplex: full mac: ...
           Device-2: Intel Centrino Advanced-N 6200 driver: iwlwifi 
           IF: wlp2s0 state: up mac: ...
           IF-ID-1: docker0 state: down mac: ...
Drives:    Local Storage: total: 111.79 GiB used: 196.33 GiB (175.6%) 
           ID-1: /dev/sda vendor: OCZ model: VECTOR180 size: 111.79 GiB 
Partition: ID-1: / size: 105.18 GiB used: 97.95 GiB (93.1%) fs: ext4 dev: /dev/dm-1 
           ID-2: /boot size: 235.3 MiB used: 87.6 MiB (37.2%) fs: ext2 dev: /dev/sda1 
           ID-3: swap-1 size: 4.56 GiB used: 353.8 MiB (7.6%) fs: swap dev: /dev/dm-2 
Sensors:   System Temperatures: cpu: 63.0 C mobo: 0.0 C 
           Fan Speeds (RPM): cpu: 3759 
Info:      Processes: 247 Uptime: 3d 15h 40m Memory: 7.59 GiB used: 4.77 GiB (62.8%) Shell: bash inxi: 3.0.32 
$
It does not work anymore after upgrading to Debian10, means: If I press ActionKey+Pos1/End the brightness is not adjusted anymore.

Any idea what could be the reason for this or should I ask the i3 developers?

Edit: replaced "Debian9" by "Debian10"
Last edited by saljut7 on 2020-02-19 11:48, edited 3 times in total.

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Brightness Control under Debian9 with i3 on ThinkPad X20

#2 Post by Head_on_a_Stick »

saljut7 wrote:Any idea what could be the reason for this
Kernel regression, perhaps? Does the xbacklight command work if you try it from a terminal? Have you tried removing the keybinds?

I have an X201 that runs Debian buster and the keyboard backlight controls work natively (ie, they do not require special key bindings).

EDIT: you're running Debian 10 btw.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

saljut7
Posts: 22
Joined: 2015-11-14 15:29

Re: Brightness Control under Debian9 with i3 on ThinkPad X20

#3 Post by saljut7 »

Sorry for my late reply, I didn't get a mail notification for some reason.

Well, great to see a "CrunchBanger" here! You gave me first GNU/Linux support for #! some years ago! :D
Head_on_a_Stick wrote:Does the xbacklight command work if you try it from a terminal?
Sry, no:

Code: Select all

$ xbacklight -inc 10
No outputs have backlight property
$
Head_on_a_Stick wrote:Have you tried removing the keybinds?
No, but (sorry) I don't get your point here.
Head_on_a_Stick wrote: I have an X201 that runs Debian buster and the keyboard backlight controls work natively (ie, they do not require special key bindings).
Oh, interesting. Maybe here is the difference: Which kind of desktop environment do you use?
Head_on_a_Stick wrote:EDIT: you're running Debian 10 btw.
Thx, my fault. Edited.

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Brightness Control under Debian9 with i3 on ThinkPad X20

#4 Post by Head_on_a_Stick »

saljut7 wrote:

Code: Select all

$ xbacklight -inc 10
No outputs have backlight property
$
To get that command working try installing the xserver-xorg-video-intel package then check the X.Org log to see if it is being used (I think the modesetting driver may be the default for Intel hardware under Debian buster).

If it isn't being used force it by creating a configuration file at /etc/X11/xorg.conf.d/20-intel.conf with this content:

Code: Select all

Section "Device"
   Identifier "Intel Graphics"
   Driver "intel"
   Option "intel_backlight"
EndSection
The Option name is determined by the Intel directory in /sys/class/backlight/ but try the file without that line first, it may not be needed.
saljut7 wrote:
Head_on_a_Stick wrote:Have you tried removing the keybinds?
No, but (sorry) I don't get your point here.
Try removing the bindsym lines for xbacklight in ~/.i3/config, they should work once the xbacklight command is functional but you might not need them at all — if the kernel supports your hardware correctly then it should handle the backlight keys itself without needing any configuration at the desktop level, the keys should even work in the console.
saljut7 wrote:
Head_on_a_Stick wrote:I have an X201 that runs Debian buster and the keyboard backlight controls work natively (ie, they do not require special key bindings).
Oh, interesting. Maybe here is the difference: Which kind of desktop environment do you use?
The machine is running GNOME atm (which seems to have a magical ability to control the backlight when other desktops cannot) but I'm pretty sure it working fine with dwm (without any special keybinds) and also in the console. Unfortunately I don't have access to the machine immediately to check though.

EDIT: I've just managed to steal the X201 back from the household's $MOODY_TEENAGER and I can confirm that the backlight keys work even in the console (TTY) with Debian buster's stock kernel.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

saljut7
Posts: 22
Joined: 2015-11-14 15:29

Re: Brightness Control under Debian9 with i3 on ThinkPad X20

#5 Post by saljut7 »

Head_on_a_Stick wrote:
saljut7 wrote:

Code: Select all

$ xbacklight -inc 10
No outputs have backlight property
$
To get that command working try installing the xserver-xorg-video-intel package then check the X.Org log to see if it is being used (I think the modesetting driver may be the default for Intel hardware under Debian buster).
xserver-xorg-video-intel was already installed and was was used according to:

Code: Select all

# cd /var/log/
root@debian10:/var/log# ls -la | grep Xorg
-rw-r--r--  1 root              root    36017 Feb 19 13:33 Xorg.0.log
-rw-r--r--  1 root              root    38133 Feb 19 13:33 Xorg.0.log.old
-rw-r--r--  1 root              root    21877 Dec 22  2017 Xorg.1.log
-rw-r--r--  1 root              root    21877 Dec 22  2017 Xorg.1.log.old
root@debian10:/var/log# 
However:
Head_on_a_Stick wrote:If it isn't being used force it by creating a configuration file at /etc/X11/xorg.conf.d/20-intel.conf with this content:

Code: Select all

Section "Device"
   Identifier "Intel Graphics"
   Driver "intel"
   Option "intel_backlight"
EndSection
The Option name is determined by the Intel directory in /sys/class/backlight/ but try the file without that line first, it may not be needed.
I've touched /etc/X11/xorg.conf.d/20-intel.conf with the following content:

Code: Select all

Section "Device"
   Identifier "Intel Graphics"
   Driver "intel"
EndSection
Then I removed in ~/.i3/config:

Code: Select all

bindsym XF86MonBrightnessUp exec xbacklight -inc 10
bindsym XF86MonBrightnessDown exec xbacklight -dec 10
After rebooting the system Fn+Pos1/End finally worked (just restarting i3 was not enough)! Thank you very much (and your $MOODY_TEENAGER as well)! :)

Post Reply