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