CPU Temperature
godocimport "barista.run/modules/cputemp"
Display the temperature of the cpu package sensor: cputemp.New()
.
Display the temperature of a specific sensor: cputemp.Zone("thermal_zone7")
.
Display the temperature of the first sensor of a specific type: cputemp.OfType("iwlwifi")
.
Configuration
-
Output(func(unit.Temperature) bar.Output)
: Sets the output format. -
RefreshInterval(time.Duration)
: Sets the interval to wait before fetching updated temperature information. Defaults to 3 seconds. If the temperature has not changed, the output function will not be called again.
Example
25 deg C
Show the temperature from zone 7 in celsius:
cputemp.Zone("thermal_zone7").Output(func(t unit.Temperature) bar.Output) {
return outputs.Textf("%.0f deg C", t.Celsius())
})