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