hypr-dotfiles/hypr/hypridle.conf
2025-09-13 22:24:58 +09:00

54 lines
1.7 KiB
Text

general {
# Define the lock command for hypridle
# This is used whenever hypridle or listeners need to lock the screen
lock_cmd = pidof hyprlock || hyprlock
# Runs before system suspend (safety net if you manually suspend)
# On a desktop, you can remove this if you never suspend manually
before_sleep_cmd = ~/.config/hypr/scripts/lock.sh
# Restore screen after sleep
after_sleep_cmd = 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
}
# 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
on-resume = hyprctl dispatch dpms on && ddcutil setvcp 10 100
# Explanation:
# - hyprctl dispatch dpms on → ensures the display is powered on by the compositor
# - ddcutil setvcp 10 100 → restores monitor brightness to full
#
# Both together guarantee the screen wakes reliably on all monitors
}
# Step 4: Suspend system after 30 min idle
listener {
timeout = 1800
on-timeout = systemctl suspend
}