caffeinate

package module
v0.0.0-...-f1d20cb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2018 License: MIT Imports: 5 Imported by: 1

README

go-caffeinate

Golang library to prevent OSX from sleeping, wrapping the caffeinate command

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) Stop

func (c *Caffeinate) Stop() error

Stop this caffeinate process

func (*Caffeinate) Wait

func (c *Caffeinate) Wait() error

Wait blocks until the caffeinate command exits

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL