You are not logged in.
Pages: 1
Hello to all,
i would like to write a widget that can list me some todo list maybe using the naughty library.Anyone would like to help or suggest me? Other approaches to do this? I would like to implement it in my rc.lua, without using external applications or language.
Thanks
Science is a differential equation. Religion is a boundary condition.
Alan Turing
Offline
When you say 'widget', do you mean the widget layer on Compiz or something else?
I could see something like this be done by using 'conky' to let it read in a file as your 'to-do list' and it will always be on your desktop.
Here is the Conky website: http://conky.sourceforge.net/
You can get this app from Arch's repo: pacman -Ss conky
Just an idea
Arch linux i686 | Dell XPS m1530 | Intel Core 2 Duo 2 GHz | 3 GB RAM | 250GB HDD
Offline
If you use the following as a base it should be quite easy to hack it for your needs.
http://awesome.naquadah.org/wiki/Anrxcs_OrgMode_Widget
What you might want to do is have some widget in your wibox that displays a naughty notification on mouse enter, and destroys it on mouse exit. This notification can then be populated with any content you like; I imagine you would want to pull some entries from a text file (which can be done using lua's builting io). If you look through the wiki you should be able to find enough exampels and hack something together.
Last edited by alterecco (2010-03-13 00:42:05)
Offline
When you say 'widget', do you mean the widget layer on Compiz or something else?
he means widgets in awesome wm
Offline
I've done my widget but i can display the text on my status bar.
This is the screenshot:
As u can see the bar with my TODO appear on the upper right corner but there isn't any name displayed on the status bar.
this is the code on my rc.lua that create the widget:
myorgwidget = widget({type = "textbox"})
--todo
local todo = nil
local offset = 0
function remove_todo()
if todo ~= nil then
naughty.destroy(todo)
calendar = nil
offset = 0
end
end
function add_todo(inc_offset)
local save_offset = offset
remove_todo()
offset = save_offset + inc_offset
local cal = get_agenda()
todo = naughty.notify({
text = string.format('<span font_desc="%s">%s</span>', "terminus", cal),
timeout = 0, hover_timeout = 0.5,
width = 160,
})
end
-- change clockbox for your clock widget (e.g. mytextclock)
myorgwidget:add_signal("mouse::enter", function()
add_todo(0)
end)
myorgwidget:add_signal("mouse::leave", remove_todo)
myorgwidget:buttons({
button({ }, 4, function()
add_todo(-1)
end),
button({ }, 5, function()
add_todo(1)
end),
})
--TODO
vicious.register(myorgwidget,get_agenda,"<span> TODO </span>")
mywibox[s].widgets = {
{
mylauncher,
mytaglist[s],
mypromptbox[s],
layout = awful.widget.layout.horizontal.leftright
},
mylayoutbox[s],
-- myorgwidget,
mytextclock,
--wifiwidget,
mpdwidget,
--myorgwidget,
myorgwidget,
s == 1 and mysystray or nil,
mytasklist[s],
layout = awful.widget.layout.horizontal.rightleft
}
Any advice?
Last edited by p1mps (2010-03-17 00:30:02)
Science is a differential equation. Religion is a boundary condition.
Alan Turing
Offline
if you actually want to use
vicious.register(myorgwidget,get_agenda,"<span> TODO </span>")
then you would need to use the vicious library.
As far as I can see you would get text if you removed that line and added this instead
myorgwidget.text = "<span> TODO </span>"
Offline
It worked . Thank you for the help. If anyone is interested on the whole code i can release it
Science is a differential equation. Religion is a boundary condition.
Alan Turing
Offline
Pages: 1