If statement 带有if#u匹配和';和';

If statement 带有if#u匹配和';和';,if-statement,conky,If Statement,Conky,我很难在谷歌上搜索我想做的事情,因为我的搜索关键词含义广泛 我正试图修改我的.conkyrc文件以根据温度更改字体颜色,这需要我编写如下内容: if [ $test >="50" and $test <="60"]; 还有,我能用elseif和conky吗 ${if_match "$test" >="113"}${color4}${elseif "$test1" <="120"}${color5}${endif} ${if_match“$test”>=“113”}${

我很难在谷歌上搜索我想做的事情,因为我的搜索关键词含义广泛

我正试图修改我的.conkyrc文件以根据温度更改字体颜色,这需要我编写如下内容:

if [ $test >="50" and $test <="60"];
还有,我能用elseif和conky吗

${if_match "$test" >="113"}${color4}${elseif "$test1" <="120"}${color5}${endif}

${if_match“$test”>=“113”}${color4}${elseif“$test1”模拟一个,您可以使用两个嵌套的IFs,方法如下:

${if_match ${battery_percent BAT0} <= 60}${if_match ${battery_percent BAT0} >=50} my battery is between 50 and 60 ${endif}${endif}
${if_match${batty_percent BAT0}=50}我的电池在50到60${endif}${endif}
(注意双${endif}:如果打开两个IFs,则应关闭两个IFs)

您还可以模拟嵌套两个IF的elseif:

${if_match "$test" >="113"}${color4}\
    ${else}${if_match "$test" <="120"}${color5}${endif}\
${endif}  
${if_匹配“$test”>=“113”}${color4}\
${else}${if_匹配“$test”
${if_match "$test" >="113"}${color4}\
    ${else}${if_match "$test" <="120"}${color5}${endif}\
${endif}