On 15.07.2011 11:07, Giorgos Keramidas wrote:
> Other than patching my local awful.client library, is there any way to
> tweak this behavior to iterate through *all* the clients of the
> currently visible tag or tags, instead of just the ones that happen to
> be non-minimized?

Hi,

you could copy all the code in question to your rc.lua and change all the
accesses to data.focus into awful.client.data.focus (plus some simple other
changes to make it work).

Please note that the below code uses client.get(screen), so will cycle through
all the clients on that screen instead of just the ones on the currently
selected tags. It's an exercise for the reader to replace that with a new
function which returns all clients on the selected tags.

Also, none of this is tested. It's just copied straight from my awful copy.

function focus_history_previous()
    local sel = client.focus
    local s
    if sel then
        s = sel.screen
    else
        s = mouse.screen
    end
    local c = focus_history_get(s, 1)
    if c then client.focus = c end
end
function focus_history_get(screen, idx)
    -- When this counter is equal to idx, we return the client
    local counter = 0
    local vc = client.get(screen)
    for k, c in ipairs(awful.client.data.focus) do
        if c.screen == screen then
            for j, vcc in ipairs(vc) do
                if vcc == c then
                    if counter == idx then
                        return c
                    end
                    -- We found one, increment the counter only.
                    counter = counter + 1
                    break
                end
            end
        end
    end
    -- Argh nobody found in history, give the first one visible if there is one
    -- that passes the filter.
    if counter == 0 then
        for k, v in ipairs(vc) do
            if awful.client.focus.filter(v) then
                return v
            end
        end
    end
end

Cheers,
Uli

-- 
The Angels have the phone box!

-- 
To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.

Reply via email to