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
607 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
}
local sensors_timer = timer({ timeout = 10 })
sensors_timer:connect_signal("timeout", function() sensors_update() end)
sensors_timer:start()
function sensors_update()
local temp = utils.readfile("/sys/class/thermal/thermal_zone1/temp") / 1000
sensors_widget:set_markup(string.format("%02d", temp) .. "°C")
end
sensors_update()
return wibox.container.margin(sensors_widget, 4)