Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Caffeinate ¶
type Caffeinate struct {
//-d: Prevent the display from sleeping.
Display bool
//-i: Prevent the system from idle sleeping.
IdleSystem bool
//-m: Prevent the disk from idle sleeping.
IdleDisk bool
//-s: Prevent the system from sleeping. Valid only on AC power.
System bool
//-u: Declare that user is active. Turns display on if off. Default 5 second timeout if no timeout set.
UserActive bool
//-t: Specifies the timeout value in seconds
Timeout int
//-w: Specifies pid to wait for.
PID int
// contains filtered or unexported fields
}
Caffeinate represents an invokation of the osx 'caffeinate' command
func (*Caffeinate) CaffeinatePID ¶
func (c *Caffeinate) CaffeinatePID() int
CaffeinatePID returns the pid of caffeinate, if it's running
func (*Caffeinate) Running ¶
func (c *Caffeinate) Running() bool
Running returns whether caffeinate is currently running
func (*Caffeinate) Start ¶
func (c *Caffeinate) Start()
Start the caffeinate command with these settings
func (*Caffeinate) Wait ¶
func (c *Caffeinate) Wait() error
Wait blocks until the caffeinate command exits
Click to show internal directories.
Click to hide internal directories.