我在水平线上有三个显示器。有时我想通过按下组合键(然后在必要时将其全部返回)一次最大化一个窗口到三个监视器。我怎么能这样做?
答案 0 :(得分:2)
未经测试,但基本的想法是让窗口浮动并调整它以覆盖所有内容:
function(c)
c.floating = true
local geo = screen[1].geometry
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
}
end
要撤消上述操作,请使客户端不再浮动,即c.floating = false
。
将上述内容连接到键绑定是留给读者的练习。