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

标签 linux awesome-wm window-management

多年来我一直在尝试来自 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/

相关文章:

c - 使用 gcc -Q -v "options enabled"和 "options passed"有什么区别

windows - 阻止另一个程序获得焦点

lua - awesome-wm:如何更改系统托盘形状

macos - 使用 AppleScript 访问停靠栏图标右键单击菜单项

show-hide - _NET_WM_STATE_HIDDEN 是否暗示 _NET_WM_STATE_SKIP_TASKBAR

linux - 使用多宿主配置本地虚拟网络

linux - 使用 shell 脚本遍历 $PATH 变量

c - 获取已安装程序的编译信息

lua - Awesome 中缺少 Xpdf pid

lua - 我的 if-then-else-end 语句在 Lua 中失败了;我该如何修复它?