Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct { sync.Mutex PID int Duration time.Duration Signals chan os.Signal // contains filtered or unexported fields }
func New ¶
Creates a New session instance with duration.
If the session's duration is 0, the session will stop after a termination signal or a call to session.Stop.
func (*Session) Kill ¶
Kill terminates the current session.
Can be called only when Wait is running in the background.
func (*Session) Start ¶
Starts the session (according to https://people.freedesktop.org/~hadess/idle-inhibition-spec/re01.html) with a call to the D-BUS screensaver inhibitor.
A non-nil error is returned if the D-BUS session connection fails, if the inhabitation call fails or if the cookie recovery fails.
func (*Session) Stop ¶
Stop kills an already-started session while Wait is not running in the background.
This method is recommended for uses in which the session is required to terminate only by the calling program, and not by the user.