From 25a6797b0c635a769a3298013efc511049cf8cb7 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Sun, 25 Mar 2018 16:03:10 +0200 Subject: [PATCH] lock.sh: enable screen blank --- lock.sh | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/lock.sh b/lock.sh index 35091bc..d509af5 100755 --- a/lock.sh +++ b/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