This repository has been archived on 2021-04-06. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/home/.config/awesome/sensors.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)