set -e terminated the script after the first -lock if it failed, never
entering the loop.
# 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.