Add awful.widget.tasklist.filter.minimizedcurrenttags
Added function to show only minimized clients in the taskbar for the current tag. Signed-off-by: Danny Navarro <j@dannynavarro.net> Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
fc44f4a049
commit
a44439a6c0
|
@ -159,6 +159,32 @@ function filter.currenttags(c, screen)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Filtering function to include only the minimized clients from currently selected tags.
|
||||||
|
-- @param c The client.
|
||||||
|
-- @param screen The screen we are drawing on.
|
||||||
|
-- @return true if c is in a selected tag on screen and is minimized, false otherwise
|
||||||
|
function filter.minimizedcurrenttags(c, screen)
|
||||||
|
-- Only print client on the same screen as this widget
|
||||||
|
if c.screen ~= screen then return false end
|
||||||
|
-- Include sticky client
|
||||||
|
if c.sticky then return true end
|
||||||
|
-- Check client is minimized
|
||||||
|
if not c.minimized then return false end
|
||||||
|
tags = capi.screen[screen]:tags()
|
||||||
|
for k, t in ipairs(tags) do
|
||||||
|
-- Select only minimized clients
|
||||||
|
if t.selected then
|
||||||
|
local ctags = c:tags()
|
||||||
|
for _, v in ipairs(ctags) do
|
||||||
|
if v == t then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
--- Filtering function to include only the currently focused client.
|
--- Filtering function to include only the currently focused client.
|
||||||
-- @param c The client.
|
-- @param c The client.
|
||||||
-- @param screen The screen we are drawing on.
|
-- @param screen The screen we are drawing on.
|
||||||
|
|
Loading…
Reference in New Issue