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 #!/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 # Options to pass to i3lock
i3lock_options="-I 5 -c 777777" i3lock_options="-c 777777"
# Run before starting the locker xset +dpms dpms 5 5 5
pre_lock() { revert_dpms() { xset dpms 0 0 0; }
#mpc pause trap revert_dpms EXIT
return
}
# Run after the locker exits # pre_lock
post_lock() {
return
}
###############################################################################
pre_lock
# We set a trap to kill the locker if we get killed, then start the locker and # 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 # 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 else
trap 'kill %%' TERM INT trap 'kill %%' TERM INT
i3lock -n $i3lock_options & i3lock -n $i3lock_options &
sleep 1; xset dpms force off sleep 0.1; xset dpms force off
wait wait
fi fi
post_lock # post_lock