On Mon, Feb 16, 2009 at 01:50:28PM +0100, Julien Danjou wrote: > 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
Thanks! At some point I saw it but apparently I forgot about ipairs :-( > > 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. So, is it impossible to stop it? What I'd like to do is to tell it to stop. And then, at some point, to resume execution. Thanks again, Matías -- To unsubscribe, send mail to [email protected].
