Index of /conky-imaps

Icon  Name                    Last modified      Size  Description
[DIR] Parent Directory - [IMG] Conky-2.png 15-Sep-2009 12:50 95K [IMG] Conky.png 15-Sep-2009 12:50 86K [IMG] Desktop.png 15-Sep-2009 12:50 840K [TXT] conky-imap.rb 15-Sep-2009 12:49 1.6K

conky-imaps.rb is a smallish ruby script designed to check IMAP/S servers from within conky. conky already has native IMAP support which is much faster than calling an external check script. It can already be used with SSL but requires something like stunnel running.

I wanted to write my own script so I did. The only requirements it has are net/imap (in core ruby already) and the ruby openssl libraries. At the top of the script, you set the basics: - these should be pretty straightforward. If you want to check gmail, you'll have to enable IMAP from the Gmail site. - this one is a flag for talking to MS-EXCHANGE servers. All it does it use a different routine for getting total unread messages - this should NORMALLY be INBOX in almost all cases. For gmail, you can also use "[Gmail]/All Mail" to check all folders - NYI. Right now if you have 1300 unread messages, in addition to needing to actually read your email, the script will poll them all. Conky COULD buffer overflow and crash. I've tested it with my unpurged gmail spam folder and that's what happened. I then tested with a folder of about 50 unread messages and it worked fine. - This enables conky formatting in the output using the following 3 settings. Disabling this is a great way to test from the command line. You probably want to leave this enabled.

CONKYRC Changes

You're going to have to make one required change to .conkyrc:
text_buffer_size 2048
then obviously you want to add the actual "stuff". Here's how it is in my file (with CONKYFIED = true):
GMail${hr}
${execpi 300 ~/bin/gmail.rb}
HSWI${hr}
${execpi 300 ~/hswi.rb}

I would HIGHLY,HIGHLY,HIGHLY suggest you leave the execpi interval to 300 for gmail. They WILL block you for polling too much. Don't say I didn't warn ya. If you have CONKYFIED = false, change execpi to execi. In my case I have, two email servers I want to check - gmail and work. For now I've just made two copies of the script and set things appropriately. My work email server is MS-EXCHANGE, hence me adding that configuration option.

Screenshots:

You can also click on Desktop.png for a full sized screenshot of my desktop.