From f1f8b9e810192163548bf91176274b65ba261a53 Mon Sep 17 00:00:00 2001 From: histalek Date: Wed, 17 Nov 2021 12:14:13 +0100 Subject: [PATCH] sway: Add lockscript to force displays off --- .config/sway/conf.d/keybinds | 3 ++- .local/bin/scripts/lock_script | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 .local/bin/scripts/lock_script diff --git a/.config/sway/conf.d/keybinds b/.config/sway/conf.d/keybinds index 3a4bc1a..84708d9 100644 --- a/.config/sway/conf.d/keybinds +++ b/.config/sway/conf.d/keybinds @@ -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 diff --git a/.local/bin/scripts/lock_script b/.local/bin/scripts/lock_script new file mode 100755 index 0000000..c90f2e2 --- /dev/null +++ b/.local/bin/scripts/lock_script @@ -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' +