【问题标题】:How do I maximize the window to multiple monitors in awesome wm?如何在很棒的 wm 中将窗口最大化到多个显示器?
【发布时间】:2018-02-17 19:27:28
【问题描述】:

我在水平线上有三台显示器。有时我想通过按组合键一次将一个窗口最大化到三个监视器(然后在必要时将其全部返回)。我该怎么做?

【问题讨论】:

    标签: multiple-monitors awesome-wm


    【解决方案1】:

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

    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

    将以上内容连接到键绑定留给读者作为练习。

    【讨论】:

    • 工作。但是 screen.geometry 代替了 screen:geometry()。谢谢!
    • 哎呀,对不起。已更新。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-04-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多