mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
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
1 changed files with 26 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue