barista.run: barista.run/modules/cputemp Index | Files

package cputemp

import "barista.run/modules/cputemp"

Package cputemp implements an i3bar module that shows the CPU temperature.

Index

Package Files

cputemp.go

type Module Uses

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

Module represents a cputemp bar module. It supports setting the output format, click handler, update frequency, and urgency/colour functions.

func New Uses

func New() *Module

New constructs an instance of the cputemp module for zone type "x86_pkg_temp". Returns nil of the x86_pkg_temp thermal zone is unavailable.

func OfType Uses

func OfType(typ string) *Module

OfType constructs an instance of the cputemp module for the *first* available sensor of the given type. "x86_pkg_temp" usually represents the temperature of the actual CPU package, while others may be available depending on the system, e.g. "iwlwifi" for wifi, or "acpitz" for the motherboard.

func Zone Uses

func Zone(thermalZone string) *Module

Zone constructs an instance of the cputemp module for the specified zone. The file /sys/class/thermal/<zone>/temp should return cpu temp in 1/1000 deg C.

func (*Module) Output Uses

func (m *Module) Output(outputFunc func(unit.Temperature) bar.Output) *Module

Output configures a module to display the output of a user-defined function.

func (*Module) RefreshInterval Uses

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

RefreshInterval configures the polling frequency for cpu temperatures. Note: updates might still be less frequent if the temperature does not change.

func (*Module) Stream Uses

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

Stream starts the module.

Package cputemp imports 11 packages (graph) and is imported by 2 packages. Updated 2019-01-22. Refresh now. Tools for package owners.