From aedf9ae13555d53dc070bc737c0b0dc2f23f3e52 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Fri, 9 Nov 2018 12:18:45 -0500 Subject: [PATCH] lock.sh: Use xset in a sane way to re-blank screen on idle during lock --- .config/i3/lock.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.config/i3/lock.sh b/.config/i3/lock.sh index a6ee73f..44eaffc 100755 --- a/.config/i3/lock.sh +++ b/.config/i3/lock.sh @@ -16,14 +16,11 @@ lock() { case "$1" in lock) - lock - - # if given an argument, turn off the screen after that many seconds - if [[ $2 && ${2-x} ]] - then - sleep $2 - xset dpms force off - fi + trap "xset dpms 0 0 0" HUP INT TERM + # set dpms time to argument, or 0 if none given + xset +dpms dpms ${2-0} ${2-0} ${2-0} + lock ${2+"--nofork"} + xset dpms 0 0 0 ;; logout) i3-msg exit