[ltp] gnome-screensaver and locking using fn-f2

Grant Williamson linux-thinkpad@linux-thinkpad.org
Wed, 04 Apr 2007 13:18:30 +0200


That does not seem to work either, xscreensaver would, even if I set 
XAUTH & DISPLAY.

Fails with either
gnome-screensaver-Message: Screensaver is not running! (launch it as root)
or
gnome-screensaver-Message: Failed to connect to the D-BUS daemon: Failed 
to execute dbus-launch to autolaunch D-Bus session (via su - user)


Richard Neill wrote:
>
>
> Grant Williamson wrote:
>> Hi,
>> has anyone got a way to lock gnome-screen saver using fn-fn2.
>>
>> I am using ibm-acpi
>> i.e.
>> events/FnF2-ibm-acpi.conf
>> # ACPID Configuration to execute action when pressing Fn+F2
>> event=ibm/hotkey HKEY 00000080 00001002
>> action=/etc/acpi/actions/FnF2.sh
>>
>> actions/FnF2.sh
>> #!/bin/bash
>> # Does not work ... yet
>> USER=`ps aux|grep -i gnome-screensaver|grep -v grep| awk '{print $1}'`
>> su $USER -c "dbus-send --session --dest=org.gnome.ScreenSaver 
>> --type=method_call --print-reply --reply-timeout=20000 
>> /org/gnome/ScreenSaver org.gnome.ScreenSaver.SetActive boolean:true"
>>
>
> Try using
>   gnome-screensaver-command --activate
> You may need to set the correct value of $DISPLAY first.
>
> HTH,
>
> Richard