Is there a way to make `membar` and `fs_bar` have gradient colors in conky?

461 Views Asked by At

Is there a way to make membar and fs_bar have gradient colors in conky? What I exactly need GREEN when the usage is low, YELLOW when mid-range, and RED when there is high usage of memory and disk space.

1

There are 1 best solutions below

1
On BEST ANSWER

The only way to do this easily is to write some code in lua. If you search you should find many examples, such as this. It uses a highly parameterable bargraph function.

For something simple in pure conky, you can use if_match to change the colour of the entire bar, eg:

${if_match $memperc>60} ${color red} $else ${color green} $endif ${membar 20,100}

You would need to nest another test for a yellow stage, and remove the spaces above if you do not want them to appear in the output.