Move to screen instead of swapping to it
This commit is contained in:
parent
106eec9577
commit
1076b6eac3
|
@ -28,11 +28,37 @@ local keys = {}
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
-- Movement Functions (Called by some keybinds)
|
-- Movement Functions (Called by some keybinds)
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
|
local function get_screen(s)
|
||||||
|
return s and screen[s]
|
||||||
|
end
|
||||||
|
|
||||||
-- Move given client to given direction
|
-- Move given client to given direction
|
||||||
local function move_client(c, direction)
|
local function move_client(sel, dir)
|
||||||
awful.client.swap.global_bydirection(direction, c, nil)
|
sel = sel or awful.client.focus
|
||||||
|
if sel then
|
||||||
|
-- move focus
|
||||||
|
awful.client.focus.global_bydirection(dir, sel)
|
||||||
|
local c = client.focus
|
||||||
|
|
||||||
|
-- swapping inside a screen
|
||||||
|
if get_screen(sel.screen) == get_screen(c.screen) and sel ~= c then
|
||||||
|
c:swap(sel)
|
||||||
|
client.focus = sel
|
||||||
|
sel:raise()
|
||||||
|
|
||||||
|
-- swapping to an empty screen
|
||||||
|
elseif sel == c then
|
||||||
|
sel:move_to_screen(awful.screen.focused())
|
||||||
|
|
||||||
|
-- swapping to a nonempty screen
|
||||||
|
elseif get_screen(sel.screen) ~= get_screen(c.screen) and sel ~= c then
|
||||||
|
sel:move_to_screen(c.screen)
|
||||||
|
client.focus = sel
|
||||||
|
sel:raise()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- screen.focus(sel.screen)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue