diff options
Diffstat (limited to 'bin/xorg_autolock')
-rwxr-xr-x | bin/xorg_autolock | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/xorg_autolock b/bin/xorg_autolock index f30ae3e..181548e 100755 --- a/bin/xorg_autolock +++ b/bin/xorg_autolock @@ -4,15 +4,16 @@ set -euo pipefail lock=${XDG_RUNTIME_DIR}/xorg_autolock.lock lock_block=${XDG_RUNTIME_DIR}/xorg_autolock_block +lock_cmd="$HOME/bin/xorg_lock" lockafter=600000 -rm -f ${lock} ${lock_block} +rm -f "${lock}" "${lock_block}" -while [ 1 ]; do - if [ ! -f ${lock} -a ! -f ${lock_block} ];then +while true; do + if [ ! -f "${lock}" ] && [ ! -f "${lock_block}" ];then if [ -x "/usr/bin/xssstate" ]; then - if [ $(xssstate -i) -ge $lockafter ]; then - $HOME/bin/xorg_lock + if [ "$(xssstate -i)" -ge $lockafter ] && [ -x "$lock_cmd" ]; then + $lock_cmd fi else echo "xssstate is note installed!" |