lock: Move disabling DPMS to a function

This commit is contained in:
Adam Goldsmith 2020-11-02 01:26:06 -05:00
parent d6a8bf1b98
commit 90ee7f6d03
1 changed files with 6 additions and 2 deletions

View File

@ -14,13 +14,17 @@ lock() {
--pass-media-keys $@
}
unsetDPMS() {
xset dpms 0 0 0
}
case "$1" in
lock)
trap "xset dpms 0 0 0" HUP INT TERM
trap "unsetDPMS" 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
unsetDPMS
;;
logout)
i3-msg exit