Skip to content

Instantly share code, notes, and snippets.

@majecty
Created January 16, 2023 07:41
Show Gist options
  • Save majecty/937ff61ccdc1ea24759d36706dc45454 to your computer and use it in GitHub Desktop.
Save majecty/937ff61ccdc1ea24759d36706dc45454 to your computer and use it in GitHub Desktop.
function (c)
c.floating = true
local geo = {}
geo.x = screen[1].geometry.x
geo.y = screen[1].geometry.y
geo.width = screen[1].geometry.width
geo.height = screen[1].geometry.height
geo.x2 = geo.x + geo.width
geo.y2 = geo.y + geo.height
for s in screen do
local geo2 = s.geometry
geo.x = math.min(geo.x, geo2.x)
geo.y = math.min(geo.y, geo2.y)
geo.x2 = math.max(geo.x2, geo2.x + geo2.width)
geo.y2 = math.max(geo.y2, geo2.y + geo2.height)
end
c:geometry{
x = geo.x,
y = geo.y,
width = geo.x2 - geo.x,
height = geo.y2 - geo.y
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment