gpt4 book ai didi

linux - 卷起/遮挡 float 窗口真棒?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:14:18 26 4
gpt4 key购买 nike

多年来我一直在尝试来自 KDE/MATE 的很棒的东西,我真的很喜欢它。在我之前的工作流程中,我真的只遗漏了一件事。

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

这在 awesome 中可能吗?或者是否有其他选项,如标签窗口(如 i3 中的)或您有其他建议吗?

提前致谢!

最佳答案

Is this possible in awesome?

理论上是的,但实际上我不知道有谁实现了必要的魔法来使这项工作正常进行。一个半好的一阶近似值可能是将窗口的大小调整为高度 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

然后上面的函数将绑定(bind)到一些键,类似于默认配置中 Mod+Ctrl+Space 绑定(bind)到 awful.client.floating.toggle 的方式。

这是一个可能适用于 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。

关于linux - 卷起/遮挡 float 窗口真棒?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55594605/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com