lock: sleep a bit to let i3lock lock the screen

We could let i3lock fork to notify us but then, we have to spy on it to
know when the screen is unlocked.
This commit is contained in:
Vincent Bernat 2014-09-12 14:53:59 +02:00
parent 097e076694
commit bfb8c77781

View file

@ -26,6 +26,7 @@ case "$1" in
if [ -e /proc/self/fd/${XSS_SLEEP_LOCK_FD:--1} ]; then if [ -e /proc/self/fd/${XSS_SLEEP_LOCK_FD:--1} ]; then
trap 'kill %%' TERM INT trap 'kill %%' TERM INT
i3lock -n $i3lock_options {XSS_SLEEP_LOCK_FD}<&- & i3lock -n $i3lock_options {XSS_SLEEP_LOCK_FD}<&- &
sleep 0.3 # Slight race condition, better than an active loop
exec {XSS_SLEEP_LOCK_FD}<&- exec {XSS_SLEEP_LOCK_FD}<&-
wait wait
else else