]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - bin/xlockscreen
herbstluftwm/autostart: also create tag 0
[config/dotfiles.git] / bin / xlockscreen
index 3cd3be7a9822860821fc5ea632dbf02290a3f2e2..11b8aecfff44f464a95959656ded0025e49de001 100755 (executable)
@@ -58,6 +58,10 @@ if test x"$1" = xstart; then
         echo xscreensaver
     elif installed xautolock; then
         if installed "$lock_binary"; then
+            # Terminate a running xautolock because we might have to replace
+            # its timeout and other settings with our values.
+            pkill -u "$USER" xautolock || true
+
             xautolock -secure -time "$lock_time_minutes" \
                       -locker "$lock_binary" \
                       >/dev/null &
@@ -82,16 +86,16 @@ elif test x"$1" = xlock; then
         xscreensaver-command -time >/dev/null 2>&1 || xscreensaver &
 
         # It can take a while for xscreensaver to start, wait until it's
-        # ready.
+        # ready. a || b && c behaves like (a || b) && c.
         while :; do
             xscreensaver-command -lock || test $? -ne 255 && break
         done
     elif installed xtrlock; then
         # Sleep is necessary to allow xtrlock to grab the keyboard input.
         sleep 1
-        xtrlock
+        exec xtrlock
     elif installed xlock; then
-        xlock
+        exec xlock
     else
         echo 'No screen locker found!'
         exit 1