I use Evolution as my primary email client, and one of the major issues I have with it is the lack of an email notifier. There was a GNOME bounty once for this, and the code published as the solution has made it to Evolution using DBUS, but it does not solve my problem: What will I do with a stupid DBUS notification? I want my visual notification!
Now Ubuntu ships with spiffy DBUS notification bubble support. Why not use that?
This is where my newbie python skills come in: presenting to you my 20-line Evolution Mail Notification Tool!:
#!/usr/bin/env python
import dbus
import dbus.glib
import gobject
bus = dbus.SessionBus()
bus.get_object(“org.freedesktop.DBus”,”/org/freedesktop/DBus”)
notify_service = bus.get_object(‘org.freedesktop.Notifications’, ‘/org/freedesktop/Notifications’)
notify_interface = dbus.Interface(notify_service, ‘org.freedesktop.Notifications’)
def newmail_handler(msg, msg2): notify_interface.Notify(“evo-notify”, 0, ‘’, “New Email”, msg, [], {}, -1)
bus.add_signal_receiver(newmail_handler, dbus_interface = “org.gnome.evolution.mail.dbus.Signal”, signal_name = “Newmail”)
loop = gobject.MainLoop()
loop.run()
How to run this:
First import, glib, dbus, and all the things for python. Then save the python code in a file, say evo.py. Then open a terminal and type python evo.py. Now, whenever you get an email, a pop-up notfication will appear!
To do: For the UI, do something similar to the Gmail notifier plugin for the notification. Also, patch the enotify plugin to send the details of the new emails as well, so that they can be shown in the notification.
_(update: updated the newmail_handler to the new interface. Thanks, Vikas!)_