Thanks for the patch, applied to git. But someone with gnome-screensaver should check if it's working properly with lxsession git now.

Regards,
Julien Lavergne

Le 07/10/2012 20:51, Paul Menzel a écrit :
Date: Sat, 29 Sep 2012 08:56:39 +0200

Currently `lxlock` does not work (in Debian) if only GNOME Screensaver
is installed, since the daemon is only started if GNOME is running.

	$ grep OnlyShowIn /usr/share/gnome/autostart/gnome-screensaver.desktop
	OnlyShowIn=GNOME;

Therefore determine if `gnome-screensaver` is installed/available and
just execute it. If an instance is already running for some reason, the
process will exit. So it is certain, that GNOME Screensaver is running.

Now the command to lock the screen can be executed.
--
Understanding more of the configuration options, it looks like the
session is supposed to start the screensaver process. So this patch
might be useless after all.

1. Unfortunately `gnome-screensaver` does not start up fast enough and
starting it in the background it returns right away before accepting
commands from `gnome-screensaver-command`. In #gnome on irc.gnome.org
phako suggested to look if the bus has been taken and gave the following
examples.

        α) dbus-send --session --print-reply --dest=org.freedesktop.DBus / org.freedesktop.DBus.ListNames | grep org.gnome.ScreenSaver
        β) dbus-send --session --print-reply --dest=org.freedesktop.DBus / org.freedesktop.DBus.GetNameOwner string:org.gnome.ScreenSaver
        γ) gnome-screensaver-command -q
        
But they do not give a return code.

2. I am not sure why this works with `xscreensaver` if
`xscreensaver-command` does not start XScreensaver.

Looking at the Debian implementation, xscreensaver gets started by
`/etc/xdg/lxsession/LXDE/autostart`.

3. The Debian package `lxde-core` can now be adapted to suggest
`xscreensaver | gnome-screensaver`.
---
 lxlock |   20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/lxlock b/lxlock
index 447aa9a..9a847bb 100644
--- a/lxlock
+++ b/lxlock
@@ -20,13 +20,6 @@ PATH=/bin:/usr/bin
 export PATH
 
 for lock_cmd in \
-    "xscreensaver-command -lock" \
-    "gnome-screensaver-command --lock"
-do
-    $lock_cmd >/dev/null 2>&1 && exit
-done
-
-for lock_cmd in \
     "slock" \
     "xlock -mode blank"
 do
@@ -37,4 +30,17 @@ do
     fi
 done
 
+for lock_cmd in \
+    "xscreensaver-command -lock"
+do
+    $lock_cmd >/dev/null 2>&1 && exit
+done
+
+lock_prog="gnome-screensaver"
+lock_cmd="gnome-screensaver-command --lock"
+if command -v -- $lock_prog >/dev/null 2>&1; then
+    $lock_prog & # It does not matter if it is already running.
+    $lock_cmd >/dev/null 2>&1 && exit
+fi
+
 exit 1


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev


_______________________________________________
Lxde-list mailing list
Lxde-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxde-list