clean up lock

This commit is contained in:
David Majnemer 2010-09-02 22:06:07 -05:00
parent 6c38fc91f1
commit a45e3e56e4

8
lock
View file

@ -17,7 +17,7 @@ fi
# Handle non-graphical locking
if [ -z "${DISPLAY}" ] ; then
if [ -z "${STY}" ] ; then # not running screen
if ( command -v vlock >/dev/null 2>/dev/null ) ; then
if command -v vlock >/dev/null 2>/dev/null ; then
vlock
exit
else
@ -36,15 +36,15 @@ KDE_LOCK='kdesktop_lock --forcelock || krunner_lock --forcelock || /usr/libexec/
GNOME_LOCK='gnome-screensaver-command --lock'
XSCREEN_LOCK='xscreensaver-command -lock || xlock'
if ( ps -e | grep gdm >/dev/null 2>/dev/null ) ; then
if ps -e | grep gdm >/dev/null 2>/dev/null ; then
# looks like Gnome. They probably want gnome-screensaver.
# start gnome-screensaver to ensure it's running
gnome-screensaver >/dev/null 2>/dev/null
eval $GNOME_LOCK 2>/dev/null && exit
elif ( ps -e | grep kdm >/dev/null 2>/dev/null ) ; then
elif ps -e | grep kdm >/dev/null 2>/dev/null ; then
# looks like some version of KDE. They probably want kde's screensaver.
eval $KDE_LOCK 2>/dev/null && exit
elif ( ps -e | grep xdm >/dev/null 2>/dev/null ) ; then
elif ps -e | grep xdm >/dev/null 2>/dev/null ; then
xscreensaver & >/dev/null 2>/dev/null
eval $XSCREEN_LOCK 2>/dev/null && exit
fi