let's start from the beginning:
(i've no idea how familiar you are with conky, so i will try to be very self-explanatory - if there's something very obvious, sorry

)
1- create a folder (if you don't have one) in your home called scripts;
2- save this text bellow, only editing the marked parts in that folder and name it gmail.py;
###########################################################
#!/usr/bin/env python2
import os
#Enter your username and password below within double quotes
# eg. username="username" and password="password"
domain="mail.google.com"
username="----------------" # <--enter here your gmail username with the quotes
password="-----------------" # <--enter here your gmail pw with the quotes
com="wget -O -
https://"+username+":"+password+"@mail.google.com/mail/feed/atom --no-check-certificate" # <--don't touch
temp=os.popen(com)
msg=temp.read()
index=msg.find("<fullcount>")
index2=msg.find("</fullcount>")
fc=int(msg[index+11:index2])
if fc==0:
print "0 new"
else:
print str(fc)+" new"
#############################################################
3- now, you saved it inside the scripts folder, you have to make it executable:
-a: right click on it, properties, permissions, tick the box "allow executing file as program":
4-In conky, you call the script with this line
- Code: Select all
Gmail ${execpi 120 python /home/yournamehere/scripts/gmail.py}
- after /home/ you have to edit the line with your name.
Troubleshooting:
1- make sure you have conky-all installed,
2- make sure you have wget installed
3- when editing the conky, start it with the terminal, just typing conky, this way you can the errors
Let's see if it works
