我在图像的动态定位方面遇到了问题。基本上,我制作了一个 Conky 主题,它会根据情况而移动。这个主题的底部是一个进程表。我已将图像插入为该表的垂直线,但我需要它们自动移动。
我有一个脚本,它会根据情况返回560
、610
或。这些数字是图像的坐标。我可以通过以下命令在 Conky 中显示脚本的输出: 。我如何将其用作整数来定位我的图像?我试过了:无济于事。有什么建议吗?660
y
${exec bash /etc/conky/network.sh}
${image /etc/conky/Line.png -p 120, ${exec bash /etc/conky/network.sh} -s 1x180}
答案1
execp command differs from $exec in that it parses the output of the command, so you can insert things like ${color red}hi!${color} in your script and have it correctly parsed by Conky. Caveats: Conky parses and evaluates the output of $execp every time Conky loops, and then destroys all the objects. If you try to use anything like $execi within an $execp statement, it will functionally run at the same interval that the $execp statement runs, as it is created and destroyed at every interval.
您可以有 /etc/conky/network.sh 输出:${image /etc/conky/Line.png -p 120,560 -s 1x180}
或者如果您可以确定脚本中的情况,则输出其他 2 个。
这${execp bash /etc/conky/network.sh}
将取代${image /etc/conky/Line.png -p 120, ${exec bash /etc/conky/network.sh} -s 1x180}
在你的脚本中