1

多年来,我一直在尝试来自 KDE/MATE 的真棒,我真的很喜欢它。我以前的工作流程中确实只缺少一件事。

有时我正在使用具有大量浮动窗口的应用程序。我发现浮动 WM 非常有用的是能够卷起或遮蔽窗口,基本上只保留应用程序的标题栏,但隐藏其窗口内容。

这可能很棒吗?或者是否有其他选项,如选项卡窗口(如 i3 中)或者您有其他建议吗?

提前非常感谢!

4

1 回答 1

0

这可能很棒吗?

理论上是的,但实际上我不知道有谁实施了必要的魔法来使其正常工作。一个半好的第一个近似值可能是将窗口大小调整为高度 1。

未经测试的草图:

function toggle_roll_up_or_shade(c)
    if c.shade then
        c:geometry{ height = c.shade }
        c.shade = nil
        c.size_hints_honor = c.size_hints_honor_before_shade
    elseif c.floating then
        c.shade = c.height
        c.size_hints_honor_before_shade = c.size_hints_honor
        c.size_hints_honor = false
        c:geometry{ height = 1 }
    end
end

然后,上述函数将绑定到某个键,类似于awful.client.floating.toggle在默认配置中绑定 Mod+Ctrl+Space 的方式。

这是一个可能适用于 AwesomeWM v3.5 的变体:

function toggle_roll_up_or_shade(c)
    if awful.client.property.get(c, "shade") then
        c:geometry{ height = c.shade }
        awful.client.property.set(c, "shade", nil)
        c.size_hints_honor = c.size_hints_honor_before_shade
    elseif c.floating then
        client.property.set(c, "shade", c.height)
        client.property.set(c, "size_hints_honor_before_shade", c.size_hints_honor)
        c.size_hints_honor = false
        c:geometry{ height = 1 }
    end
end

另外,如果你想获得标题栏的高度,你应该可以使用local _, height = c:titlebar_top(). 我不确定这是否也适用于 AwesomeWM v3.5。

于 2019-04-09T20:58:42.607 回答