dim creates a wlr-layer-shell surface that Hyprland never cleans up when the process exits — leaves an opaque full-screen overlay (pid=-1) covering the entire display until the layer tree is rebuilt. Removing step 1 (dim) from hypridle prevents future occurrences. unstick-display.sh now restarts waybar to force a layer tree rebuild as a recovery measure.
49 lines
1.8 KiB
Text
49 lines
1.8 KiB
Text
general {
|
|
inhibit_sleep = 3
|
|
lock_cmd = pidof hyprlock || ~/.config/hypr/scripts/lock.sh
|
|
before_sleep_cmd = loginctl lock-session
|
|
# Cycle dpms off/on after resume: forces Hyprland to recreate the hyprlock
|
|
# surfaces and re-grant them keyboard focus, which is otherwise lost after
|
|
# suspend (hyprlock shows the clock but ignores typing until a dpms cycle)
|
|
after_sleep_cmd = hyprctl dispatch dpms off && sleep 1 && hyprctl dispatch dpms on
|
|
}
|
|
|
|
# Step 1: Lock screen at 2 min idle
|
|
listener {
|
|
timeout = 120
|
|
on-timeout = ~/.config/hypr/scripts/lock.sh
|
|
on-resume = wpctl set-mute @DEFAULT_AUDIO_SINK@ 0
|
|
}
|
|
|
|
# Step 3: Turn screen off at 5 min idle
|
|
listener {
|
|
timeout = 300
|
|
on-timeout = hyprctl dispatch dpms off && ddcutil setvcp 10 0
|
|
|
|
# Explanation:
|
|
# - hyprctl dispatch dpms off → tells the compositor to power off the display (DPMS standby)
|
|
# - ddcutil setvcp 10 0 → sets monitor brightness to 0 at the hardware level (safe for OLED)
|
|
#
|
|
# Both together ensure the screen is fully off visually and electrically
|
|
|
|
# When the user becomes active again, restore display
|
|
#
|
|
# Cycles DPMS only if the display was actually turned off (avoids flicker
|
|
# when the user returns before step 3 fires). Needed because otherwise
|
|
# hyprlock surfaces may lose focus after a dpms off cycle
|
|
# (same issue covered in after_sleep_cmd above).
|
|
on-resume = ~/.config/hypr/scripts/wake-display.sh
|
|
|
|
# Explanation:
|
|
# - wake-display.sh checks if dpms is off; only then does a dpms off/on
|
|
# cycle to force Hyprland to recreate hyprlock surfaces
|
|
# - ddcutil setvcp 10 100 → restores monitor brightness to full
|
|
#
|
|
# Both together guarantee the screen wakes reliably
|
|
}
|
|
|
|
# Step 4: Suspend system after 30 min idle
|
|
listener {
|
|
timeout = 1800
|
|
on-timeout = systemctl suspend
|
|
}
|