mirror of https://github.com/lcpz/lain.git
wiki enhanced
This commit is contained in:
parent
229d2545dd
commit
ae4b9b2728
|
@ -108,7 +108,7 @@ function tpbat.register(args)
|
|||
})
|
||||
end
|
||||
|
||||
function update()
|
||||
function tpbat.update()
|
||||
bat_now = {
|
||||
status = "Not present",
|
||||
perc = "N/A",
|
||||
|
@ -151,12 +151,12 @@ function tpbat.register(args)
|
|||
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 })
|
||||
|
|
|
@ -26,7 +26,7 @@ local function worker(args)
|
|||
|
||||
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.
|
||||
|
@ -74,7 +74,7 @@ local function worker(args)
|
|||
settings()
|
||||
end
|
||||
|
||||
helpers.newtimer("cpu", timeout, update)
|
||||
helpers.newtimer("cpu", timeout, cpu.update)
|
||||
|
||||
return cpu
|
||||
end
|
||||
|
|
|
@ -25,7 +25,7 @@ local function worker(args)
|
|||
|
||||
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
|
||||
|
@ -48,7 +48,7 @@ local function worker(args)
|
|||
settings()
|
||||
end
|
||||
|
||||
helpers.newtimer("mem", timeout, update)
|
||||
helpers.newtimer("mem", timeout, mem.update)
|
||||
|
||||
return mem
|
||||
end
|
||||
|
|
|
@ -97,12 +97,10 @@ local function worker(args)
|
|||
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
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ local function worker(args)
|
|||
|
||||
sysload.widget = wibox.widget.textbox()
|
||||
|
||||
function update()
|
||||
function sysload.update()
|
||||
local f = io.open("/proc/loadavg")
|
||||
local ret = f:read("*all")
|
||||
f:close()
|
||||
|
@ -35,7 +35,7 @@ local function worker(args)
|
|||
settings()
|
||||
end
|
||||
|
||||
helpers.newtimer("sysload", timeout, update)
|
||||
helpers.newtimer("sysload", timeout, sysload.update)
|
||||
|
||||
return sysload
|
||||
end
|
||||
|
|
|
@ -24,7 +24,7 @@ local function worker(args)
|
|||
|
||||
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
|
||||
|
@ -37,7 +37,7 @@ local function worker(args)
|
|||
settings()
|
||||
end
|
||||
|
||||
helpers.newtimer("coretemp", timeout, update)
|
||||
helpers.newtimer("coretemp", timeout, temp.update)
|
||||
|
||||
return temp
|
||||
end
|
||||
|
|
2
wiki
2
wiki
|
@ -1 +1 @@
|
|||
Subproject commit ed824beb75262f9f78e49baa6e1a591220ca5249
|
||||
Subproject commit 425169b35b105e5a240997ff8f5aa12bec6099cb
|
Loading…
Reference in New Issue