On 14.02.2012 11:43, Daniel wrote:
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
This won't do what you want when there are sticky clients, but since you usually
don't have any sticky clients anyway...
Uli
--
To unsubscribe, send mail to [email protected].