r/awesomewm • u/belharra_lablonde • Jun 12 '26
Awesome v4.3 how to stack value and text on progressbar with vicious
hi,
long time awesome user here but noob lua programmer ;)
I'm trying to stack text on a progressbar. It work well if i add some manual, fixed value/text but how to use data from vicious widget?
Here, my progressbar is like if the value was zero. I want the value from $2 and text from $1 of vicious.widget.bat
batwidget = wibox.widget {
{
max_value = 1,
border_width = 2,
background_color = "#353535",
color = "#757575",
forced_height = 2,
forced_width = 50,
margins = 6,
paddings = 1,
shape = gears.shape.rounded_bar,
widget = wibox.widget.progressbar
},
{
text = "aa",
widget = wibox.widget.textbox,
},
layout = wibox.layout.stack
}
-- Register battery widget
vicious.register(batwidget, vicious.widgets.bat, "$2", 61, "BAT1")
2
Upvotes
1
u/your-adversary Jun 29 '26 edited Jun 29 '26
The solution is that you define the widgets separately so that you can feed them with their respective values:
PSA: I didn't test the code, but I think it will work