battery

package
v0.0.0-...-a534134 Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseBatteryPath = "/sys/class/power_supply"
	BatteryPath     = BaseBatteryPath + "/%v/uevent"
)

Variables

This section is empty.

Functions

func BatteryDiscover

func BatteryDiscover(names map[string]string, WarnThreshold, CritThreshold int) (i3.Generator, error)

Discovers batteries on your machine, and returns an OrderedMultiGenerator for each. Include a map of lowercase interface names to friendly names to display the batteries with friendly names.

Types

type Battery

type Battery struct {
	// A friently name used to show the battery in the taskbar. Can be empty.
	Name string
	// A short string used to identify the battery to the system, e.g. BAT0.
	// Should be found in /sys/class/power_supply/<BATTERY_ID>
	Identifier string

	// If the battery level is below this percentage amount, the battery will
	// be rendered int a warning colour
	WarnThreshold int
	// If the battery level is below this percentage amount, the battery will
	// be rendered int a critical colour
	CritThreshold int
	// contains filtered or unexported fields
}

func (*Battery) Crit

func (b *Battery) Crit() bool

func (*Battery) Generate

func (b *Battery) Generate() (out []i3.Output, err error)

Generate implements Generator

func (*Battery) Warn

func (b *Battery) Warn() bool

Jump to

Keyboard shortcuts

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