From: Simon Ruderich Date: Sun, 23 Aug 2015 09:46:08 +0000 (+0200) Subject: bin/xlockscreen: fix xscreensaver-command -lock loop X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=021d03272d647134227b7791cdaa357d2275ced3;p=config%2Fdotfiles.git bin/xlockscreen: fix xscreensaver-command -lock loop set -e terminated the script after the first -lock if it failed, never entering the loop. --- diff --git a/bin/xlockscreen b/bin/xlockscreen index 1bac3a1..88c4a48 100755 --- a/bin/xlockscreen +++ b/bin/xlockscreen @@ -78,11 +78,10 @@ elif test x"$1" = xlock; then # ensures xscreensaver is available for the current X session. xscreensaver-command -time >/dev/null 2>&1 || xscreensaver & - xscreensaver-command -lock # It can take a while for xscreensaver to start, wait until it's # ready. - while test $? -eq 255; do - xscreensaver-command -lock + 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.