- Add lid-close.sh: starts hyprlock in background and immediately cuts the display via dpms off, so the display is dark while hyprlock renders - William.conf: bind lid close to lid-close.sh; bind lid open to kill dim and turn display back on - lock.sh: pass --no-fade-in to hyprlock - hyprlock.conf: disable fadeOut animation - hypridle.conf: add inhibit_sleep = 3 and use loginctl lock-session
49 lines
1.5 KiB
Text
49 lines
1.5 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 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
|
|
on-resume = hyprctl dispatch dpms on && ddcutil setvcp 10 100 && wpctl set-mute @DEFAULT_AUDIO_SINK@ 0
|
|
|
|
# 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
|
|
}
|