mirror of https://github.com/lcpz/lain.git
some other space fixes
This commit is contained in:
parent
9c829662f1
commit
52a50fafa0
|
@ -23,7 +23,7 @@ local setmetatable = setmetatable
|
||||||
local calendar = {}
|
local calendar = {}
|
||||||
local notification = nil
|
local notification = nil
|
||||||
|
|
||||||
local function create(background, foreground)
|
local function create(foreground, background)
|
||||||
calendar.offset = 0
|
calendar.offset = 0
|
||||||
calendar.icons_dir = icons_dir .. "cal/white/" -- default
|
calendar.icons_dir = icons_dir .. "cal/white/" -- default
|
||||||
calendar.notify_icon = nil
|
calendar.notify_icon = nil
|
||||||
|
@ -111,8 +111,8 @@ function calendar:show(t_out, inc_offset)
|
||||||
timeout = tims })
|
timeout = tims })
|
||||||
end
|
end
|
||||||
|
|
||||||
function calendar:attach(widget, background, foreground)
|
function calendar:attach(widget, foreground, background)
|
||||||
create(background, foreground)
|
create(foreground, background)
|
||||||
widget:connect_signal("mouse::enter", function () calendar:show() end)
|
widget:connect_signal("mouse::enter", function () calendar:show() end)
|
||||||
widget:connect_signal("mouse::leave", function () calendar:hide() end)
|
widget:connect_signal("mouse::leave", function () calendar:hide() end)
|
||||||
widget:buttons(awful.util.table.join( awful.button({ }, 1, function ()
|
widget:buttons(awful.util.table.join( awful.button({ }, 1, function ()
|
||||||
|
|
|
@ -62,7 +62,7 @@ function worker(args)
|
||||||
local dtotal = total - cpu.last_total
|
local dtotal = total - cpu.last_total
|
||||||
local dta = math.ceil((dactive / dtotal) * 100)
|
local dta = math.ceil((dactive / dtotal) * 100)
|
||||||
|
|
||||||
w:set_markup(markup(header_color, header) .. markup(color, dta .. footer) .. " ")
|
w:set_markup(markup(header_color, header) .. markup(color, dta .. footer))
|
||||||
|
|
||||||
-- Save current data for the next run.
|
-- Save current data for the next run.
|
||||||
cpu.last_active = active
|
cpu.last_active = active
|
||||||
|
|
|
@ -96,7 +96,7 @@ function worker(args)
|
||||||
elseif ws:find("CheckMailError: invalid credentials") ~= nil
|
elseif ws:find("CheckMailError: invalid credentials") ~= nil
|
||||||
then
|
then
|
||||||
helpers.set_map(mail, true)
|
helpers.set_map(mail, true)
|
||||||
myimapcheck:set_markup(markup(header_color, header) ..
|
myimapcheck:set_markup(" " .. markup(header_color, header) ..
|
||||||
markup(color, "invalid credentials "))
|
markup(color, "invalid credentials "))
|
||||||
else
|
else
|
||||||
mailcount = ws:match("%d") or "?"
|
mailcount = ws:match("%d") or "?"
|
||||||
|
@ -107,7 +107,7 @@ function worker(args)
|
||||||
helpers.set_map(mail .. " count", mailcount)
|
helpers.set_map(mail .. " count", mailcount)
|
||||||
end
|
end
|
||||||
|
|
||||||
myimapcheck:set_markup(markup(header_color, header) ..
|
myimapcheck:set_markup(" " .. markup(header_color, header) ..
|
||||||
markup(color, mailcount) .. " ")
|
markup(color, mailcount) .. " ")
|
||||||
|
|
||||||
if helpers.get_map(mail)
|
if helpers.get_map(mail)
|
||||||
|
|
|
@ -108,7 +108,7 @@ function worker(args)
|
||||||
myimapcheck:set_markup(markup(color_nomail, " no mail "))
|
myimapcheck:set_markup(markup(color_nomail, " no mail "))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
myimapcheck:set_markup(markup(header_color, header) ..
|
myimapcheck:set_markup(" " .. markup(header_color, header) ..
|
||||||
markup(color_newmail, newmail) .. " ")
|
markup(color_newmail, newmail) .. " ")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -62,10 +62,10 @@ function worker(args)
|
||||||
then
|
then
|
||||||
local fmt = "%" .. string.len(mem.total) .. ".0f/%.0f"
|
local fmt = "%" .. string.len(mem.total) .. ".0f/%.0f"
|
||||||
widg:set_markup(markup(header_color, header) ..
|
widg:set_markup(markup(header_color, header) ..
|
||||||
markup(color, string.format(fmt, used, mem.total) .. footer .. " "))
|
markup(color, string.format(fmt, used, mem.total) .. footer))
|
||||||
else
|
else
|
||||||
widg:set_markup(markup(header_color, header) ..
|
widg:set_markup(markup(header_color, header) ..
|
||||||
markup(color, used .. footer .. " "))
|
markup(color, used .. footer))
|
||||||
end
|
end
|
||||||
|
|
||||||
if show_swap
|
if show_swap
|
||||||
|
|
|
@ -36,6 +36,7 @@ function worker(args)
|
||||||
local header_color = args.header_color or beautiful.fg_normal or "#FFFFFF"
|
local header_color = args.header_color or beautiful.fg_normal or "#FFFFFF"
|
||||||
local color = args.color or beautiful.fg_focus or "#FFFFFF"
|
local color = args.color or beautiful.fg_focus or "#FFFFFF"
|
||||||
local spr = args.spr or " "
|
local spr = args.spr or " "
|
||||||
|
local footer = args.footer or ""
|
||||||
local app = args.app or "ncmpcpp"
|
local app = args.app or "ncmpcpp"
|
||||||
local shadow = args.shadow or false
|
local shadow = args.shadow or false
|
||||||
|
|
||||||
|
@ -53,7 +54,7 @@ function worker(args)
|
||||||
then
|
then
|
||||||
mympd:set_text('')
|
mympd:set_text('')
|
||||||
else
|
else
|
||||||
mympd:set_markup(markup(header_color, " mpd "), markup(color , "off "))
|
mympd:set_markup(markup(header_color, "mpd ") .. markup(color , "off") .. footer)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -102,14 +103,14 @@ function worker(args)
|
||||||
replaces_id = mpd.id
|
replaces_id = mpd.id
|
||||||
}).id
|
}).id
|
||||||
end
|
end
|
||||||
mympd:set_markup(markup(header_color, " " .. mpd_state["{Artist}"])
|
mympd:set_markup(markup(header_color, mpd_state["{Artist}"])
|
||||||
.. spr ..
|
.. spr ..
|
||||||
markup(color, mpd_state["{Title}"] .. " "))
|
markup(color, mpd_state["{Title}"]) .. footer)
|
||||||
elseif mpd_state["{state}"] == "pause"
|
elseif mpd_state["{state}"] == "pause"
|
||||||
then
|
then
|
||||||
mympd:set_markup(markup(header_color, "mpd")
|
mympd:set_markup(markup(header_color, "mpd")
|
||||||
.. spr ..
|
.. spr ..
|
||||||
markup(color, "paused "))
|
markup(color, "paused") .. footer)
|
||||||
else
|
else
|
||||||
helpers.set_map("current mpd track", nil)
|
helpers.set_map("current mpd track", nil)
|
||||||
set_nompd()
|
set_nompd()
|
||||||
|
|
Loading…
Reference in New Issue