lock.sh: enable screen blank

This commit is contained in:
Gabriel Ebner 2018-03-25 16:03:10 +02:00
parent ea5af1c367
commit 25a6797b0c

28
lock.sh

@ -1,27 +1,13 @@
#!/usr/bin/env bash
# Example locker script -- demonstrates how to use the --transfer-sleep-lock
# option with i3lock's forking mode to delay sleep until the screen is locked.
## CONFIGURATION ##############################################################
# Options to pass to i3lock
i3lock_options="-I 5 -c 777777"
i3lock_options="-c 777777"
# Run before starting the locker
pre_lock() {
#mpc pause
return
}
xset +dpms dpms 5 5 5
revert_dpms() { xset dpms 0 0 0; }
trap revert_dpms EXIT
# Run after the locker exits
post_lock() {
return
}
###############################################################################
pre_lock
# pre_lock
# We set a trap to kill the locker if we get killed, then start the locker and
# wait for it to exit. The waiting is not that straightforward when the locker
@ -45,8 +31,8 @@ if [[ -e /dev/fd/${XSS_SLEEP_LOCK_FD:--1} ]]; then
else
trap 'kill %%' TERM INT
i3lock -n $i3lock_options &
sleep 1; xset dpms force off
sleep 0.1; xset dpms force off
wait
fi
post_lock
# post_lock