lock.sh: Use xset in a sane way to re-blank screen on idle during lock

This commit is contained in:
Adam Goldsmith 2018-11-09 12:18:45 -05:00
parent 0ea8d1d9ed
commit aedf9ae135

View File

@ -16,14 +16,11 @@ lock() {
case "$1" in case "$1" in
lock) lock)
lock trap "xset dpms 0 0 0" HUP INT TERM
# set dpms time to argument, or 0 if none given
# if given an argument, turn off the screen after that many seconds xset +dpms dpms ${2-0} ${2-0} ${2-0}
if [[ $2 && ${2-x} ]] lock ${2+"--nofork"}
then xset dpms 0 0 0
sleep $2
xset dpms force off
fi
;; ;;
logout) logout)
i3-msg exit i3-msg exit