summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscreen-locker.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/screen-locker.sh b/screen-locker.sh
index b1fb594..8950978 100755
--- a/screen-locker.sh
+++ b/screen-locker.sh
@@ -14,8 +14,22 @@ revert() {
logger "unlocking screen"
}
trap revert SIGHUP SIGINT SIGTERM EXIT
+
+# XXX: this seems to be broken so we also have our own loop to do essentially the same
xset +dpms dpms 10 10 10
-xset dpms force off
+dpms-loop() {
+ exec 9>&-
+
+ sleep 20
+ while pidof i3lock &> /dev/null; do
+ xset dpms force off
+ sleep 30
+ done
+}
+
+dpms-loop &
+loop_pid=$!
+
logger "locking screen"
i3lock -n -c 000000