I don't know if anyone else has done this already, but I just came up with a huge improvement to Conky. A problem with conkyEmail display is that you cannot see when a new message arrives any time an open window is covering the Conky output.
I resolved this issue by now having my email Conky display a pop-up notification whenever a new message comes in. Here's how it's done...
First create a text file named "gmailcount.txt" (or whatever other name you want to use). This will store the number of messages from the last time conky checked the email (old email count).
Then add the following lines to the email conky configuration file...
Code:
###
## Check if old email count is less than new email count, if so, display popup
#
${if_match ${execi 600 conkyEmail -m IMAP -s imap.googlemail.com -o 993 --ssl -u your-address@gmail.com -p your-password} > ${exec cat ~/Path/to/gmailcount.txt}}${exec zenity --info --title="New Mail" --text="New Mail in G-Mail"}}${endif}
###
## Update old email count
#
${execi 600 echo $(conkyEmail -m IMAP -s imap.googlemail.com -o 993 --ssl -u your-address@gmail.com -p your-password) > ~/Path/to/gmailcount.txt}
For best results make sure the execi intervals match the interval at which the email gets checked. You may also want to put everything on one line to keep your conky from growing longer. Additionally there might be a strange result the first time you run this, since the .txt file is empty to begin with. If the pop-up message keeps showing up at each conky update cycle, just kill Conky, restart it, and should work from then on.
zenity comes pre-installed on Ubuntu12.04, not sure about other systems. You may need to install it before this works.
When done correctly you should see something like this only once each time a new email arrives...
emailnotify.png
To any of the Conky Masters around here; feel free to improve my code and/or offer suggestions on how to do it better.
Bookmarks