sway: Dim screen before locking
This commit is contained in:
parent
d94bcbe93e
commit
74d28e370f
2 changed files with 14 additions and 3 deletions
9
bin/_locker
Executable file
9
bin/_locker
Executable file
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [ "${1-}" = 'dim' ]; then
|
||||||
|
chayang
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec swaylock -f -e -F -k -l -c 000000 --indicator-idle-visible
|
||||||
|
|
@ -129,12 +129,14 @@ bar {
|
||||||
swaybar_command waybar
|
swaybar_command waybar
|
||||||
}
|
}
|
||||||
|
|
||||||
set $locker 'swaylock -f -e -F -k -l -c 000000 --indicator-idle-visible'
|
set $locker '_locker'
|
||||||
|
set $dimmer '_locker dim'
|
||||||
|
set $suspend 'systemctl suspend'
|
||||||
bindsym $super+Shift+semicolon exec $locker
|
bindsym $super+Shift+semicolon exec $locker
|
||||||
# Automatically lock after 5 minutes, suspend after 5 more
|
# Automatically lock after 5 minutes, suspend after 5 more
|
||||||
exec swayidle -w \
|
exec swayidle -w \
|
||||||
timeout 300 $locker \
|
timeout 300 $dimmer \
|
||||||
timeout 600 'systemctl suspend' \
|
timeout 600 $suspend \
|
||||||
before-sleep $locker
|
before-sleep $locker
|
||||||
|
|
||||||
# Only show borders if there's more than one window
|
# Only show borders if there's more than one window
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue