>> I would like to have a function for viewing the next and previous non-empty
>> tag (modulo sticky clients I suppose, but I don't really have any of those).
>> I tried to break out and modify the viewnext/viewidx functions from
>> awful.tag, but I messed up. Hacking rc.lua usually goes well, but the capi
>> is a bit tougher. May I ask for some help? Wouldn't be surprised if this is
>> already done somewhere.
>
> Dunno if this works, I've written this right now and never tested it:
>
> function view_non_empty(step, s)
>    local s = s or 1
>    -- The following makes sure we don't go into an endless loop
>    -- if no clients are visible. I guess that case could be handled better,
>    -- but meh
>    local num_tags = #screen[s]:tags()
>    for i=1, num_tags do
>      awful.tag.viewidx(step, s)
>      if #awful.tag.visible(s) == 0 then
>        return
>      end
>    end
> end

Thanks a lot, but I can't quite get it to work; can't seem to get a correct
screen "s" passed into viewidx(). That function just complains "tag.lua:347:
attempt to index local 'screen' (a number value)". Have tried passing it
nothing and mouse.screen ...


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

Reply via email to