Created
January 16, 2023 07:41
-
-
Save majecty/937ff61ccdc1ea24759d36706dc45454 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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