ede/ede-screen-lock/ede-screen-lock
Sanel Zukan 405df2ef3c 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.
2012-04-02 18:59:07 +00:00

29 lines
527 B
Bash
Executable File

#!/bin/sh
program="ede-screen-lock"
if [ "$1" = "--help" ]; then
cat <<EOF
Usage: $program [OPTIONS]
Lock screen for current user
Options:
--help this help
EOF
exit 1
fi
if `command -v xscreensaver-command > /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