I ma using gmail.py from ArchWiki to display new mail count in gmail. The script works fine and displays my new mail count correctly.

The problem I am facing is when I restart conky after adding the above script to my conky.config conky took a little time(arnd 4-5s) to load and display. The reason I believe is gmail.py take sometime to fetch mail count thereby leading to conky's delay. By delay I mean conky display's nothing for around 4-5s when I run it.

Now, as soon as I remove gmail.py conky is back to normal.

So, I was thinking is there any in-built feature in conky which make sure that other conky objects like cpu temp,uptime,date etc are loaded and displayed while it executes gmail.py in background and than update conky accordingly.

Relevant line in conky:

Gmail: ${color red}${execpi 900 python /home/ranrag/.scripts/gmail.py}${color}

I am using ubuntu 12.04 and openbox.

  • If it's just python, add a sleep command during init so it doesn't hold during run(or try relaunching since the conversion from py to pyc only happens on changes afaik). – RobotHumans Jun 28 '12 at 6:26
  • @aking1012: Thanks. I am pretty new to linux so can you please elaborate a little on what do you mean by add a sleep command during init. – RanRag Jun 28 '12 at 6:31

I found a possible solution using $texeci. What it does is

Runs a command at an interval inside a thread and displays the output. Same as $execi, except the command is run inside a thread. Use this if you have a slow script to keep Conky updating.

So, now when I run my conky it dislpays all my conky objects first and than it auto-fill Gmail field after a few seconds.

PS: I am still open to other alternative answers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.