[ltp] Getting Fn-F2 to lock the screen

Richard Neill linux-thinkpad@linux-thinkpad.org
Thu, 15 Mar 2007 12:46:50 +0000


Marcus Better wrote:
> 
> ~# cat /etc/acpi/lockbtn.sh
> #!/bin/sh
> 
>  . /usr/share/acpi-support/key-constants
> 
> acpi_fakekey $KEY_COFFEE
> 
> 
> KEY_COFFEE is 152, but "acpi_fakekey 152" doesn't do anything. "xev" doesn't
> show anything when I press Fn-F2 either.
> 
> So, how can I catch the KEY_COFFEE event?

I don't know the "right" answer, but I think I'd just modify lockbtn.sh 
to directly lock the screen.

   xscreensaver-command -lock

is the command you need to run; you may have to fiddle with $DISPLAY 
(and possibly sudo) to make it work.

Richard