awful.client: add tiled()

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-11-25 16:40:41 +01:00
parent d7f92fdf9f
commit bf7bae8082
1 changed files with 15 additions and 1 deletions

View File

@ -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.