contrib section started\!

This commit is contained in:
luke bonham 2013-09-25 15:21:21 +02:00
parent e4c5d756c9
commit 97f0b4bb88
1 changed files with 20 additions and 18 deletions

View File

@ -38,11 +38,11 @@ function task:show()
local f, c_text local f, c_text
f = io.popen('task') f = io.popen('task')
c_text = "<tt><span font='" c_text = "<span font='"
.. task.font .. " " .. task.font .. " "
.. task.font_size .. "'>" .. task.font_size .. "'>"
.. f:read("*all"):gsub("\n*$", "") .. f:read("*all"):gsub("\n*$", "")
.. "</span></tt>" .. "</span>"
f:close() f:close()
task_notification = naughty.notify({ title = "[task next]", task_notification = naughty.notify({ title = "[task next]",
@ -59,19 +59,20 @@ function task:prompt_add()
mypromptbox[mouse.screen].widget, mypromptbox[mouse.screen].widget,
function (...) function (...)
local f = io.popen("task add " .. ...) local f = io.popen("task add " .. ...)
c_text = "\n<tt><span font='" c_text = "\n<span font='"
.. task.font .. " " .. task.font .. " "
.. task.font_size .. "'>" .. task.font_size .. "'>"
.. f:read("*all") .. f:read("*all")
.. "</span></tt>" .. "</span>"
f:close()
naughty.notify({ naughty.notify({
text = c_text, text = c_text,
icon = task.notify_icon, icon = task.notify_icon,
position = task.position, position = task.position,
fg = task.fg, fg = task.fg,
bg = task.bg, bg = task.bg,
timeout = task.timeout timeout = task.timeout
}) })
end, end,
nil, nil,
@ -83,27 +84,28 @@ function task:prompt_search()
mypromptbox[mouse.screen].widget, mypromptbox[mouse.screen].widget,
function (...) function (...)
local f = io.popen("task " .. ...) local f = io.popen("task " .. ...)
c_text = f:read("*all") c_text = f:read("*all"):gsub(" \n*$", "")
f:close() f:close()
if string.len(c_text) == 0 if string.len(c_text) == 0
then then
c_text = "No results found." c_text = "No results found."
else else
c_text = "<tt><span font='" c_text = "<span font='"
.. task.font .. " " .. task.font .. " "
.. task.font_size .. "'>" .. task.font_size .. "'>"
.. c_text .. "\n" .. c_text
.. "</span></tt>" .. "</span>"
end end
naughty.notify({ naughty.notify({
text = c_text, title = "[task next " .. ... .. "]",
icon = task.notify_icon, text = c_text,
icon = task.notify_icon,
position = task.position, position = task.position,
fg = task.fg, fg = task.fg,
bg = task.bg, bg = task.bg,
timeout = task.timeout timeout = task.timeout
}) })
end, end,
nil, nil,