sway: Add lockscript to force displays off

This commit is contained in:
histalek 2021-11-17 12:14:13 +01:00
parent 28798e5968
commit f1f8b9e810
No known key found for this signature in database
GPG key ID: ED1D6449704FDE03
2 changed files with 8 additions and 1 deletions

View file

@ -23,7 +23,8 @@
bindsym $mod+Shift+c reload
# Lock the screen
bindsym Mod5+l exec swaylock -c 000000
#bindsym Mod5+l exec swaylock -c 000000
bindsym Mod5+l exec ~/.local/bin/scripts/lock_script
# Select area for screenshot and copy to clipboard
bindsym $mod+Shift+s exec IMG=~/Pictures/$(date +%Y-%m-%d_%H-%m-%s).png && grim -g "$(slurp)" $IMG && wl-copy < $IMG

6
.local/bin/scripts/lock_script Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
swayidle -w \
timeout 1 'swaylock -f -c 000000' \
timeout 2 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"; pkill -nx swayidle'