From 405df2ef3c4d1351fcb9ccc49bfb588d3254a879 Mon Sep 17 00:00:00 2001 From: Sanel Zukan Date: Mon, 2 Apr 2012 18:59:07 +0000 Subject: [PATCH] Importing new ede-screen-lock tool, a wrapper around various locking engines. Also modified ede-help to use 'command -v' instead of 'which', making it more portable. --- Jamfile | 1 + ede-help/ede-help.in | 2 +- ede-screen-lock/Jamfile | 13 +++++++++++++ ede-screen-lock/ede-screen-lock | 28 ++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 ede-screen-lock/Jamfile create mode 100755 ede-screen-lock/ede-screen-lock diff --git a/Jamfile b/Jamfile index b96088b..0cd1299 100644 --- a/Jamfile +++ b/Jamfile @@ -26,6 +26,7 @@ SubInclude TOP ede-desktop-conf ; SubInclude TOP ede-dialog ; SubInclude TOP ede-keyboard-conf ; SubInclude TOP ede-screensaver-conf ; +SubInclude TOP ede-screen-lock ; SubInclude TOP ede-help ; SubInclude TOP ede-image-view ; SubInclude TOP elma ; diff --git a/ede-help/ede-help.in b/ede-help/ede-help.in index d1bdf6a..1ff245d 100644 --- a/ede-help/ede-help.in +++ b/ede-help/ede-help.in @@ -48,7 +48,7 @@ url="file://$url" # try to find browser if [ "x$BROWSER" = "x" ]; then for i in $browser_list; do - if which $i > /dev/null 2>&1; then + if command -v $i > /dev/null 2>&1; then BROWSER="$i" break; fi diff --git a/ede-screen-lock/Jamfile b/ede-screen-lock/Jamfile new file mode 100644 index 0000000..68ba3e6 --- /dev/null +++ b/ede-screen-lock/Jamfile @@ -0,0 +1,13 @@ +# +# $Id: Jamfile 2496 2009-02-20 15:29:11Z karijes $ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2012 EDE Authors. +# +# This program is licensed under the terms of the +# GNU General Public License version 2 or later. +# See COPYING for the details. + +SubDir TOP ede-screen-lock ; + +InstallEdeProgram ede-screen-lock ; diff --git a/ede-screen-lock/ede-screen-lock b/ede-screen-lock/ede-screen-lock new file mode 100755 index 0000000..03bdc13 --- /dev/null +++ b/ede-screen-lock/ede-screen-lock @@ -0,0 +1,28 @@ +#!/bin/sh + +program="ede-screen-lock" + +if [ "$1" = "--help" ]; then + cat < /dev/null 2>&1`; then + lock_cmd="xscreensaver-command -lock" +elif `command -v xlock > /dev/null 2>&1`; then + lock_cmd="xlock" +fi + +if [ "x$lock_cmd" = "x" ]; then + ede-dialog --error "Unable to find any known locker. Please install xscreensaver or xlock to enable screen lock in EDE" + exit 1 +fi + +$lock_cmd