Compare commits

..

2 Commits

Author SHA1 Message Date
exu
031da04080 Implement exit script 2023-11-24 17:04:12 +01:00
exu
0e675619a2 Create exit script for sway 2023-11-24 17:04:03 +01:00
2 changed files with 13 additions and 15 deletions

View File

@ -79,9 +79,10 @@ output "Acer Technologies XV272U V R307036FE4208" adaptive_sync on
# -c 000000 sets the color in RGB (no alpha supported) # -c 000000 sets the color in RGB (no alpha supported)
# use -i to set an image # use -i to set an image
exec swayidle -w \ exec swayidle -w \
timeout 300 '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"' \ 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"' 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 ### 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 set $mode_system System (l) lock, (e) logout, (r) reboot, (s) shutdown, (u) suspend
mode "$mode_system" { mode "$mode_system" {
bindsym l exec PLACEHOLDER, mode "default" bindsym l exec --no-startup-id ~/.config/sway/sway-scripts/exit.sh lock, mode "default"
bindsym e exec PLACEHOLDER, mode "default" bindsym e exec --no-startup-id ~/.config/sway/sway-scripts/exit.sh logout, mode "default"
bindsym r exec PLACEHOLDER, mode "default" bindsym r exec --no-startup-id ~/.config/sway/sway-scripts/exit.sh reboot, mode "default"
bindsym s exec PLACEHOLDER, mode "default" bindsym s exec --no-startup-id ~/.config/sway/sway-scripts/exit.sh shutdown, mode "default"
bindsym u exec PLACEHOLDER, mode "default" bindsym u exec --no-startup-id ~/.config/sway/sway-scripts/exit.sh suspend, mode "default"
# back to normal: Enter or Escape # back to normal: Enter or Escape
bindsym Return mode "default" bindsym Return mode "default"

View File

@ -1,20 +1,17 @@
#!/bin/sh #!/usr/bin/env sh
case "$1" in case "$1" in
lock) lock)
#betterlockscreen -l; dunstctl set-paused true swaylock -f -e -i "$HOME/.cache/backgrounds/lockscreen"
betterlockscreen -l
;; ;;
logout) logout)
i3-msg exit swaymsg exit
;; ;;
suspend) suspend)
#betterlockscreen -s
systemctl suspend systemctl suspend
;; ;;
hibernate) hibernate)
systemctl hibernate exit 1
;; ;;
reboot) reboot)
systemctl reboot systemctl reboot