> I saw a Mod+t to mark a client,  I tested it. It can not mark multiple client.

It can mark multiple clients, but I guess what you (rather, the
default rc.lua) are missing is a means to jump/cycle those clients.

This snippet might help:

-- iterator: cycle over a table starting from the next element
local function cycle(t, item)
    local index = awful.util.table.hasitem(t, item)
    local size  = table.getn(t)
    local count = 0
    return function ()
        index = next(t, index) or 1; count = count + 1
        if not (count > size) then return t[index] end
    end
end

-- cycle through marked clients
function cycle_marked()
    local clients = capi.client.get()
    local focused = awful.client.next(0)
    for c in cycle(clients, focused) do
        if ismarked(c) then
            local ctags = c:tags()
            if table.getn(ctags) == 0 then
                -- not on any tag, show client on current tag
                awful.client.movetotag(awful.tag.selected(), c)
            else
                -- else, pop to first tag client is visible on
                awful.tag.viewonly(ctags[1])
            end
            -- And then focus the client
            client.focus = c
            c:raise()
            return
        end
    end
end

I bind cycle_marked to mod4 + a (globalkeys):

    awful.key({ config.global.modkey, }, "a", cycle_marked ),

> I want to know what it is used for .

Earlier I used to have a lot of terminal's open, and I would mark the
irb, or rails output terminal as marked and cycle through them with
Mod4+a. Now I just use tmux.

I find it useful sometime during exams, when I have a lot of pdf, and
ppt open. There is always one topic that is supposed to be the current
focus. I mark the corresponding document and keep jumping back to it
with Mod4 + a :).

-- 
Anurag Priyam
http://about.me/yeban/

--
To unsubscribe, send mail to [email protected].

Reply via email to