[Xfce4-commits] [xfce/xfce4-session] 01/01: Revert "Update xflock4 (Bug 10217)"

noreply at xfce.org noreply at xfce.org
Sat Aug 30 20:25:51 CEST 2014


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfce4-session.

commit 77cff3b344e65cccd135dc37b5324b9864946ef4
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Sat Aug 30 21:24:02 2014 +0300

    Revert "Update xflock4 (Bug 10217)"
    
    This reverts commit bb0cbd537d72be4dece2ade8a86d76335dfda2dc.
    The patch uses pidof which is Linux specific.
---
 scripts/xflock4 |   68 ++++++++++++++++++++++---------------------------------
 1 file changed, 27 insertions(+), 41 deletions(-)

diff --git a/scripts/xflock4 b/scripts/xflock4
index 9268e6a..ec4d05d 100644
--- a/scripts/xflock4
+++ b/scripts/xflock4
@@ -4,7 +4,7 @@
 #
 #  Copyright (C) 1999, 2003 Olivier Fourdan (fourdan at xfce.org)
 #  Copyright (C) 2011       Guido Berhoerster (guido+xfce.org at berhoerster.name)
-#  Copyright (C) 2014       Jarno Suni (8 at iki.fi)
+#  Copyright (C) 2011       Jarno Suni (8 at iki.fi)
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -20,45 +20,31 @@
 #  along with this program; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #
-set -o nounset
-set -o errexit
-# OpenBSD and possibly some other OSs require
-# /usr/local/bin:/usr/X11R6/bin in PATH
-PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
+
+PATH=/bin:/usr/bin
 export PATH
 
-# Lock by a screensaver, if its daemon is running.
-if pidof "`command -v xscreensaver`" >/dev/null; then
-    xscreensaver-command -lock >/dev/null
-elif pidof "`command -v gnome-screensaver`" >/dev/null; then
-    gnome-screensaver-command --lock >/dev/null
-elif pidof "`command -v light-locker`" >/dev/null; then
-    light-locker-command --lock >/dev/null
-elif pidof "`command -v mate-screensaver`" >/dev/null; then
-    mate-screensaver-command --lock >/dev/null
-elif pidof "`command -v cinnamon-screensaver`" >/dev/null; then
-    cinnamon-screensaver-command --lock >/dev/null
-elif pidof "`command -v xautolock`" >/dev/null; then
-# Note: xautolock does not tell, if it succeeds in locking,
-# so be sure to start the daemon properly.
-    xautolock -locknow >/dev/null
-# No daemon was found; use some available utility to lock:
-elif command -v i3lock >/dev/null; then
-    i3lock --dpms --color=000000 >/dev/null
-else
- for lock_cmd in \
-    "xlock -mode blank" \
-    "slock" \
-    "slimlock"
- do
-  if command -v -- $lock_cmd >/dev/null; then
-     # Run the command in background
-     $lock_cmd >/dev/null &
-     # Turn off display backlight
-     xset dpms force off
-     exit
-  fi
- done
- # None of the above worked. Access locking failed.
- exit 1
-fi
+# Lock by xscreensaver or gnome-screensaver, if a respective daemon is running
+for lock_cmd in \
+    "xscreensaver-command -lock" \
+    "gnome-screensaver-command --lock"
+do
+    $lock_cmd >/dev/null 2>&1 && exit
+done
+
+# else run another access locking utility, if installed
+for lock_cmd in \
+  "xlock -mode blank" \
+  "slock"
+  do
+    set -- $lock_cmd
+    if command -v -- $1 >/dev/null 2>&1; then
+        $lock_cmd >/dev/null 2>&1 &
+	# turn off display backlight:
+	xset dpms force off
+        exit
+    fi
+done
+
+# else access locking failed
+exit 1

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list