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

@ -1,10 +1,10 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2013, Luke Bonham * (c) 2013, Luke Bonham
* (c) 2010-2012, Peter Hofmann * (c) 2010-2012, Peter Hofmann
--]] --]]
local debug = require("debug") local debug = require("debug")
@ -46,7 +46,7 @@ end
-- }}} -- }}}
-- {{{ Timer maker -- {{{ Timer maker
helpers.timer_table = {} helpers.timer_table = {}

View File

@ -11,7 +11,7 @@
local tag = require("awful.tag") local tag = require("awful.tag")
local beautiful = require("beautiful") local beautiful = require("beautiful")
local ipairs = ipairs local ipairs = ipairs
local math = { floor = math.floor, local math = { floor = math.floor,
max = math.max, max = math.max,
min = math.min } min = math.min }
local tonumber = tonumber local tonumber = tonumber

View File

@ -1,15 +1,15 @@
--[[ --[[
Lain Lain
Layouts, widgets and utilities for Awesome WM Layouts, widgets and utilities for Awesome WM
Utilities section Utilities section
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2013, Luke Bonham * (c) 2013, Luke Bonham
* (c) 2010-2012, Peter Hofmann * (c) 2010-2012, Peter Hofmann
--]] --]]
local awful = require("awful") local awful = require("awful")
@ -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

@ -1,11 +1,11 @@
--[[ --[[
Licensed under MIT License Licensed under MIT License
* (c) 2013, Luke Bonham * (c) 2013, Luke Bonham
* (c) 2009, Uli Schlachter * (c) 2009, Uli Schlachter
* (c) 2009, Majic * (c) 2009, Majic
--]] --]]
local beautiful = require("beautiful") local beautiful = require("beautiful")

View File

@ -1,10 +1,10 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2013, Luke Bonham * (c) 2013, Luke Bonham
* (c) 2010, Adrian C. <anrxc@sysphere.org> * (c) 2010, Adrian C. <anrxc@sysphere.org>
--]] --]]
local newtimer = require("lain.helpers").newtimer local newtimer = require("lain.helpers").newtimer

View File

@ -15,7 +15,7 @@ local naughty = require("naughty")
local io = { popen = io.popen } local io = { popen = io.popen }
local math = { modf = math.modf } local math = { modf = math.modf }
local string = { format = string.format, local string = { format = string.format,
match = string.match, match = string.match,
rep = string.rep } rep = string.rep }
local tonumber = tonumber local tonumber = tonumber
@ -44,7 +44,7 @@ local alsabar =
font = beautiful.font:sub(beautiful.font:find(""), beautiful.font:find(" ")), font = beautiful.font:sub(beautiful.font:find(""), beautiful.font:find(" ")),
font_size = "11", font_size = "11",
color = beautiful.fg_focus, color = beautiful.fg_focus,
bar_size = 18 bar_size = 18
}, },
_current_level = 0, _current_level = 0,
@ -122,7 +122,7 @@ local function worker(args)
f:close() f:close()
-- Capture mixer control state: [5%] ... ... [on] -- Capture mixer control state: [5%] ... ... [on]
local volu, mute = string.match(mixer, "([%d]+)%%.*%[([%l]*)") local volu, mute = string.match(mixer, "([%d]+)%%.*%[([%l]*)")
if volu == nil then if volu == nil then
volu = 0 volu = 0

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

@ -64,7 +64,7 @@ local function worker(args)
helpers.set_map("fs", false) helpers.set_map("fs", false)
function update() function update()
fs_info = {} fs_info = {}
local f = io.popen("LC_ALL=C df -kP") local f = io.popen("LC_ALL=C df -kP")
@ -95,7 +95,7 @@ local function worker(args)
if used >= 99 and not helpers.get_map("fs") if used >= 99 and not helpers.get_map("fs")
then then
naughty.notify({ naughty.notify({
title = "warning", title = "warning",
text = partition .. " ran out!\nmake some room", text = partition .. " ran out!\nmake some room",
timeout = 8, timeout = 8,

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
@ -52,7 +53,7 @@ local function worker(args)
icon = helpers.icons_dir .. "mail.png", icon = helpers.icons_dir .. "mail.png",
position = "top_left" position = "top_left"
} }
curl = string.format("%s --url imaps://%s:%s/INBOX -u %s:%s %s -k", curl = string.format("%s --url imaps://%s:%s/INBOX -u %s:%s %s -k",
head_command, server, port, mail, password, request) head_command, server, port, mail, password, request)
@ -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()

View File

@ -1,10 +1,10 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2013, Luke Bonham * (c) 2013, Luke Bonham
* (c) 2010-2012, Peter Hofmann * (c) 2010-2012, Peter Hofmann
--]] --]]
local newtimer = require("lain.helpers").newtimer local newtimer = require("lain.helpers").newtimer

View File

@ -50,7 +50,7 @@ local function worker(args)
helpers.set_map(iface, true) helpers.set_map(iface, true)
function update() function update()
net_now = {} net_now = {}
if iface == "" then iface = net.get_device() end if iface == "" then iface = net.get_device() end

View File

@ -32,7 +32,7 @@ local function worker(args)
local f = io.open("/proc/loadavg") local f = io.open("/proc/loadavg")
local ret = f:read("*all") local ret = f:read("*all")
f:close() f:close()
load_1, load_5, load_15 = string.match(ret, "([^%s]+) ([^%s]+) ([^%s]+)") load_1, load_5, load_15 = string.match(ret, "([^%s]+) ([^%s]+) ([^%s]+)")
widget = sysload.widget widget = sysload.widget