hypr-dotfiles/hypr/hypridle.conf
Jeena 00d0cac9e8 fix: black screen on wake from suspend (hypridle)
Enable misc:key_press_enables_dpms / mouse_move_enables_dpms so the
compositor re-enables the display on input when hypridle's after-sleep
dpms-on races with GPU resume. Also delay after_sleep_cmd dpms-on by 2s.

Fixes black Hyprland VT after wake while kernel console stays visible.
2026-08-24 10:11:22 +09:00

46 lines
1.6 KiB
Text

general {
inhibit_sleep = 3
lock_cmd = pidof hyprlock || ~/.config/hypr/scripts/lock.sh
before_sleep_cmd = loginctl lock-session
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
}