mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-03 23:04:21 +02:00
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.
This commit is contained in:
parent
863f117243
commit
bd807d5f4c
1 changed files with 7 additions and 10 deletions
17
bin/xss-lock
17
bin/xss-lock
|
@ -8,18 +8,15 @@ case "$1" in
|
||||||
start)
|
start)
|
||||||
xset s $(($timeout - $notify)) $notify
|
xset s $(($timeout - $notify)) $notify
|
||||||
xset dpms $(($timeout * 2)) $(($timeout * 3)) $(($timeout * 4))
|
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)
|
dim|notify)
|
||||||
echo "$(date --rfc-3339=seconds) $me: dim: start"
|
echo "$(date --rfc-3339=seconds) $me: notify: start"
|
||||||
trap 'exit 0' TERM INT
|
trap 'exit 0' TERM INT
|
||||||
trap "kill %% ; wait ; xbacklight -steps 1 -set $(xbacklight -get)" EXIT
|
trap "kill %% ; wait" EXIT
|
||||||
min_brightness=1
|
notify-send "Lock screen" -t $(($notify * 1000)) \
|
||||||
fade_time=$(($notify * 1000 - 1000))
|
"Screen will be locked in 10 seconds..."
|
||||||
fade_steps=100
|
echo "$(date --rfc-3339=seconds) $me: notify: end"
|
||||||
xbacklight -time $fade_time -steps $fade_steps -set $min_brightness &
|
|
||||||
wait
|
|
||||||
echo "$(date --rfc-3339=seconds) $me: dim: end"
|
|
||||||
sleep 2147483647 &
|
sleep 2147483647 &
|
||||||
wait
|
wait
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue