diff --git a/rc/widgets.lua b/rc/widgets.lua index b89159f..dd911b3 100644 --- a/rc/widgets.lua +++ b/rc/widgets.lua @@ -25,8 +25,18 @@ local batwidget = "" if config.hostname == "guybrush" then batwidget = widget({ type = "textbox" }) vicious.register(batwidget, vicious.widgets.bat, - 'BAT: ' .. - '$1 $2%', + function (widget, args) + local color = beautiful.fg_widget_value + local current = args[2] + if current < 10 then + color = beautiful.fg_widget_value_important + end + return string.format( + 'BAT: ' .. + '%s %d%%', args[1], current) + end, 61, "BAT1") end