At 1235492273 time_t, Tassilo Horn wrote:
> But I don't get it for mouse clicks on the taglist where the bound
> function gets a real tag instead of the tag's number.  How do I get the
> number of a tag?

> I tried to call
> 
>  function switch_to_tag (tag)
>     for s = 1, screen.count() do
>        if tags[s][tag.name] then
>           awful.tag.viewonly(tags[s][tag.name])
>        end
>     end
>  end

Try something like this:

function switch_to_tag(tag)
    for k, v in ipairs(tags)
        if v == tag then
            break
        end
    end
    -- Now k is the index of the tag in the array 'tags`
    switch_to_tag_by_number(k)
end

-- 
Julien Danjou
// ᐰ <[email protected]>   http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
// There is nothing under this line.

Attachment: signature.asc
Description: Digital signature

Reply via email to