Thinkpad X21 & Debian - how to turn off LCD backlight?

Solaris, RedHat, FreeBSD and the like
Post Reply
Message
Author
Ormu
Posts: 9
Joined: Wed Sep 19, 2012 2:31 pm
Location: Espoo, Finland

Thinkpad X21 & Debian - how to turn off LCD backlight?

#1 Post by Ormu » Wed Sep 19, 2012 2:42 pm

I'm using a Thinkpad X21 with Debian Squeeze as a server (irc bouncer etc.). I'd like to turn the display backlight off to save power and the backlight CCFL tubes itself but I haven't found a way to do so.

The screen goes blank automatically after some time but the backlight still stays on.

DPMS via xset does not work because X is not installed.

Fn+F3 should turn the LCD off but it doesn't work. I think I saw some bug reports for thinkpad-acpi about this problem.

The commands:
setterm -powersave powerdown
and
setterm -powerdown 5 (note: 5 minute timeout)
...don't seem to work either.

Is there a way to do it at all? Or do I just have to keep it on, brightness at minimum? What should the BIOS setting "Screen Blanking" (enabled/disabled) do? I think changing it didn't have any effect.

Neil
Senior ThinkPadder
Senior ThinkPadder
Posts: 2914
Joined: Sun Aug 07, 2005 5:41 pm
Location: Paragould AR USA

Re: Thinkpad X21 & Debian - how to turn off LCD backlight?

#2 Post by Neil » Wed Sep 19, 2012 6:16 pm

You are correct about Fn + F3 being the key combo to blank the LCD. But since it's an ACPI event it doesn't seem to work with newer kernels. At least it doesn't for me running Xubuntu 12.04 on a T43.
Collection = T500 - R400 - X300 - X200 - T61 (14" WXGA+) - T61 (14.1" SXGA+) - T60 (15" SXGA+) - X40 - T43p - T43 - T42p - A30P - 600E

GomJabbar
Moderator
Moderator
Posts: 9765
Joined: Tue Jun 07, 2005 6:57 am

Re: Thinkpad X21 & Debian - how to turn off LCD backlight?

#3 Post by GomJabbar » Fri Sep 21, 2012 8:01 am

Here is how I do it in Arch XFCE with xset...

Using xev, I saw that Fn+F3 is mapped to XF86Battery.

Code: Select all

KeyPress event, serial 41, synthetic NO, window 0x2e00001,
    root 0xb0, subw 0x0, time 382189, (797,429), root:(803,503),
    state 0x10, keycode 244 (keysym 0x1008ff93, XF86Battery), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 41, synthetic NO, window 0x2e00001,
    root 0xb0, subw 0x0, time 382189, (797,429), root:(803,503),
    state 0x10, keycode 244 (keysym 0x1008ff93, XF86Battery), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
I created the following file /etc/acpi/actions/blank.sh as root and made it executable.

Code: Select all

#! /bin/sh

/usr/bin/xset dpms force off
I created a keyboard shortcut (an option in XFCE: Applications Menu > Settings > Keyboard > Application Shortcuts).
Command: /etc/acpi/actions/blank.sh
Shortcut: XF86Battery

Fn+F3 now turns off the backlight. Moving the trackpoint or pressing a keyboard key turns the backlight back on.

FWIW, for other Fn+F* keys that aren't already mapped and create only an acpi event, I have a corresponding file in /etc/acpi/events/

ACPI events can be seen by running acpi_listen from terminal.

Code: Select all

$ acpi_listen
button/f24 F24 00000080 00000000 K
button/fnf11 FF11 00000080 00000000 K
One example is how I turn on and off bluetooth with Fn+F9.
/etc/acpi/events/bluetoothconf

Code: Select all

event=button/f24.*
action=/etc/acpi/actions/bluetooth.sh
/etc/acpi/actions/bluetooth.sh

Code: Select all

#!/bin/bash

BT_RFKILL=$(rfkill list | grep tpacpi_bluetooth_sw | sed 's/\([0-9]\+\):.*/\1/')
BT_STATE=$(/usr/sbin/rfkill list $BT_RFKILL | grep "Soft blocked: yes")

if [ "x" == "x$BT_STATE" ]; then
	/usr/sbin/rfkill block $BT_RFKILL
else
	/usr/sbin/rfkill unblock $BT_RFKILL
fi

exit 0
Another example is how I connect and disconnect my home WiFi profile with Fn+F11.
/etc/acpi/events/netcfg_home-wirelessconf

Code: Select all

event=button/fnf11.*
action=/etc/acpi/actions/netcfg_home-wireless.sh
/etc/acpi/actions/netcfg_home-wireless.sh

Code: Select all

#!/bin/bash

WLAN_STATE=$(netcfg current)

if [ "x" == "x$WLAN_STATE" ]; then
	/usr/bin/netcfg home-wireless
else
	/usr/bin/netcfg -a
fi

exit 0
DKB

Neil
Senior ThinkPadder
Senior ThinkPadder
Posts: 2914
Joined: Sun Aug 07, 2005 5:41 pm
Location: Paragould AR USA

Re: Thinkpad X21 & Debian - how to turn off LCD backlight?

#4 Post by Neil » Fri Sep 21, 2012 8:11 am

Some very useful info here, DKB! :thumbs-UP:
Collection = T500 - R400 - X300 - X200 - T61 (14" WXGA+) - T61 (14.1" SXGA+) - T60 (15" SXGA+) - X40 - T43p - T43 - T42p - A30P - 600E

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “Linux Questions”

Who is online

Users browsing this forum: No registered users and 1 guest