Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Ubuntu 10.04 and I use to connect to a pptp VPN, everything works perfectly, when i start my VPN connection I can see that the connection is in progress from the NetworkManager icon, and I can see that the connection is on when the Network icon gets the small lock.

notification area with network connection and vpn lock icon

Is it possible to add a notification ballon, like the one I see when the network connection is estabilished?

eth0 connection estabilished notification baloon

P.s if the connection fail or is dropped, the notification cames out like this: vpn failed

share|improve this question
You probably should file your request as bug report for network manager. – João Pinto Feb 3 '11 at 14:49
@João Pinto ok, I do a bit more workaround and then I file it as a bug. – digitaljail Feb 3 '11 at 15:02
+1 for good question. It needs to be mention it is a bug. Something got forgotten in the network notification. – Luis Alvarado Feb 3 '11 at 15:42
Looking at the bug now... – Mathieu Trudel-Lapierre Feb 3 '11 at 21:20
up vote 3 down vote accepted

This is more like a hack but should work (works for me).

import gtk
import pynotify
import dbus
from dbus.mainloop.glib import DBusGMainLoop

def vpn_connection_handler(*args, **keywords):
    state = args[0].get('State',0)
    if state == 2:
        n = pynotify.Notification ("VPN", "Connection established")

pynotify.init ("icon-summary-body")

dbus_loop = DBusGMainLoop()

system_bus = dbus.SystemBus(mainloop=dbus_loop)


Run it with:


Establish the VPN connection.

share|improve this answer
it works! Now I have some more info to file the bug report. – digitaljail Feb 3 '11 at 16:46
Maybe you want to check this question – Braiam Sep 29 '13 at 3:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.