简体   繁体   English

您可以将客户端放入awesome-wm的小部件层次结构中吗?

[英]Can you put a client into a widget hierarchy in awesome-wm?

I was wondering if you can put the client into a widget hierarchy. 我想知道是否可以将客户端放入小部件层次结构。 Basically is there a way to do something like: 基本上有一种方法可以执行以下操作:

local cool_background_widget = wibox.widget({
    widget = wibox.container.background,
    {
        client, --??????
    }
})

I'm expecting there isn't but if there's not, is there some hacky way to do it? 我期望没有,但是如果没有,是否有一些骇人听闻的方法可以做到?

Short answer: no. 简短的回答:不。 But there's a few way around this. 但是有一些解决方法。

1: Using a client + titlebars as top bar 1:使用客户端+标题栏作为顶部栏

If you only need a single client within your wibar/wibox, then you can put a different titlebar around that client and use that as your top (or whatever) bar. 如果在wibar / wibox中只需要一个客户端,则可以在该客户端周围放置一个不同的标题栏,并将其用作顶部(或其他)栏。 To add space like a normal bar, either play with the client :struts() property or use screen.padding . 要像普通酒吧一样增加空间,请使用client :struts()属性或使用screen.padding

2: Create a custom placeholder widget 2:创建自定义占位符小部件

The second option is to create a new widget, then use its own :draw() function as a hook to know when to move the client (using c:geometry() ). 第二个选项是创建一个新的小部件,然后使用其自己的:draw()函数作为挂钩来了解何时移动客户端(使用c:geometry() )。 This is mostly what the dynamic client layout branch does . 这主要是动态客户端布局分支所做的 This has some issues like having to keep raising the client. 这有一些问题,例如必须继续提高客户。 You also have to disconnect a bunch of thing to prevent existing code path from affecting client (like the request::geometry handlers, such as the one to move/resize the client using mod4+mouse ). 您还必须断开许多连接,以防止现有代码路径影响客户端(例如request::geometry处理程序,例如使用mod4+mouse移动/调整客户端大小的处理程序)。 You also need to make the client floating and sticky to get the correct result. 您还需要使客户端floating并保持sticky以获得正确的结果。

3: Patches welcome 3:欢迎补丁

It is important to keep in mind that there is no technical limitations that prevent this feature from being implemented. 重要的是要牢记,没有任何技术限制会阻止此功能的实现。 There is an existing issue regarding adding this. 有关添加此内容,存在一个现有问题 In some alternate universe where both the core AwesomeWM developers would have unlimited time, this would be a feature. 在某些替代性环境中,两个核心AwesomeWM开发人员都将拥有无限的时间,这将是一项功能。 We are discussing doing it for the individual systray "icons" first. 我们正在讨论首先针对单个系统托盘“图标”执行此操作。 This issue is also a good reference, but in this case would not be enough to implement what you request. 问题也是一个很好的参考,但是在这种情况下,这不足以实现您的要求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM