Use global bydirection
This commit is contained in:
parent
a066c28b67
commit
c6cac2a742
|
@ -32,28 +32,7 @@ local keys = {}
|
||||||
|
|
||||||
-- Move given client to given direction
|
-- Move given client to given direction
|
||||||
local function move_client(c, direction)
|
local function move_client(c, direction)
|
||||||
-- If client is floating, move to edge
|
awful.client.swap.global_bydirection(direction, c, nil)
|
||||||
if c.floating or (awful.layout.get(mouse.screen) == awful.layout.suit.floating) then
|
|
||||||
local workarea = awful.screen.focused().workarea
|
|
||||||
if direction == "up" then
|
|
||||||
c:geometry({nil, y = workarea.y + beautiful.useless_gap * 2, nil, nil})
|
|
||||||
elseif direction == "down" then
|
|
||||||
c:geometry({nil, y = workarea.height + workarea.y - c:geometry().height - beautiful.useless_gap * 2 - beautiful.border_width * 2, nil, nil})
|
|
||||||
elseif direction == "left" then
|
|
||||||
c:geometry({x = workarea.x + beautiful.useless_gap * 2, nil, nil, nil})
|
|
||||||
elseif direction == "right" then
|
|
||||||
c:geometry({x = workarea.width + workarea.x - c:geometry().width - beautiful.useless_gap * 2 - beautiful.border_width * 2, nil, nil, nil})
|
|
||||||
end
|
|
||||||
-- Otherwise swap the client in the tiled layout
|
|
||||||
elseif awful.layout.get(mouse.screen) == awful.layout.suit.max then
|
|
||||||
if direction == "up" or direction == "left" then
|
|
||||||
awful.client.swap.byidx(-1, c)
|
|
||||||
elseif direction == "down" or direction == "right" then
|
|
||||||
awful.client.swap.byidx(1, c)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
awful.client.swap.bydirection(direction, c, nil)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue