24 lines
553 B
Lua
24 lines
553 B
Lua
local timer = require("gears.timer")
|
|
local wibox = require("wibox")
|
|
local utils = require("utils")
|
|
|
|
local sensors_widget = wibox.widget{
|
|
markup = '00°C',
|
|
align = 'center',
|
|
widget = wibox.widget.textbox
|
|
}
|
|
|
|
timer = timer({ timeout = 10 })
|
|
timer:connect_signal("timeout", function() update() end)
|
|
timer:start()
|
|
|
|
function update()
|
|
local temp = utils.readfile("/sys/class/thermal/thermal_zone1/temp") / 1000
|
|
|
|
sensors_widget:set_markup(string.format("%02d", temp) .. "°C")
|
|
end
|
|
|
|
update()
|
|
|
|
return wibox.container.margin(sensors_widget, 4)
|