From c6cac2a742b59df62286e4d7019c2cd2c977cd03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Wed, 3 Aug 2022 13:09:51 +0200 Subject: [PATCH] Use global bydirection --- awesome/keys.lua | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/awesome/keys.lua b/awesome/keys.lua index 4cb3f30..e691e77 100644 --- a/awesome/keys.lua +++ b/awesome/keys.lua @@ -32,28 +32,7 @@ local keys = {} -- Move given client to given direction local function move_client(c, direction) - -- If client is floating, move to edge - 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 + awful.client.swap.global_bydirection(direction, c, nil) end