如何在AwesomeWM中添加一个小部件?

发布于 2025-01-21 12:09:09 字数 54 浏览 0 评论 0 原文

我想在Systray中添加一个电池小部件。我该怎么做? Systray如何识别要投入哪些程序?

I want to add a battery widget to the systray. How can I do that? How does systray recognize what programs to put in it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

绿阴红影里的.如风往事 2025-01-28 12:09:09

我只是想到这个问题具有 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 a awful.widget.imagebox or awful.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.

我还不会笑 2025-01-28 12:09:09

这是一个协议。情况很复杂。我真的认为:不,您不想自己做。

无论如何,这是规格: https:/ /SystemTray-spec/systemtray-spec-0.2.html

Systray如何识别要放入哪些程序?

托盘图标(=您要编写的程序)找到托盘管理器(请参阅找到系统托盘),然后请求要停靠(请参阅 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

How does systray recognize what programs to put in it?

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 section Docking 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文