# ThinkPad T500 Fn hotkeys

## widremann

I've installed Gentoo on my ThinkPad T500 and most stuff works fine.  Switchable graphics doesn't, but that's a topic for another day (after vga switcheroo is finished).  The thing that bugs me most, however, is that I simply cannot figure out a way to turn off the backlight with Fn-F3.  Before, I could use radeontool.  But that doesn't work with this radeon card, apparently (HD 3650).  xrandr offers no help.  Googling has been fruitless as most people don't seem to care about turning off the screen (or if they do, they don't let on).  So, at long last, I am asking how to turn off the screen on a T500 using Linux.

----------

## FlorianSchmidt

Hi widremann,

I don't know how to exactly turn on your function key. But if "xev" can display the key-event you should be able to bind

```

xset dpms force off

```

to it.

cu

Florian

----------

## toralf

 *FlorianSchmidt wrote:*   

> 
> 
> ```
> xset dpms force off
> ```
> ...

 You can put it into /etc/acpi/defaults.sh

----------

## widremann

 *toralf wrote:*   

>  *FlorianSchmidt wrote:*   
> 
> ```
> xset dpms force off
> ```
> ...

 

That can't work because xset has to be connected to an X server.

Furthermore, that option only works when there's an X server running, not on the console.

Also, it seems to turn itself back on very easily, such as that doing xset dpms force off will only last for a second.

And finally, DPMS must be using some mechanism to control the backlight and that mechanism should be available elsewhere.

----------

## toralf

 *widremann wrote:*   

> That can't work because xset has to be connected to an X server.

 Therefore the acpi script should contains sth like

```
DISPLAY="DISPLAY=:0.0"                                                       

XUSR=$(w | grep -e xdm -e startx -e xinit | fgrep -v grep | cut -f1 -d' ' | sort -u | tail -n 1)

if [[ -n "$XUSR" ]]; then                                                                       

        if [[ "$XUSR" != "root" ]]; then                                                        

                XUSR="su - $XUSR -c"                                                            

        else                                                                                    

                XUSR="logger"                                                                   

        fi                                                                                      

else                                                                                            

        XUSR="logger"                                                                           

fi                                                                                              

```

so that a code like this works for a lot of use cases:

```
        ibm)            case $action in

                                hotkey) case $value in

                                                00001002)       $XUSR "$DISPLAY qdbus org.kde.screensaver /ScreenSaver Lock || $DISPLAY xlock"                                                                                          

                                                                ;;                                                  

                                                00001003)       $XUSR "$DISPLAY xset dpms force off"

                                                                ;;                                  

                                                00001004)       suspend_to mem

                                                                ;;            

                                                00001007)       $XUSR "$DISPLAY /home/tfoerste/workspace/bin/monitor.sh"

                                                                ;;

                                                00001008)       $XUSR "$DISPLAY /home/tfoerste/workspace/bin/monitor.sh auto"

                                                                ;;

```

----------

## widremann

That will suffice.  I'd still like to have a global solution, but since I'll be using X most of the time, I think it should be fine.

----------

