summaryrefslogtreecommitdiff
path: root/.config/i3/extra/lidlock
diff options
context:
space:
mode:
authoradamstuck <adam.moloney.stuck@gmail.com>2021-12-02 18:37:46 +0100
committeradamstuck <adam.moloney.stuck@gmail.com>2021-12-02 18:37:46 +0100
commit75fa432a58cb228b4fdefc309cc015b7329c7e1a (patch)
treec188fa6f19f0254e2caff44b4fd487ecbfbe20f8 /.config/i3/extra/lidlock
parentfd62a841dbc387a8c51f49ef14e5d37ff4126700 (diff)
Lock now turns off screen instead of suspend
Diffstat (limited to '.config/i3/extra/lidlock')
-rwxr-xr-x.config/i3/extra/lidlock21
1 files changed, 21 insertions, 0 deletions
diff --git a/.config/i3/extra/lidlock b/.config/i3/extra/lidlock
new file mode 100755
index 0000000..81b3b49
--- /dev/null
+++ b/.config/i3/extra/lidlock
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+get_state() {
+ echo $(cat /proc/acpi/button/lid/LID0/state)
+}
+
+OLD_STATE=$(get_state)
+
+while :
+do
+ CUR_STATE=$(get_state)
+
+ if [ "$CUR_STATE" != "$OLD_STATE" ]; then
+ if echo $CUR_STATE | grep closed; then
+ betterlockscreen -l
+ fi
+ fi
+
+ OLD_STATE=$CUR_STATE
+ sleep 1
+done