sway: update swayidle cmd

* use 'output * power ...' instead of 'output * dpms ...'
* rm the command instructing outputs to sleep 10s after screen locking
* maintain the periodic (every 15s) check for swaylock that turns of
  outputs if swaylock is running (saves energy)
This commit is contained in:
leo 2023-06-06 15:51:30 +02:00
parent 08fbf762f2
commit 6bcedda326
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ

@ -94,9 +94,8 @@ exec_always --no-startup-id
swayidle -w \
timeout 545 'pgrep -u $(id -u) swaylock || notify-send -t 15000 -u critical -i "Idle timeout" "Screen is locking soon"' \
timeout 600 "$lock" \
timeout 610 'swaymsg "output * dpms off"' \
timeout 15 'pgrep -u $(id -u) swaylock && swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
timeout 15 'pgrep -u $(id -u) swaylock && swaymsg "output * power off"' \
resume 'swaymsg "output * power on"' \
before-sleep "pgrep -u $(id -u) swaylock || $lockt"
}
@ -123,9 +122,8 @@ exec --no-startup-id {
pgrep -u $(id -u) swayidle || swayidle -w \
timeout 545 'pgrep -u $(id -u) swaylock || notify-send -t 15000 -u critical -i "Idle timeout" "Screen is locking soon"' \
timeout 600 "$lock" \
timeout 610 'swaymsg "output * dpms off"' \
timeout 15 'pgrep -u $(id -u) swaylock && swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
timeout 15 'pgrep -u $(id -u) swaylock && swaymsg "output * power off"' \
resume 'swaymsg "output * power on"' \
before-sleep "pgrep -u $(id -u) swaylock || $lockt"
}