This is 99% complete. Everything is working except the number is not being
colored by the theme. I'm guessing that it's because the colors are first
in currenttags[1]. So to solve I'd have to insert the number after the
colors in the string rather than concatenate the number with
currenttags[1]. Any suggestions on how to do this?

    -- Create a tasklist widget
    mytasklist[s] = awful.widget.tasklist(
        function(c)
            -- Peter: Enumerate tasks
            local entries = {}
                for _, c in ipairs(client.get(s)) do
                    if awful.widget.tasklist.label.currenttags(c, s) then
                        table.insert(entries, c)
                    end
            end
            -- Peter: Insert the number into the tasklist label - FIXME:
Number is not colored by theme
            local tmptask = { awful.widget.tasklist.label.currenttags(c, s)
}

            if tmptask[1] then
                tmptask[1] = awful.util.table.hasitem(entries,
c)..":"..tmptask[1]
            end
        return tmptask[1], tmptask[2], tmptask[3], nil
        end,
    mytasklist.buttons)


-- Bind all key numbers to tasks.
for i = 1, 10 do
    globalkeys = awful.util.table.join(globalkeys,
        awful.key({ modkey }, "#" .. i + 9,
            function (c)
                for s = 1, screen.count() do
                    local entries = {}
                    for _, c in ipairs(client.get(s)) do
                        if awful.widget.tasklist.label.currenttags(c, s)
then
                            table.insert(entries, c)
                        end
                        if awful.util.table.hasitem(entries, c) == i and s
== mouse.screen then
                            c:raise()
                        end
                    end
            end
        end))
end

Reply via email to