dpms

package
v0.0.0-...-e5c115e Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Enabled bool
	// contains filtered or unexported fields
}

Info contains the current DPMS status. It also exposes controller methods to change the DPMS status.

func (Info) Disable

func (i Info) Disable()

Disable disables DPMS.

func (Info) Enable

func (i Info) Enable()

Enable enables DPMS.

func (Info) String

func (i Info) String() string

String implements fmt.Stringer.

func (Info) Toggle

func (i Info) Toggle()

Toggle enables DPMS if it is disabled and vice versa.

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module is a module for displaying and interacting with the current DPMS status.

func New

func New(provider Provider) *Module

New creates a new *Module which uses given provider to query and update the DPMS status. By default, the module will refresh every minute. The refresh interval can be configured using `Every`.

func (*Module) Every

func (m *Module) Every(interval time.Duration) *Module

Every configures the refresh interval for the module. Passing a zero interval will disable refreshing.

func (*Module) Output

func (m *Module) Output(format func(Info) bar.Output) *Module

Output updates the output format func.

func (*Module) Refresh

func (m *Module) Refresh()

Refresh forces a refresh of the module output.

func (*Module) Stream

func (m *Module) Stream(s bar.Sink)

Stream implements bar.Module.

type Provider

type Provider interface {
	// Get retrieves the current DPMS status, returning true if it is enabled.
	Get() (bool, error)

	// Set enables or disables DPMS.
	Set(enabled bool) error
}

Provider provides means the get and set the DPMS status.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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