summaryrefslogtreecommitdiff
path: root/swaylockd
diff options
context:
space:
mode:
Diffstat (limited to 'swaylockd')
-rwxr-xr-xswaylockd8
1 files changed, 8 insertions, 0 deletions
diff --git a/swaylockd b/swaylockd
new file mode 100755
index 0000000..76208ee
--- /dev/null
+++ b/swaylockd
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+WLCNT="$(pgrep -U$(whoami) -x waylockd | wc -l)"
+[ "${WLCNT:-0}" -gt "2" ] && printf "Already running!\n" && exit
+
+while true; do
+ swaylock && exit
+done