From 75fa432a58cb228b4fdefc309cc015b7329c7e1a Mon Sep 17 00:00:00 2001 From: adamstuck Date: Thu, 2 Dec 2021 18:37:46 +0100 Subject: Lock now turns off screen instead of suspend --- .config/i3/extra/lidlock | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 .config/i3/extra/lidlock (limited to '.config/i3/extra/lidlock') 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 -- cgit v1.2.3-70-g09d2