xmtop/src/widgets/temp_windows.go

15 lines
275 B
Go
Raw Normal View History

2018-05-16 04:48:26 +08:00
package widgets
import (
psHost "github.com/shirou/gopsutil/host"
)
func (self *Temp) update() {
sensors, _ := psHost.SensorsTemperatures()
for _, sensor := range sensors {
2018-11-30 09:37:41 +08:00
if sensor.Temperature != 0 {
self.Data[sensor.SensorKey] = int(sensor.Temperature)
}
2018-05-16 04:48:26 +08:00
}
}