# Idle / lock for SWAY (wlroots), not Hyprland. # # Two things in the original Hyprland template silently did nothing under sway: # * `loginctl lock-session` -> sway implements no freedesktop login1 Session # Lock protocol, so it is a no-op. Lock directly. # * `hyprctl dispatch dpms` -> "HYPRLAND_INSTANCE_SIGNATURE not set!". # Use `swaymsg "output * power on|off"`. # Also: a hyprlock instance can outlive a sway session and then make the # `pidof hyprlock || hyprlock` guard a permanent no-op; the sway config kills # leftovers at login (`exec --no-startup-id pkill -x hyprlock`). general { lock_cmd = pidof hyprlock || hyprlock # pre-suspend uses swaylock: fast, sway-native, exits cleanly (no leak) before_sleep_cmd = swaylock -f -c 000000 # DPMS "power on" alone does not clear a post-resume eDP page-flip stall # ("Atomic commit failed: Device or resource busy" for tens of minutes). # The script does a full disable/enable (forced modeset) but ONLY when the # journal actually shows the stall -- it used to fire unconditionally, which # risked the shikane VariantInProgress deadlock on healthy resumes. The # original i915 PSR2/DC4 cause is gone; this laptop uses the `xe` driver. # Lid-aware so it does not race shikane's "External Display" profile. after_sleep_cmd = /home/work/.config/sway/scripts/recover-output-after-resume.sh } listener { timeout = 150 # 2.5min on-timeout = brightnessctl -s set 10 on-resume = brightnessctl -r } # keyboard backlight listener { timeout = 150 on-timeout = brightnessctl -sd rgb:kbd_backlight set 0 on-resume = brightnessctl -rd rgb:kbd_backlight } listener { timeout = 300 # 5min -> lock on-timeout = pidof hyprlock || hyprlock } listener { timeout = 330 # 5.5min -> output power off on-timeout = swaymsg "output * power off" on-resume = swaymsg "output * power on" && brightnessctl -r }