mirror of https://github.com/lcpz/lain.git
Merge branch 'zdmgmail-master'
This commit is contained in:
commit
f55ba48d7a
|
@ -98,12 +98,38 @@ end
|
||||||
-- direction in {-1, 1} <-> {previous, next} non-empty tag
|
-- direction in {-1, 1} <-> {previous, next} non-empty tag
|
||||||
function util.tag_view_nonempty(direction,sc)
|
function util.tag_view_nonempty(direction,sc)
|
||||||
local s = sc or awful.screen.focused()
|
local s = sc or awful.screen.focused()
|
||||||
|
local tags = s.tags
|
||||||
|
local tag = s.selected_tag
|
||||||
|
local idx = awful.tag.getidx()
|
||||||
|
|
||||||
for _ = 1, #s.tags do
|
local looputil = function (start,e,inc)
|
||||||
awful.tag.viewidx(direction, s)
|
for i = start, e, inc do
|
||||||
if #s.clients > 0 then
|
local currentTag = s.tags[i]
|
||||||
|
if currentTag == tag then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if currentTag ~= nil then
|
||||||
|
if #currentTag:clients() > 0 then
|
||||||
|
currentTag:view_only()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if direction == 1 then
|
||||||
|
local r = looputil(idx+1,#tags,1)
|
||||||
|
if r then
|
||||||
|
looputil(1,idx,1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if direction == -1 then
|
||||||
|
local r = looputil(idx-1,0,-1)
|
||||||
|
if r then
|
||||||
|
looputil(#tags,idx,-1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue