it seems simple now and it works! thanks On Mon, Aug 31, 2009 at 6:00 PM, Julien Danjou<jul...@danjou.info> wrote: > At 1251732588 time_t, Cedric GESTES wrote: >> I wonder how to get the titlebar code to specify the client it is >> linked with to the tablist_update function? >> The titlebar.update function have the information I need. > > I think the solution is here, but I might be wrong: > >> local function tablist_update(w, buttons, label, data, widgets) >> local tabidx = nil >> if data.followfocus then >> tabidx = tab.client_tabindex(capi.client.focus) >> else >> tabidx = tab.client_tabindex(???) >> end >> >> local clients = {} >> if tabidx ~= nil then >> clients = tab.clients(tabidx) >> end >> common.list_update(w, buttons, label, data, widgets, clients) >> end > > That function should have an argument "c" for the client. > >> --- Create a new tasklist widget. >> -- @param label Label function to use. >> -- @param buttons A table with buttons binding to set. >> function new(label, buttons, followfocus) >> local w = { >> layout = layout.horizontal.rightleft >> } >> local widgets = { } >> widgets.imagebox = { } >> widgets.textbox = { margin = { left = 2, >> right = 2 }, >> bg_resize = true, >> bg_align = "right" >> } >> local data = setmetatable({}, { __mode = 'k' }) >> data.followfocus = followfocus >> local u = function () tablist_update(w, buttons, label, data, widgets) >> end > > With: > local u = function (c) tablist_update(c, w, buttons, label, data, widgets) end > > your tablist_update will have the client the tablist is updating for. > > Does it help or I am totally lost? :-) > > Cheers, > -- > Julien Danjou > // ᐰ <jul...@danjou.info> http://julien.danjou.info > // 9A0D 5FD9 EB42 22F6 8974 C95C A462 B51E C2FE E5CD > // Trust me. > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > > iEYEARECAAYFAkqb86QACgkQpGK1HsL+5c2+xgCfY2Zsxx30WGH4j8YeMgagSgDv > Ej0AniWcgM3dmWKH5QO36oFipRSH5TBH > =WSnr > -----END PGP SIGNATURE----- > >
-- To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.