A user in the greek subforum has asked for a way to check his gmail and I came up with this solution that involves the xfce4-genmon-plugin, that can display any kind of information in the panel. We only need to get that information from somewhere and it turns out that any gmail account has an RSS feed attached to it, so we can use feedparser to read that feed.
If you don't have them already, install the xfce4-mailwatch-plugin and feedparser packages.
Put the following code in a file, somewhere, anywhere you like, changing the account details at the top:
Code: Select all
#!/usr/bin/env python
USERNAME = "yourgmailusername" # This is the part that is before @gmail.com
PASSWORD = "yourpassword"
# if you don't like the icons, change them to whichever you like
icon_unread = "/usr/share/icons/mate/16x16/status/mail-unread.png"
icon_read = "/usr/share/icons/mate/16x16/status/mail-read.png"
# you probably don't have to change anything below this part
import feedparser
unread = feedparser.parse("https://"+USERNAME+":"+PASSWORD+"@mail.google.com/gmail/feed/atom")["feed"]["fullcount"]
if int(unread) > 0:
icon = icon_unread
text = "Unread emails: "+unread
else:
icon = icon_read
text = "No unread emails."
print "<img>"+icon+"</img>"
print "<tool>"+text+"</tool>"
Code: Select all
chmod +x /path/to/file
If you want the icon to launch your browser with gmail when you click on it, you can add something like this at the end of the script:
Code: Select all
print "<click>midori https://www.gmail.com</click>"