# Idle management (hypridle). Conservative, mainstream-OS-like defaults:
# dim -> screen off -> lock -> suspend, all respecting idle inhibitors (so media
# playback, etc. won't dim or suspend the machine). Vendor-neutral: nothing here
# is Intel/AMD specific.
general {
    lock_cmd         = pidof hyprlock || hyprlock
    before_sleep_cmd = loginctl lock-session
    after_sleep_cmd  = hyprctl dispatch dpms on
    ignore_dbus_inhibit = false
}

# Dim the backlight after 5 minutes (restored on activity). No-op on hardware
# without a backlight (desktops / VMs).
listener {
    timeout    = 300
    on-timeout = brightnessctl -s set 10%
    on-resume  = brightnessctl -r
}

# Turn the display off after 8 minutes.
listener {
    timeout    = 480
    on-timeout = hyprctl dispatch dpms off
    on-resume  = hyprctl dispatch dpms on
}

# Lock shortly after the screen turns off.
listener {
    timeout    = 510
    on-timeout = loginctl lock-session
}

# Suspend after 20 minutes of inactivity (skipped while something inhibits idle).
listener {
    timeout    = 1200
    on-timeout = systemctl suspend
}
