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 ;;