diff options
author | David Runge <dave@sleepmap.de> | 2018-11-17 00:50:50 +0100 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2018-11-17 00:50:50 +0100 |
commit | 4f99bbc4e1fd137af0ae60afef1793794b4dfe58 (patch) | |
tree | 3e6046fc3aa702c48e150aaa7e842468c2adee46 | |
parent | 63e6444533cb8960f918cba97fb65f0fdf70dd00 (diff) | |
download | dotfiles-4f99bbc4e1fd137af0ae60afef1793794b4dfe58.tar.gz dotfiles-4f99bbc4e1fd137af0ae60afef1793794b4dfe58.tar.bz2 dotfiles-4f99bbc4e1fd137af0ae60afef1793794b4dfe58.tar.xz dotfiles-4f99bbc4e1fd137af0ae60afef1793794b4dfe58.zip |
bin/xorg_autolock: Properly quoting variables. Abstracting lock_cmd.
-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!" |