Add awful.client.setmaster

This function is the counterpart of awful.client.setslave.

Windows is moved to the first position in the stack.

Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Sébastien Luttringer 2012-08-11 23:55:25 +02:00 committed by Uli Schlachter
parent 0817c7f460
commit a6ae34d003
1 changed files with 9 additions and 0 deletions

View File

@ -410,6 +410,15 @@ function client.getmaster(screen)
return client.visible(s)[1] return client.visible(s)[1]
end end
--- Set the client as master: put it at the beginning of other windows.
-- @param c The window to set as master.
function client.setmaster(c)
local cls = util.table.reverse(capi.client.get(c.screen))
for k, v in pairs(cls) do
c:swap(v)
end
end
--- Set the client as slave: put it at the end of other windows. --- Set the client as slave: put it at the end of other windows.
-- @param c The window to set as slave. -- @param c The window to set as slave.
function client.setslave(c) function client.setslave(c)