aboutsummaryrefslogtreecommitdiffstats
path: root/bin/xorg_lock
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2018-01-22 22:31:20 +0100
committerDavid Runge <dave@sleepmap.de>2018-01-22 22:31:20 +0100
commita657dd355c4a997c33f0ab3101b7181a7ae03d13 (patch)
treeb3f5667e7dc0f910df1814f67979ad1e47c50a84 /bin/xorg_lock
parentfee8fb086ba8b34e3824844a0f1c30bb0d687736 (diff)
downloaddotfiles-a657dd355c4a997c33f0ab3101b7181a7ae03d13.tar.gz
dotfiles-a657dd355c4a997c33f0ab3101b7181a7ae03d13.tar.bz2
dotfiles-a657dd355c4a997c33f0ab3101b7181a7ae03d13.tar.xz
dotfiles-a657dd355c4a997c33f0ab3101b7181a7ae03d13.zip
bin/xorg_*: Adding scripts to automatically lock X11 using xssstate and i3lock.
Diffstat (limited to 'bin/xorg_lock')
-rwxr-xr-xbin/xorg_lock16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/xorg_lock b/bin/xorg_lock
new file mode 100755
index 0000000..d7a5d52
--- /dev/null
+++ b/bin/xorg_lock
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+lock=${XDG_RUNTIME_DIR}/xorg_autolock.lock
+lockcmd="i3lock -n -e -c 000000 -f"
+
+if [ -x "/usr/bin/i3lock" ]; then
+ touch ${lock}
+ ${lockcmd}
+ rm ${lock}
+else
+ echo "i3lock is not installed!"
+ exit 1
+fi
+exit 0