Search code examples
linuxconky

Piping file contents to conky?


I have been writing a script to check the weather. The script is fine and is working great as a cronjob but, I am now trying to have the results from the script(todays weather forecast) displayed in conky.

I have a file 'weather-outside' that the python-weather script writes to then I add this to the conkyrc file:

${color grey}Weather:${scroll 16 $execi 3600 cat $/home/User/Desktop/misc./weather-outside | fold}

The execi command is suppose to run at interval set to 3600secs but, this is the error message when running conky after:

Conky: execi needs arguments
Conky: Error destroying thread
***** Imlib2 Developer Warning ***** :
    This program is calling the Imlib call:

    imlib_context_free();

    With the parameter:

    context

    being NULL. Please fix your program.

I have changed execi to exec but, then the actually line 'cat $home/User/Desktop/misc./weather-outside | fold' scrolls across conky not the text from that file?


Solution

  • Do not use file to get the information to display in conky. I don't know how you do it in Python but when I wrote Java application to get twitter feed to be displayed in conky I directly printed it to the console and used execi. This is how I used it

    ${execi 600 java -cp /home/aman/java/classes MyApp}
    

    Also your file path seems odd to me.

    This way you can keep weather info updated without having to update the text file too.