mirror of https://github.com/lcpz/lain.git
small fixes
This commit is contained in:
parent
669112020d
commit
8af4a03c75
12
helpers.lua
12
helpers.lua
|
@ -1,10 +1,10 @@
|
|||
|
||||
--[[
|
||||
|
||||
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")
|
||||
|
@ -46,7 +46,7 @@ end
|
|||
|
||||
-- }}}
|
||||
|
||||
-- {{{ Timer maker
|
||||
-- {{{ Timer maker
|
||||
|
||||
helpers.timer_table = {}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
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
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
|
||||
--[[
|
||||
|
||||
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")
|
||||
|
@ -17,7 +17,7 @@ local beautiful = require("beautiful")
|
|||
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
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
|
||||
--[[
|
||||
|
||||
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")
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
--[[
|
||||
|
||||
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
|
||||
|
|
|
@ -15,7 +15,7 @@ local naughty = require("naughty")
|
|||
|
||||
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
|
||||
|
@ -44,7 +44,7 @@ local alsabar =
|
|||
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,
|
||||
|
@ -122,7 +122,7 @@ local function worker(args)
|
|||
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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -64,7 +64,7 @@ local function worker(args)
|
|||
helpers.set_map("fs", false)
|
||||
|
||||
function update()
|
||||
fs_info = {}
|
||||
fs_info = {}
|
||||
|
||||
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")
|
||||
then
|
||||
naughty.notify({
|
||||
naughty.notify({
|
||||
title = "warning",
|
||||
text = partition .. " ran out!\nmake some room",
|
||||
timeout = 8,
|
||||
|
|
|
@ -14,6 +14,7 @@ local wibox = require("wibox")
|
|||
local io = { popen = io.popen }
|
||||
local string = { format = string.format,
|
||||
gsub = string.gsub }
|
||||
local tonumber = tonumber
|
||||
|
||||
local setmetatable = setmetatable
|
||||
|
||||
|
@ -52,7 +53,7 @@ local function worker(args)
|
|||
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)
|
||||
|
||||
|
@ -62,6 +63,7 @@ local function worker(args)
|
|||
|
||||
t, mailcount = string.gsub(ws, "%d", "")
|
||||
t = nil -- because it's useless
|
||||
mailcount = tonumber(mailcount)
|
||||
|
||||
widget = imap.widget
|
||||
settings()
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
--[[
|
||||
|
||||
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
|
||||
|
|
|
@ -50,7 +50,7 @@ local function worker(args)
|
|||
|
||||
helpers.set_map(iface, true)
|
||||
|
||||
function update()
|
||||
function update()
|
||||
net_now = {}
|
||||
|
||||
if iface == "" then iface = net.get_device() end
|
||||
|
|
|
@ -32,7 +32,7 @@ local function worker(args)
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue