Skip to content

Commit

Permalink
[lock] Add lightlocker support
Browse files Browse the repository at this point in the history
lightlocker and lightdm are used by Xubuntu and others. It's a fork of
gnome-screensaver so almost identical to invoke.
  • Loading branch information
avuserow committed Aug 4, 2016
1 parent acac5ed commit 33d01b6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ fi
# allow new sessions to be started.
KDE_LOCK='kdesktop_lock --forcelock || krunner_lock --forcelock || /usr/libexec/kde4/krunner_lock --forcelock || /usr/lib/kde4/libexec/krunner_lock --forcelock'
GNOME_LOCK='gnome-screensaver-command --lock'
LIGHT_LOCK='light-locker-command --lock'
XSCREEN_LOCK='xscreensaver-command -lock || xlock'

if ps -e | grep -w gdm >/dev/null 2>/dev/null ; then
if ps -e | grep -w lightdm >/dev/null 2>/dev/null ; then
# lightdm is running, probably xfce or similar.
# very similar to the gnome versions
light-locker >/dev/null 2>/dev/null &
eval $LIGHT_LOCK 2>/dev/null && exit
elif ps -e | grep -w 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 &
Expand All @@ -54,6 +60,8 @@ fi
echo "Could not decide what desktop manager you are using."
echo "Trying fallback locking."
eval $KDE_LOCK 2>/dev/null && exit
light-locker >/dev/null 2>/dev/null &
eval $LIGHT_LOCK 2>/dev/null && exit
gnome-screensaver >/dev/null 2>/dev/null &
eval $GNOME_LOCK 2>/dev/null && exit
xscreensaver & >/dev/null 2>/dev/null
Expand Down

0 comments on commit 33d01b6

Please sign in to comment.