如何在 awesome wm 中将 window 最大化到多个显示器?

How do I maximize the window to multiple monitors in awesome wm?

我在水平线上有三个显示器。有时我想同时将 window 最大化到三个显示器,方法是按组合键(然后在必要时将其全部返回)。我该怎么做?

未经测试,但基本思路是使 window 浮动并调整其大小以覆盖所有内容:

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

将以上内容连接到键绑定留作 reader.

的练习