You are not logged in.

#1 2010-03-12 20:39:08

p1mps
Member
From: italy
Registered: 2009-05-04
Posts: 28
Website

todo list widget awesome3

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

#2 2010-03-12 22:02:33

ruffedgz
Member
From: Michigan
Registered: 2009-07-23
Posts: 54

Re: todo list widget awesome3

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 wink


Arch linux i686 | Dell XPS m1530 | Intel Core 2 Duo 2 GHz | 3 GB RAM | 250GB HDD

Offline

#3 2010-03-13 00:41:38

alterecco
Member
Registered: 2009-07-13
Posts: 152

Re: todo list widget awesome3

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

#4 2010-03-16 11:04:30

samuele.mattiuzzo
Member
From: Treviso, IT
Registered: 2009-10-12
Posts: 307
Website

Re: todo list widget awesome3

ruffedgz wrote:

When you say 'widget', do you mean the widget layer on Compiz or something else?

he means widgets in awesome wm smile

Offline

#5 2010-03-17 00:04:38

p1mps
Member
From: italy
Registered: 2009-05-04
Posts: 28
Website

Re: todo list widget awesome3

I've done my widget but i can display the text on my status bar.

This is the screenshot:

screenshotbar.th.png

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

#6 2010-03-17 02:27:27

alterecco
Member
Registered: 2009-07-13
Posts: 152

Re: todo list widget awesome3

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

#7 2010-03-17 09:57:06

p1mps
Member
From: italy
Registered: 2009-05-04
Posts: 28
Website

Re: todo list widget awesome3

It worked smile. 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

Board footer

Powered by FluxBB