Merge pull request #2358 from Elv13/add_filter_section

doc: Add filter section for the taglist and tasklist
This commit is contained in:
mergify[bot] 2018-08-19 07:02:06 +00:00 committed by GitHub
commit 81da3a2ce7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 0 deletions

View File

@ -68,6 +68,8 @@ new_type("clientlayout", "Client layouts", false, "param")
new_type("callback", "Callback functions prototype", false, "Parameters") new_type("callback", "Callback functions prototype", false, "Parameters")
-- awful.rules sources -- awful.rules sources
new_type("rulesources", "Rule sources", false, "param") new_type("rulesources", "Rule sources", false, "param")
-- Filter functions for the taglist/tasklist/layoutlist
new_type("filterfunction", "List filters", false)
-- More fitting section names -- More fitting section names
kind_names={topic='Documentation', module='Libraries', script='Sample files'} kind_names={topic='Documentation', module='Libraries', script='Sample files'}

View File

@ -550,6 +550,7 @@ end
--- Filtering function to include all nonempty tags on the screen. --- Filtering function to include all nonempty tags on the screen.
-- @param t The tag. -- @param t The tag.
-- @return true if t is not empty, else false -- @return true if t is not empty, else false
-- @filterfunction awful.taglist.filter.noempty
function taglist.filter.noempty(t) function taglist.filter.noempty(t)
return #t:clients() > 0 or t.selected return #t:clients() > 0 or t.selected
end end
@ -557,12 +558,14 @@ end
--- Filtering function to include selected tags on the screen. --- Filtering function to include selected tags on the screen.
-- @param t The tag. -- @param t The tag.
-- @return true if t is not empty, else false -- @return true if t is not empty, else false
-- @filterfunction awful.taglist.filter.selected
function taglist.filter.selected(t) function taglist.filter.selected(t)
return t.selected return t.selected
end end
--- Filtering function to include all tags on the screen. --- Filtering function to include all tags on the screen.
-- @return true -- @return true
-- @filterfunction awful.taglist.filter.all
function taglist.filter.all() function taglist.filter.all()
return true return true
end end

View File

@ -599,6 +599,7 @@ end
--- Filtering function to include all clients. --- Filtering function to include all clients.
-- @return true -- @return true
-- @filterfunction awful.tasklist.filter.allscreen
function tasklist.filter.allscreen() function tasklist.filter.allscreen()
return true return true
end end
@ -607,6 +608,7 @@ end
-- @param c The client. -- @param c The client.
-- @param screen The screen we are drawing on. -- @param screen The screen we are drawing on.
-- @return true if c is on screen, false otherwise -- @return true if c is on screen, false otherwise
-- @filterfunction awful.tasklist.filter.alltags
function tasklist.filter.alltags(c, screen) function tasklist.filter.alltags(c, screen)
-- Only print client on the same screen as this widget -- Only print client on the same screen as this widget
return get_screen(c.screen) == get_screen(screen) return get_screen(c.screen) == get_screen(screen)
@ -616,6 +618,7 @@ end
-- @param c The client. -- @param c The client.
-- @param screen The screen we are drawing on. -- @param screen The screen we are drawing on.
-- @return true if c is in a selected tag on screen, false otherwise -- @return true if c is in a selected tag on screen, false otherwise
-- @filterfunction awful.tasklist.filter.currenttags
function tasklist.filter.currenttags(c, screen) function tasklist.filter.currenttags(c, screen)
screen = get_screen(screen) screen = get_screen(screen)
-- Only print client on the same screen as this widget -- Only print client on the same screen as this widget
@ -640,6 +643,7 @@ end
-- @param c The client. -- @param c The client.
-- @param screen The screen we are drawing on. -- @param screen The screen we are drawing on.
-- @return true if c is in a selected tag on screen and is minimized, false otherwise -- @return true if c is in a selected tag on screen and is minimized, false otherwise
-- @filterfunction awful.tasklist.filter.minimizedcurrenttags
function tasklist.filter.minimizedcurrenttags(c, screen) function tasklist.filter.minimizedcurrenttags(c, screen)
screen = get_screen(screen) screen = get_screen(screen)
-- Only print client on the same screen as this widget -- Only print client on the same screen as this widget
@ -667,6 +671,7 @@ end
-- @param c The client. -- @param c The client.
-- @param screen The screen we are drawing on. -- @param screen The screen we are drawing on.
-- @return true if c is focused on screen, false otherwise -- @return true if c is focused on screen, false otherwise
-- @filterfunction awful.tasklist.filter.focused
function tasklist.filter.focused(c, screen) function tasklist.filter.focused(c, screen)
-- Only print client on the same screen as this widget -- Only print client on the same screen as this widget
return get_screen(c.screen) == get_screen(screen) and capi.client.focus == c return get_screen(c.screen) == get_screen(screen) and capi.client.focus == c