Conky & system mail

I’ve recently come across a nice little program called ‘Conky’ and have been having fun configuring it to match my whims. One thing that disappointed me though, was the $mail(s) function. It would seem many of Conkys mail functions are geared toward external mail like google mail, msn mail, etc (in my case using Kmail). Since I have no desire to check my external emails, I do want to be notified about system mails. Now, Conkys various mail variables notify if there are new systems mails, but it would not update if I deleted those mails unless I restarted Conky. I scoured the net and found all the examples were variations of checking the outside world. While reading the docs on Conky, I came across the "if-elseif-endif’ and after a bit of trial and error as to how it was formatted, came up with this:

${if_existing /var/mail/sparkz}$color New Mail ${mails}${else}$color No Mail${endif}

Works pretty good, me thinks. Shows the number of system mails, if I delete some, shows the remaining number and if I delete them all, shows ‘No Mail’. Given what I found on the net, I’m probably the only one who finds this useful, but here it is and only available to openSUSE users rotfl!