[ltp] gnome-screensaver and locking using fn-f2
Grant Williamson
linux-thinkpad@linux-thinkpad.org
Wed, 04 Apr 2007 12:07:19 +0200
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"
However it always fails with
Error org.freedesktop.DBus.Error.ServiceUnknown: The name
org.gnome.ScreenSaver was not provided by any .service files
I do not want to go back to xscreensaver, any other way to achieve the
same result?