aboutsummaryrefslogtreecommitdiffstats
path: root/bin/xorg_autolock
diff options
context:
space:
mode:
authorDavid Runge <david.runge@native-instruments.de>2018-11-24 14:19:45 +0100
committerDavid Runge <david.runge@native-instruments.de>2018-11-24 14:19:45 +0100
commitf4fec3ab8e56e82bf7904c3c19876e2f4e13667d (patch)
tree23a4dd266333fc6cfeb5ee05c6000ced30724098 /bin/xorg_autolock
parent31895b1b525ab673becdb10c7a421f71510f6354 (diff)
parentde1f86528b58faa0844f24b9edb63e5837dd7444 (diff)
downloaddotfiles-f4fec3ab8e56e82bf7904c3c19876e2f4e13667d.tar.gz
dotfiles-f4fec3ab8e56e82bf7904c3c19876e2f4e13667d.tar.bz2
dotfiles-f4fec3ab8e56e82bf7904c3c19876e2f4e13667d.tar.xz
dotfiles-f4fec3ab8e56e82bf7904c3c19876e2f4e13667d.zip
Merge branch 'master' of git.sleepmap.de:config/dotfiles
* 'master' of git.sleepmap.de:config/dotfiles: (36 commits) .config/packages-community.txt: Adding pd-lua. .config/systemd/user/mpd@.service: Adding local override for mpd@ user service. Raising LimitRTPrio to 75, as some threads in mpd apparently require it. .config/jack/*: Changing all configurations for jack@ user service (as its layout has changed). .gitignore: Removing ignore of .config/systemd (time to add some local overrides). .config/packages-aur.txt: Removing ssr (now in [community]). .config/systemd/user/jack@.service: Adding a local jack@ user service, so no package is required. .config/packages-community.txt: Adding dragonfly-reverb, libmusicxml, ssr and wolf-shaper. .ncmpcpp/config: Switching to local visualizer fifo. Using visualizer_type ellipse. .zsh.after/aliases.zsh: Removing useless pacsearch overloading. bin/setup_screens: Fixing and simplifying various things with the help of shellcheck. Using a separate get_display function to retrieve DISPLAY. bin/xorg_autolock: Properly quoting variables. Abstracting lock_cmd. bin/xorg_lock: Properly quote variables. Rename variables for better readibility. .xprofile: Repaired with the help of shellcheck. .config/packages-community.txt: Adding marsyas. .config/packages-aur.txt: Removing gmsynth.lv2 (now in community). Adding librenms and patroneo-git. .config/packages-community.txt: Adding ams-lv2, beatslash-lv2, gmsynth.lv2, lib32-fluidsynth, lsp-plugins, lvtk, stk and removing ssmtp. bin/cs: Fixing script according to shellcheck. .config/packages-community.txt: Adding nextcloud-app-spreed. .vim/addons-settings.vim: Adding supercollider settings for split in tmux. .config/linuxsampler.org/Qsampler.conf: Remove, because it makes no sense in repo. ...
Diffstat (limited to 'bin/xorg_autolock')
-rwxr-xr-xbin/xorg_autolock11
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!"