X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/669112020d022b3b9cb023c82230e21d36aa88cf..1152e7e8a6c3c66a4a1631e3df8958a220f060a1:/widgets/cpu.lua diff --git a/widgets/cpu.lua b/widgets/cpu.lua index 55a3799..7c1ecb0 100644 --- a/widgets/cpu.lua +++ b/widgets/cpu.lua @@ -43,9 +43,9 @@ local function worker(args) local total = 0 for field in string.gmatch(times, "[%s]+([^%s]+)") do - -- 3 = idle, 4 = ioWait. Essentially, the CPUs have done + -- 4 = idle, 5 = ioWait. Essentially, the CPUs have done -- nothing during these times. - if at == 3 or at == 4 + if at == 4 or at == 5 then idle = idle + field end @@ -58,7 +58,8 @@ local function worker(args) local dactive = active - cpu.last_active local dtotal = total - cpu.last_total - usage = tostring(math.ceil((dactive / dtotal) * 100)) + cpu_now = {} + cpu_now.usage = tostring(math.ceil((dactive / dtotal) * 100)) widget = cpu.widget settings()