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
Raw Normal View History

2018-10-28 14:14:27 +01:00
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()
2018-10-28 14:14:27 +01:00
function sensors_update()
2018-10-28 14:14:27 +01:00
local temp = utils.readfile("/sys/class/thermal/thermal_zone1/temp") / 1000
sensors_widget:set_markup(string.format("%02d", temp) .. "°C")
end
sensors_update()
2018-10-28 14:14:27 +01:00
return wibox.container.margin(sensors_widget, 4)