diff --git a/lib/awful/widget/tasklist.lua.in b/lib/awful/widget/tasklist.lua.in index 49813cee..82ca8821 100644 --- a/lib/awful/widget/tasklist.lua.in +++ b/lib/awful/widget/tasklist.lua.in @@ -159,6 +159,32 @@ function filter.currenttags(c, screen) return false 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. -- @param c The client. -- @param screen The screen we are drawing on.