From bd807d5f4cc720ee78439fb6fedcf9453de6f439 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sun, 14 Sep 2014 18:55:57 +0200 Subject: [PATCH] lock: don't dim, use a notification One time out of two, the screen will stay black. Moreover, since this is not incorruptible, it is cumbersome to cancel it. --- bin/xss-lock | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/bin/xss-lock b/bin/xss-lock index c667b41..a6fb8f4 100755 --- a/bin/xss-lock +++ b/bin/xss-lock @@ -8,18 +8,15 @@ case "$1" in start) xset s $(($timeout - $notify)) $notify xset dpms $(($timeout * 2)) $(($timeout * 3)) $(($timeout * 4)) - exec xss-lock -n "$me dim" -l $me lock + exec xss-lock -n "$me notify" -l $me lock ;; - dim) - echo "$(date --rfc-3339=seconds) $me: dim: start" + dim|notify) + echo "$(date --rfc-3339=seconds) $me: notify: start" trap 'exit 0' TERM INT - trap "kill %% ; wait ; xbacklight -steps 1 -set $(xbacklight -get)" EXIT - min_brightness=1 - fade_time=$(($notify * 1000 - 1000)) - fade_steps=100 - xbacklight -time $fade_time -steps $fade_steps -set $min_brightness & - wait - echo "$(date --rfc-3339=seconds) $me: dim: end" + trap "kill %% ; wait" EXIT + notify-send "Lock screen" -t $(($notify * 1000)) \ + "Screen will be locked in 10 seconds..." + echo "$(date --rfc-3339=seconds) $me: notify: end" sleep 2147483647 & wait ;;