awesome/tests/examples/sequences/client/swap1.lua

42 lines
1.3 KiB
Lua

--DOC_GEN_IMAGE --DOC_ASTERISK
local module = ... --DOC_HIDE
require("ruled.client") --DOC_HIDE
local awful = {tag = require("awful.tag"), layout = require("awful.layout")} --DOC_HIDE
awful.placement = require("awful.placement") --DOC_HIDE
require("awful.ewmh") --DOC_HIDE
screen[1]:fake_resize(0, 0, 800, 480) --DOC_HIDE
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, screen[1], awful.layout.suit.tile) --DOC_HIDE
function awful.spawn(name) --DOC_HIDE
client.gen_fake{class = name, name = name, x = 2094, y=10, width = 60, height =50, screen=screen[1]} --DOC_HIDE
end --DOC_HIDE
--DOC_NEWLINE
module.add_event("Spawn 5 clients in a `awful.layout.suit.tile` layout.", function() --DOC_HIDE
-- Spawn 5 clients.
for i=1, 5 do
awful.spawn("Client #"..i)
end
--DOC_NEWLINE
client.get()[2]:activate {}
client.get()[2].color = "#ff777733" --DOC_HIDE
end) --DOC_HIDE
--DOC_NEWLINE
module.display_tags() --DOC_HIDE
module.add_event("Call `:swap()` on the second client.", function() --DOC_HIDE
client.get()[2]:swap(client.get()[4])
end) --DOC_HIDE
module.display_tags() --DOC_HIDE
module.execute { display_screen = true , display_clients = true, --DOC_HIDE
display_label = false, display_client_name = true, --DOC_HIDE
display_mouse = true , --DOC_HIDE
} --DOC_HIDE