简体   繁体   English

有没有办法让`membar`和`fs_bar`在conky中有渐变colors?

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

Is there a way to make membar and fs_bar have gradient colors in conky?有没有办法让membarfs_bar在 conky 中具有渐变 colors? 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.当使用率低时我确切需要GREEN ,中档时需要YELLOW ,当 memory 和磁盘空间使用率高时需要RED

The only way to do this easily is to write some code in lua .轻松做到这一点的唯一方法是在lua中编写一些代码。 If you search you should find many examples, such as this .如果您搜索,您应该会找到许多示例,例如this It uses a highly parameterable bargraph function.它使用高度可参数化的条形图 function。

For something simple in pure conky, you can use if_match to change the colour of the entire bar , eg:对于纯 conky 中的简单内容,您可以使用if_match更改整个 bar的颜色,例如:

${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.您需要为黄色阶段嵌套另一个测试,如果您不希望它们出现在 output 中,则删除上面的空格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM