summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-02-24 10:29:44 -0600
committerzachir <zachir@librem.one>2023-02-24 10:29:44 -0600
commite1b62d8c73819f77972a79d3c0d02f89748a5d24 (patch)
tree112f50dfa854e4cba42627673e8fbe75c505d849
parent25476a257a0a1686a2a7e518ee452ca24be28d65 (diff)
separate lock scripts for waylock and slock
-rwxr-xr-xslockd11
-rwxr-xr-xwaylockd7
2 files changed, 10 insertions, 8 deletions
diff --git a/slockd b/slockd
index 55fc66a..c2824b3 100755
--- a/slockd
+++ b/slockd
@@ -1,12 +1,7 @@
#!/bin/sh
-if [ -z "$WAYLAND_DISPLAY" ]; then
- LOCKER=slock
-else
- LOCKER=waylock
-fi
+[ "$(pgrep -U$(whoami) -x slockd | wc -l)" -gt "2" ] && echo "true"
-
-while [ 1 -gt 0 ]; do
- $LOCKER && exit
+while true; do
+ slock && exit
done
diff --git a/waylockd b/waylockd
new file mode 100755
index 0000000..b371abd
--- /dev/null
+++ b/waylockd
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+[ "$(pgrep -U$(whoami) -x waylockd | wc -l)" -gt "2" ] && echo "true"
+
+while true; do
+ cat ~/.config/waylock/config | xargs waylock && exit
+done