diff --git a/lib/awful/client.lua.in b/lib/awful/client.lua.in index 67450870..4139d7d4 100644 --- a/lib/awful/client.lua.in +++ b/lib/awful/client.lua.in @@ -7,7 +7,6 @@ -- Grab environment we need local hooks = require("awful.hooks") local util = require("awful.util") -local layout = require("awful.layout") local tag = require("awful.tag") local pairs = pairs local ipairs = ipairs @@ -186,6 +185,21 @@ function visible(screen) return vcls end +--- Get visible and tiled clients +-- @param screen The screen number, or nil for all screens. +-- @return A tabl with all visible and tiled clients. +function tiled(screen) + local clients = visible(screen) + local tclients = {} + -- Remove floating clients + for k, c in pairs(clients) do + if not c.floating then + table.insert(tclients, c) + end + end + return tclients +end + --- Get a client by its relative index to the focused window. -- @usage Set i to 1 to get next, -1 to get previous. -- @param i The index.