forked from ashpie/simple-awesome
Add tiling shortcuts to move windows between entire screens
This commit is contained in:
parent
366811bd37
commit
b8aff62b38
@ -446,6 +446,12 @@ clientkeys = gears.table.join(-- tiling
|
|||||||
awful.key({ config.keys.modkey, }, "Left",
|
awful.key({ config.keys.modkey, }, "Left",
|
||||||
tiling.key.tileLeft,
|
tiling.key.tileLeft,
|
||||||
{ description = "Tile left", group = "tiling" }),
|
{ description = "Tile left", group = "tiling" }),
|
||||||
|
awful.key({ config.keys.modkey, "Control" }, "Right",
|
||||||
|
tiling.key.screenRight,
|
||||||
|
{ description = "Screen right", group = "tiling" }),
|
||||||
|
awful.key({ config.keys.modkey, "Control" }, "Left",
|
||||||
|
tiling.key.screenLeft,
|
||||||
|
{ description = "Screen left", group = "tiling" }),
|
||||||
awful.key({ config.keys.modkey, }, "Up",
|
awful.key({ config.keys.modkey, }, "Up",
|
||||||
tiling.key.toggleMaximized,
|
tiling.key.toggleMaximized,
|
||||||
{ description = "Toggle maximized", group = "tiling" }),
|
{ description = "Toggle maximized", group = "tiling" }),
|
||||||
|
@ -32,28 +32,42 @@ local applyTile = function(c, geometry)
|
|||||||
return not geometryEquals(initialGeometry, newGeometry)
|
return not geometryEquals(initialGeometry, newGeometry)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local screenLeft = function(geo)
|
||||||
|
return function (c)
|
||||||
|
local newScreen = c.screen.get_next_in_direction(c.screen, "left")
|
||||||
|
if newScreen ~= nil then
|
||||||
|
c.screen = newScreen
|
||||||
|
applyTile(c, geo)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local screenRight = function(geo)
|
||||||
|
return function (c)
|
||||||
|
local newScreen = c.screen.get_next_in_direction(c.screen, "right")
|
||||||
|
if newScreen ~= nil then
|
||||||
|
c.screen = newScreen
|
||||||
|
applyTile(c, geo)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
key = {
|
key = {
|
||||||
tileRight = function (c)
|
tileRight = function (c)
|
||||||
c.maximized = true
|
c.maximized = true
|
||||||
if not applyTile(c, rightTileGeometry) then
|
if not applyTile(c, rightTileGeometry) then
|
||||||
local newScreen = c.screen.get_next_in_direction(c.screen, "right")
|
screenRight(leftTileGeometry)(c)
|
||||||
if newScreen ~= nil then
|
|
||||||
c.screen = newScreen
|
|
||||||
applyTile(c, leftTileGeometry)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
tileLeft = function (c)
|
tileLeft = function (c)
|
||||||
c.maximized = true
|
c.maximized = true
|
||||||
if not applyTile(c, leftTileGeometry) then
|
if not applyTile(c, leftTileGeometry) then
|
||||||
local newScreen = c.screen.get_next_in_direction(c.screen, "left")
|
screenLeft(rightTileGeometry)(c)
|
||||||
if newScreen ~= nil then
|
|
||||||
c.screen = newScreen
|
|
||||||
applyTile(c, rightTileGeometry)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
screenLeft = screenLeft(maximizedTileGeometry),
|
||||||
|
screenRight = screenRight(maximizedTileGeometry),
|
||||||
toggleMaximized = function (c)
|
toggleMaximized = function (c)
|
||||||
if not c.maximized then
|
if not c.maximized then
|
||||||
c.maximized = true
|
c.maximized = true
|
||||||
|
Loading…
Reference in New Issue
Block a user