如何在AwesomeWM中添加一个小部件?
我想在Systray中添加一个电池小部件。我该怎么做? Systray如何识别要投入哪些程序?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我想在Systray中添加一个电池小部件。我该怎么做? Systray如何识别要投入哪些程序?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
我只是想到这个问题具有
Awesome-wm
标签,因此请忽略我的X11-ASWER。这是另一种尝试。从lua代码中,无法将任何东西添加到
wibox.widget.systray
。但是,您只需将awful.widget.imagebox
或awful.widget.button
在您的Wibar中的systray旁边。我认为 这样的systray旁边有另一个小部件应该看起来好像Systray中还有另一个条目。It just occurred to me that this question has the
awesome-wm
tag, so ignore my X11-answer. Here is another attempt.There is no way to add anything to a
wibox.widget.systray
from Lua code. However, you could just put aawful.widget.imagebox
orawful.widget.button
next to the systray in your wibar. I think that having another widget next to the systray like this should look just as if there was another entry in the systray.这是一个协议。情况很复杂。我真的认为:不,您不想自己做。
无论如何,这是规格: https:/ /SystemTray-spec/systemtray-spec-0.2.html
托盘图标(=您要编写的程序)找到托盘管理器(请参阅
找到系统托盘
),然后请求要停靠(请参阅docking try try iCon
)。为此,它创建一个窗口,然后将此窗口添加到系统托盘中。由于上面提到了Xembed,因此这是其规格:
It's a protocol. It's complicated. I really think that: No, you do not want to do it yourself.
Anyway, here is the specification: https://specifications.freedesktop.org/systemtray-spec/systemtray-spec-0.2.html
The tray icon (=the program you want to write) locates the tray manager (see section
Locating the system tray
) and then requests to be docked (see sectionDocking a try icon
). For this, it creates a window and this window will then be added to the system tray.Since the above mentions XEmbed, here is its spec: https://specifications.freedesktop.org/xembed-spec/xembed-spec-latest.html