← ClaudeAtlas

lidguard-power-runtimelisted

LidGuard power, lid, suspend, and thermal behavior reference. Use when working on Windows/Linux/macOS keep-awake control, lid close policy, lid state, monitor-based suspend eligibility, post-stop suspend flow, or Emergency Hibernation.
airtaxi/LidGuard · ★ 7 · AI & Automation · score 76
Install: claude install-skill airtaxi/LidGuard
# LidGuard Power Runtime ## Platform Power Control ### Windows - Use `PowerCreateRequest`, `PowerSetRequest`, and `PowerClearRequest` for normal idle sleep prevention. - Use `PowerRequestSystemRequired` to prevent idle system sleep. - Use `PowerRequestAwayModeRequired` to request away-mode behavior where supported. - Keep `PowerRequestDisplayRequired` optional; use it only when display sleep should also be prevented. - Always clear power requests and close handles when protection ends. - Do not change sleep idle timeouts. Runtime crashes could leave the user's system policy in a dangerous state. ### Linux - Target systemd/logind environments. - Use `systemd-inhibit` block inhibitors for normal sleep and idle prevention. - Map `PreventSystemSleep` to the `sleep` inhibitor. - Map `PreventSystemSleep` and `PreventDisplaySleep` to the `idle` inhibitor. - Keep `PreventAwayModeSleep` Windows-only; do not expose or apply it in Linux settings/help output. - Map temporary lid-close protection to a separate `handle-lid-switch` inhibitor only when `ChangeLidAction` is enabled. - Keep `SystemdInhibitor` releasing normally by closing stdin on the helper process; use process-tree kill only as fallback. - Tie inhibitor helper processes to the LidGuard runtime lifetime so stale orphaned inhibitors do not survive the runtime. - Request immediate sleep/hibernate with `systemctl suspend` or `systemctl hibernate`, returning exit code/stderr when the request fails. - Keep Linux as a supporte