You are not logged in.
Hi
I am using awesome windows manager with vicious widgets. I wonder if there is a way to change text color of my-battery widget depanding on charging status (i.e. green when charging, red when not; or green when the capacity > 90% etc. ).
Usually, the code of a battery widget should like this:
vicious.register(batwid, vicious.widgets.bat, '$1 $2% $3', 60, "BAT0")where $1 means charging status (+ or -), $2 means capacity (int) and $3 means time remain (int) , so I guess I can use
if $1 == + then ... else ... end or something. But I found no where to place this command: putting it inside the quotes, then the "if ... then ... " will also be shown, outside the quotes, then $1 won't be recognized.
THX
Last edited by gtolden (2013-08-06 13:04:05)
Offline
You can use a function to achieve what you want. With the function you can access those values and choose what to pipe in the statusbar. There is a lot of examples arround in arch foruns and the internet. But you can look at my battery widget and make your own widget https://github.com/ilusi0n/dotcats/blob … idgets.lua
Offline
Wow, awesome! Thanks, that's exactlly what I need, as well as many tips I can learn from your example. ![]()
many thanks for sharing
Offline