temperature

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultIcon = ""

DefaultIcon is the Nerd Font codepoint used when the caller doesn't override Temperature.Icon — fa-thermometer.

Variables

This section is empty.

Functions

This section is empty.

Types

type Temperature

type Temperature struct {
	HwmonPath  string
	Critical   int // °C
	Interval   time.Duration
	FG         color.RGBA
	BG         color.RGBA
	CriticalFG color.RGBA
	Icon       string
	// HwmonRoot overrides the /sys/class/hwmon lookup root used by the
	// HoverText sensor scan. Empty means the real sysfs path. Tests point
	// this at a fixture directory.
	HwmonRoot string
	// contains filtered or unexported fields
}

Temperature reads a hwmon temp*_input file (in millidegrees Celsius) and renders the current value as °C. If the value crosses the critical threshold it switches to CriticalFG.

func New

func New(hwmonPath string, critical int, interval time.Duration, fg, bg color.RGBA) *Temperature

func (*Temperature) HoverText

func (t *Temperature) HoverText() string

HoverText returns a multi-line list of every hwmon temperature sensor found on the system, including GPU and CPU sensors. Implements module.Hoverable.

func (*Temperature) Name

func (t *Temperature) Name() string

func (*Temperature) Render

func (t *Temperature) Render() []module.Segment

func (*Temperature) Start

func (t *Temperature) Start(ctx context.Context) <-chan struct{}

Jump to

Keyboard shortcuts

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