power

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package power keeps this machine awake while it hosts, and locks it.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupported = errors.New("power: not supported on this platform")

Functions

func KeepAwake

func KeepAwake(reason string) (release func(), err error)

KeepAwake stops the screen saver and idle suspend until release, through the session's org.freedesktop.ScreenSaver service (GNOME, KDE and most others) and a logind idle:sleep inhibitor lock. It succeeds when either takes hold.

func LockScreen

func LockScreen() error

LockScreen locks this process's login session, as loginctl lock-session does; the desktop's screen locker answers the signal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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