如何访问很棒的嵌套小部件属性
我正在尝试访问以下小部件的属性:
local cpu_widget = wibox.widget{
{
max_value = 100,
paddings = 1,
border_width = 2,
widget = wibox.widget.progressbar,
},
{
font = beautiful.font_type .. "8",
widget = wibox.widget.textbox,
},
forced_height = 100,
forced_width = 20,
direction = 'east',
layout = wibox.container.rotate,
}
我已经尝试使用 cpu_widget [1] .Value
或 cpu_widget [2] .Text
,但这没用。
关于我该怎么做的任何想法?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅(我似乎无法直接链接到本节)
:您可以添加
ID =“ bar”
>id =“ text”
到您的小部件,并使用这些标识符再次检索小部件。如果Elv13看到这个答案:您在文档上做得很好!
See the "Accessing Widgets" on https://awesomewm.org/doc/api/documentation/03-declarative-layout.md.html (I can't seem to link to this section directly)
Basically: You can add
id = "bar"
andid = "text"
to your widgets and use these identifiers to retrieve the widgets again.In case Elv13 ever sees this answer: You did great work on the docs!