From 7608b66ca9b25ad6b41e327f5769e9c4c3d54f57 Mon Sep 17 00:00:00 2001 From: RealStickman Date: Wed, 20 Jul 2022 16:00:15 +0200 Subject: [PATCH] Auto lock and sleep --- arch-config/.config/sway/config | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch-config/.config/sway/config b/arch-config/.config/sway/config index df7fd062..a58c185f 100644 --- a/arch-config/.config/sway/config +++ b/arch-config/.config/sway/config @@ -40,10 +40,10 @@ input * { } ### Output configuration -# + # Default wallpaper (more resolutions are available in @datadir@/backgrounds/sway/) output * bg ~/.cache/betterlockscreen/current/wall_dim.png fill -# + # Example configuration: # # output HDMI-A-1 resolution 1920x1080 position 1920,0 @@ -63,6 +63,11 @@ output * bg ~/.cache/betterlockscreen/current/wall_dim.png fill # your displays after another 300 seconds, and turn your screens back on when # resumed. It will also lock your screen before your computer goes to sleep. +exec swayidle -w \ + timeout 20 'swaylock -f -c 000000' \ + timeout 40 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ + before-sleep 'swaylock -f -c 000000' + ### Input configuration # # Example configuration: