5

I have a file when the line 15 has the full path to an icon. That said, I want to display that icon using the ${image} variable:

${image myImage.png -p 0,10 -s 50x50}

To get the line value, I would use sed:

${exec sed -n '15p' $HOME/.Shell/Conky/ConkyWeather/dataWeather.txt}

My question is, how can I do both things together? My current code is not working. I tried:

${image ${exec sed -n '15p' $HOME/.Shell/Conky/ConkyWeather/dataWeather.txt} -p 0,10 -s 50x50}

And:

${image exec sed -n '15p' $HOME/.Shell/Conky/ConkyWeather/dataWeather.txt -p 0,10 -s 50x50}

So, how can I make a variable work inside a variable and call exec inside image? Btw, if you know any other way to read the line and insert into image, it will do as well.

1 Answers1

0

As a workaround, you can try backticks.

Test backticks: ${exec echo `echo foo` bar}

Visual result:

conky command with backticks

From the above result, you may try

${image `sed -n '15p' $HOME/.Shell/Conky/ConkyWeather/dataWeather.txt` -p 0,10 -s 50x50}