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: Dim monitor at 115 sec idle (warning that it will lock soon) listener { timeout = 115 # Only dims the screen, does not lock yet # This shows you that lock will happen soon on-timeout = dim on-resume = pkill -x dim } # Step 2: 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 }