mirror of https://github.com/lcpz/lain.git
imap: password can now be a string, a table or a function to execute
This commit is contained in:
parent
58b2a122dd
commit
bf3a9ba5ef
|
@ -177,10 +177,10 @@ function helpers.spairs(t)
|
|||
end
|
||||
end
|
||||
|
||||
-- create a textbox with no spacing issues
|
||||
-- create a lain textbox
|
||||
function helpers.make_widget_textbox()
|
||||
local w = wibox.widget.textbox()
|
||||
return setmetatable({ widget = w }, { __index = w })
|
||||
local w = { widget = wibox.widget.textbox() }
|
||||
return setmetatable(w, { __index = w.widget })
|
||||
end
|
||||
|
||||
-- }}}
|
||||
|
|
|
@ -11,6 +11,7 @@ local naughty = require("naughty")
|
|||
local wibox = require("wibox")
|
||||
local string = { format = string.format,
|
||||
gsub = string.gsub }
|
||||
local type = type
|
||||
local tonumber = tonumber
|
||||
local setmetatable = setmetatable
|
||||
|
||||
|
@ -37,7 +38,11 @@ local function worker(args)
|
|||
helpers.set_map(mail, 0)
|
||||
|
||||
if not is_plain then
|
||||
if type(password) == "string" or type(password) == "table" then
|
||||
helpers.async(password, function(f) password = f:gsub("\n", "") end)
|
||||
elseif type(password) == "function" then
|
||||
local p = password()
|
||||
end
|
||||
end
|
||||
|
||||
function update()
|
||||
|
|
2
wiki
2
wiki
|
@ -1 +1 @@
|
|||
Subproject commit f086b95e51c31b6fc1fda4591aa8eaf587cc064f
|
||||
Subproject commit 0af22b80f8dda896a0c8fefd5c7e52413294967d
|
Loading…
Reference in New Issue