At 1234787563 time_t, Matías Graña wrote:
> When I want to define widgets and so, I do in lua.rc something like
> for i = 1,2 do 
>    blah, blah,
> end
> But this is not nice, the '2' there is the number of elements in the
> list feeds. How can I get that in lua? I know, this is a lua question,
> but it actually has to do with awesome.

Two possibility: #feeds has the number of entries in a table.

for i = 1, #feeds do […] end

Or, better use pairs() or ipairs() (see Lua documentation):

for k, v in ipairs(feeds) do […] end

> Second question: I read the rss every 60 seconds with
>       awful.hooks.timer.register(60, rsswidget_timer),
> where rsswidget_timer is a function that uses an external script.
> Is there a way to dynamically 'unregister' and 're-register' this timer?

awful.hooks.timer.unregister(rsswidget_timer)

But once it is registered it will execute *every* 60 esconds.

Cheers,
-- 
Julien Danjou
// ᐰ <[email protected]>   http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
// Life is life. Lalalalala.

Attachment: signature.asc
Description: Digital signature

Reply via email to