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 }
Click to show internal directories.
Click to hide internal directories.