--[[
-
- Licensed under GNU General Public License v2
- * (c) 2013, Luke Bonham
- * (c) 2010-2012, Peter Hofmann
-
+
+ Licensed under GNU General Public License v2
+ * (c) 2013, Luke Bonham
+ * (c) 2010-2012, Peter Hofmann
+
--]]
local debug = require("debug")
-- }}}
--- {{{ Timer maker
+-- {{{ Timer maker
helpers.timer_table = {}
local tag = require("awful.tag")
local beautiful = require("beautiful")
local ipairs = ipairs
-local math = { floor = math.floor,
+local math = { floor = math.floor,
max = math.max,
min = math.min }
local tonumber = tonumber
--[[
-
- Lain
- Layouts, widgets and utilities for Awesome WM
-
- Utilities section
-
- Licensed under GNU General Public License v2
- * (c) 2013, Luke Bonham
- * (c) 2010-2012, Peter Hofmann
-
+
+ Lain
+ Layouts, widgets and utilities for Awesome WM
+
+ Utilities section
+
+ Licensed under GNU General Public License v2
+ * (c) 2013, Luke Bonham
+ * (c) 2010-2012, Peter Hofmann
+
--]]
local awful = require("awful")
local math = { sqrt = math.sqrt }
local mouse = mouse
local pairs = pairs
-local string = string
+local string = { gsub = string.gsub }
local client = client
local screen = screen
local tonumber = tonumber
--[[
-
- Licensed under MIT License
- * (c) 2013, Luke Bonham
- * (c) 2009, Uli Schlachter
- * (c) 2009, Majic
-
+
+ Licensed under MIT License
+ * (c) 2013, Luke Bonham
+ * (c) 2009, Uli Schlachter
+ * (c) 2009, Majic
+
--]]
local beautiful = require("beautiful")
--[[
-
- Licensed under GNU General Public License v2
- * (c) 2013, Luke Bonham
- * (c) 2010, Adrian C. <anrxc@sysphere.org>
-
+
+ Licensed under GNU General Public License v2
+ * (c) 2013, Luke Bonham
+ * (c) 2010, Adrian C. <anrxc@sysphere.org>
+
--]]
local newtimer = require("lain.helpers").newtimer
local io = { popen = io.popen }
local math = { modf = math.modf }
-local string = { format = string.format,
+local string = { format = string.format,
match = string.match,
rep = string.rep }
local tonumber = tonumber
font = beautiful.font:sub(beautiful.font:find(""), beautiful.font:find(" ")),
font_size = "11",
color = beautiful.fg_focus,
- bar_size = 18
+ bar_size = 18
},
_current_level = 0,
f:close()
-- 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
volu = 0
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()
helpers.set_map("fs", false)
function update()
- fs_info = {}
+ fs_info = {}
local f = io.popen("LC_ALL=C df -kP")
if used >= 99 and not helpers.get_map("fs")
then
- naughty.notify({
+ naughty.notify({
title = "warning",
text = partition .. " ran out!\nmake some room",
timeout = 8,
local io = { popen = io.popen }
local string = { format = string.format,
gsub = string.gsub }
+local tonumber = tonumber
local setmetatable = setmetatable
icon = helpers.icons_dir .. "mail.png",
position = "top_left"
}
-
+
curl = string.format("%s --url imaps://%s:%s/INBOX -u %s:%s %s -k",
head_command, server, port, mail, password, request)
t, mailcount = string.gsub(ws, "%d", "")
t = nil -- because it's useless
+ mailcount = tonumber(mailcount)
widget = imap.widget
settings()
--[[
-
- Licensed under GNU General Public License v2
- * (c) 2013, Luke Bonham
- * (c) 2010-2012, Peter Hofmann
-
+
+ Licensed under GNU General Public License v2
+ * (c) 2013, Luke Bonham
+ * (c) 2010-2012, Peter Hofmann
+
--]]
local newtimer = require("lain.helpers").newtimer
helpers.set_map(iface, true)
- function update()
+ function update()
net_now = {}
if iface == "" then iface = net.get_device() end
local f = io.open("/proc/loadavg")
local ret = f:read("*all")
f:close()
-
+
load_1, load_5, load_15 = string.match(ret, "([^%s]+) ([^%s]+) ([^%s]+)")
widget = sysload.widget