sway(swayidle): no user check on single-user systems

This commit is contained in:
surtur 2024-04-02 18:04:14 +02:00
parent 538fc6ba6e
commit 10098efaf4
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI

@ -114,17 +114,17 @@ exec_always --no-startup-id
pgrep -u $(id -u) mako && pkill mako pgrep -u $(id -u) mako && pkill mako
pgrep -u $(id -u) fusuma && pkill fusuma pgrep -u $(id -u) fusuma && pkill fusuma
pgrep -u $(id -u) swayrd && pkill swayrd pgrep -u $(id -u) swayrd && pkill swayrd
pgrep -u $(id -u) swayidle && pkill swayidle pgrep swayidle && pkill swayidle
mako mako
XDG_CURRENT_DESKTOP=gnome fusuma -d -c ~/.config/fusuma/config-wl.yml XDG_CURRENT_DESKTOP=gnome fusuma -d -c ~/.config/fusuma/config-wl.yml
env RUST_BACKTRACE=1 swayrd > /tmp/swayrd.log 2>&1 env RUST_BACKTRACE=1 swayrd > /tmp/swayrd.log 2>&1
swayidle -w \ swayidle -w \
timeout 545 'pgrep -u $(id -u) swaylock || notify-send -t 15000 -u critical -i "Idle timeout" "Screen is locking soon"' \ timeout 545 'pgrep swaylock || notify-send -t 18000 -u normal "Idle timeout" "Screen is locking soon"' \
timeout 600 "$lock" \ timeout 600 "$lock" \
timeout 15 'pgrep -u $(id -u) swaylock && swaymsg "output * power off"' \ timeout 15 'pgrep swaylock && swaymsg "output * power off"' \
resume 'swaymsg "output * power on"' \ resume 'swaymsg "output * power on"' \
before-sleep "pgrep -u $(id -u) swaylock || $lockt" before-sleep "pgrep swaylock || $lockt"
} }
exec --no-startup-id { exec --no-startup-id {
@ -142,12 +142,13 @@ exec --no-startup-id {
# XDG_SESSION_TYPE=x11 XDG_CURRENT_DESKTOP=gnome fusuma -d -c ~/.config/fusuma/config-wl.yml # XDG_SESSION_TYPE=x11 XDG_CURRENT_DESKTOP=gnome fusuma -d -c ~/.config/fusuma/config-wl.yml
pgrep -u $(id -u) fusuma || XDG_CURRENT_DESKTOP=gnome fusuma -d -c ~/.config/fusuma/config-wl.yml pgrep -u $(id -u) fusuma || XDG_CURRENT_DESKTOP=gnome fusuma -d -c ~/.config/fusuma/config-wl.yml
env RUST_BACKTRACE=1 swayrd > /tmp/swayrd.log 2>&1 env RUST_BACKTRACE=1 swayrd > /tmp/swayrd.log 2>&1
pgrep -u $(id -u) swayidle || swayidle -w \ pgrep swayidle || \
timeout 545 'pgrep -u $(id -u) swaylock || notify-send -t 15000 -u critical -i "Idle timeout" "Screen is locking soon"' \ swayidle -w \
timeout 545 'pgrep swaylock || notify-send -t 18000 -u normal "Idle timeout" "Screen is locking soon"' \
timeout 600 "$lock" \ timeout 600 "$lock" \
timeout 15 'pgrep -u $(id -u) swaylock && swaymsg "output * power off"' \ timeout 15 'pgrep swaylock && swaymsg "output * power off"' \
resume 'swaymsg "output * power on"' \ resume 'swaymsg "output * power on"' \
before-sleep "pgrep -u $(id -u) swaylock || $lockt" before-sleep "pgrep swaylock || $lockt"
} }
bindsym ctrl+alt+l exec --no-startup-id $lock bindsym ctrl+alt+l exec --no-startup-id $lock