Documentation
¶
Overview ¶
Package awake keeps the machine from idling into sleep while a session is working, the way a media player does while it plays. Lock the screen and the agents go on; leave the machine at an idle prompt and it sleeps as it always did. What is held is the OS's own idle-sleep assertion, so `powercfg /requests`, `pmset -g assertions` and `systemd-inhibit --list` all name lich as the holder, and the user's own sleep policy is what decides the rest: a closed lid, a chosen Sleep and a critical battery all still sleep.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper turns a count of working sessions into one held assertion.
func (*Keeper) Set ¶
Set reports how many sessions are working right now. The assertion is taken on the first and let go on the last; the numbers in between change nothing. A hold that fails is logged and tried again on the next rise from zero, so a machine without the tool (a Linux without systemd) costs one log line per burst of work, never a stuck session.
The lock is held across the hold itself, which spawns a process on macOS and Linux. That costs milliseconds and buys the ordering: a release can never overtake the hold it undoes.