From 031da040800d5763897136c74e676ebd80eb7bfa Mon Sep 17 00:00:00 2001 From: exu Date: Fri, 24 Nov 2023 17:04:12 +0100 Subject: [PATCH] Implement exit script --- arch-config/.config/sway/config | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arch-config/.config/sway/config b/arch-config/.config/sway/config index 62258c18..0d1cf07f 100644 --- a/arch-config/.config/sway/config +++ b/arch-config/.config/sway/config @@ -79,9 +79,10 @@ output "Acer Technologies XV272U V R307036FE4208" adaptive_sync on # -c 000000 sets the color in RGB (no alpha supported) # use -i to set an image exec swayidle -w \ - timeout 300 'swaylock -f -e -i "$HOME/.cache/backgrounds/lockscreen"' \ - timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ - before-sleep 'swaylock -f -e -i "$HOME/.cache/backgrounds/lockscreen"' + timeout 300 'swaylock -f -e -i "$HOME/.cache/backgrounds/lockscreen"' \ # lock screen after 5 min + timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ # poweroff display after 10 min + before-sleep 'swaylock -f -e -i "$HOME/.cache/backgrounds/lockscreen"' \ # lock screen before going to sleep + before-sleep 'playerctl pause' # pause media before sleeping ### Key bindings # @@ -238,11 +239,11 @@ bindsym $mod+x mode "$mode_system" set $mode_system System (l) lock, (e) logout, (r) reboot, (s) shutdown, (u) suspend mode "$mode_system" { - bindsym l exec PLACEHOLDER, mode "default" - bindsym e exec PLACEHOLDER, mode "default" - bindsym r exec PLACEHOLDER, mode "default" - bindsym s exec PLACEHOLDER, mode "default" - bindsym u exec PLACEHOLDER, mode "default" + bindsym l exec --no-startup-id ~/.config/sway/sway-scripts/exit.sh lock, mode "default" + bindsym e exec --no-startup-id ~/.config/sway/sway-scripts/exit.sh logout, mode "default" + bindsym r exec --no-startup-id ~/.config/sway/sway-scripts/exit.sh reboot, mode "default" + bindsym s exec --no-startup-id ~/.config/sway/sway-scripts/exit.sh shutdown, mode "default" + bindsym u exec --no-startup-id ~/.config/sway/sway-scripts/exit.sh suspend, mode "default" # back to normal: Enter or Escape bindsym Return mode "default"