-# Automatically lock the screen after x minutes of inactivity if `xautolock`
-# is available. Warn if locker wasn't found.
-if installed xautolock; then
- if installed "$screen_locker"; then
- xautolock -secure -time "$screen_lock_time" -locker "$screen_locker" &
- else
- error "Locker '$screen_locker' not installed. Auto lock won't work!"
- fi
-elif test -n "$screen_lock_force"; then
- error "'xautolock' not found. Auto lock won't work!"
+
+# Start best available screen locker.
+xlockscreen=`"$HOME/.xlockscreen" start "$screen_lock_time" "$screen_locker"`
+if test $? -ne 0 && test -n "$screen_lock_force"; then
+ error "$xlockscreen"