small fixes

This commit is contained in:
luke bonham 2013-09-13 18:15:25 +02:00 committed by copycat-killer
parent 4bde4b5eea
commit f7aa289195
12 changed files with 46 additions and 43 deletions

View File

@ -17,7 +17,7 @@ local beautiful = require("beautiful")
local math = { sqrt = math.sqrt } local math = { sqrt = math.sqrt }
local mouse = mouse local mouse = mouse
local pairs = pairs local pairs = pairs
local string = string local string = { gsub = string.gsub }
local client = client local client = client
local screen = screen local screen = screen
local tonumber = tonumber local tonumber = tonumber

View File

@ -58,7 +58,8 @@ local function worker(args)
local dactive = active - cpu.last_active local dactive = active - cpu.last_active
local dtotal = total - cpu.last_total 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 widget = cpu.widget
settings() settings()

View File

@ -14,6 +14,7 @@ local wibox = require("wibox")
local io = { popen = io.popen } local io = { popen = io.popen }
local string = { format = string.format, local string = { format = string.format,
gsub = string.gsub } gsub = string.gsub }
local tonumber = tonumber
local setmetatable = setmetatable local setmetatable = setmetatable
@ -62,6 +63,7 @@ local function worker(args)
t, mailcount = string.gsub(ws, "%d", "") t, mailcount = string.gsub(ws, "%d", "")
t = nil -- because it's useless t = nil -- because it's useless
mailcount = tonumber(mailcount)
widget = imap.widget widget = imap.widget
settings() settings()