})
end
- function update()
+ function tpbat.update()
bat_now = {
status = "Not present",
perc = "N/A",
settings()
end
- newtimer("tpbat-" .. bat.name, timeout, update)
+ newtimer("tpbat-" .. bat.name, timeout, tpbat.update)
widget:connect_signal('mouse::enter', function () tpbat.show() end)
widget:connect_signal('mouse::leave', function () tpbat.hide() end)
- return tpbat.widget
+ return tpbat
end
return setmetatable(tpbat, { __call = function(_, ...) return tpbat.register(...) end })
cpu.widget = wibox.widget.textbox()
- function update()
+ function cpu.update()
-- Read the amount of time the CPUs have spent performing
-- different kinds of work. Read the first line of /proc/stat
-- which is the sum of all CPUs.
settings()
end
- helpers.newtimer("cpu", timeout, update)
+ helpers.newtimer("cpu", timeout, cpu.update)
return cpu
end
mem.widget = wibox.widget.textbox()
- function update()
+ function mem.update()
mem_now = {}
for line in lines("/proc/meminfo") do
for k, v in gmatch(line, "([%a]+):[%s]+([%d]+).+") do
settings()
end
- helpers.newtimer("mem", timeout, update)
+ helpers.newtimer("mem", timeout, mem.update)
return mem
end
helpers.set_map(dev, true)
end
- -- Old api compatibility
net_now.carrier = dev_now.carrier
net_now.state = dev_now.state
- -- And new api
net_now.devices[dev] = dev_now
- -- With the new api new_now.sent and net_now.received will be the
+ -- new_now.sent and net_now.received will be the
-- totals across all specified devices
end
sysload.widget = wibox.widget.textbox()
- function update()
+ function sysload.update()
local f = io.open("/proc/loadavg")
local ret = f:read("*all")
f:close()
settings()
end
- helpers.newtimer("sysload", timeout, update)
+ helpers.newtimer("sysload", timeout, sysload.update)
return sysload
end
temp.widget = wibox.widget.textbox()
- function update()
+ function temp.update()
local f = io.open(tempfile)
if f then
coretemp_now = tonumber(f:read("*all")) / 1000
settings()
end
- helpers.newtimer("coretemp", timeout, update)
+ helpers.newtimer("coretemp", timeout, temp.update)
return temp
end
-Subproject commit ed824beb75262f9f78e49baa6e1a591220ca5249
+Subproject commit 425169b35b105e5a240997ff8f5aa12bec6099cb