lidguard-power-runtimelisted
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