From d049694c2983b9465a02168238f0eb1edbf68fd4 Mon Sep 17 00:00:00 2001 From: Enric Morales Date: Thu, 17 Oct 2019 13:49:21 +0200 Subject: [PATCH] Reindent file to get rid of tabs --- widgets/cpu_openbsd.lua | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/widgets/cpu_openbsd.lua b/widgets/cpu_openbsd.lua index 3d11a3d..9c921ec 100644 --- a/widgets/cpu_openbsd.lua +++ b/widgets/cpu_openbsd.lua @@ -33,26 +33,26 @@ cpu_openbsd.ticks = { 0, 0, 0, 0, 0, 0 } function cpu_openbsd.async(format, warg, callback) helpers.sysctl_async({ "kern.cp_time" }, - function (ret) - local current_ticks = {} - for match in string.gmatch(ret["kern.cp_time"], "(%d+)") do - table.insert(current_ticks, tonumber(match)) - end + function (ret) + local current_ticks = {} + for match in string.gmatch(ret["kern.cp_time"], "(%d+)") do + table.insert(current_ticks, tonumber(match)) + end - local period_ticks = {} - for i=1, 6 do - table.insert(period_ticks, - current_ticks[i] - cpu_openbsd.ticks[i]) - end + local period_ticks = {} + for i = 1, 6 do + table.insert(period_ticks, + current_ticks[i] - cpu_openbsd.ticks[i]) + end - local cpu_total, cpu_busy = 0, 0 - for i = 1, 6 do cpu_total = cpu_total + period_ticks[i] end - for i = 1, 5 do cpu_busy = cpu_busy + period_ticks[i] end + local cpu_total, cpu_busy = 0, 0 + for i = 1, 6 do cpu_total = cpu_total + period_ticks[i] end + for i = 1, 5 do cpu_busy = cpu_busy + period_ticks[i] end - local cpu_usage = math.ceil((cpu_busy / cpu_total) * 100 ) + local cpu_usage = math.ceil((cpu_busy / cpu_total) * 100 ) - cpu_openbsd.ticks = current_ticks - return callback({ cpu_usage }) + cpu_openbsd.ticks = current_ticks + return callback({ cpu_usage }) end) end