Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
1  
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 Feb 3 '11 at 15:42
    
    
Looking at the bug now... –  Mathieu Trudel-Lapierre Feb 3 '11 at 21:20

1 Answer 1

up vote 3 down vote accepted

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

vpn-notify.py:

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")
        n.show()


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


dbus_loop = DBusGMainLoop()

system_bus = dbus.SystemBus(mainloop=dbus_loop)
system_bus.add_signal_receiver(vpn_connection_handler,
    dbus_interface="org.freedesktop.NetworkManager.VPN.Connection",
    signal_name="PropertiesChanged")

gtk.gdk.threads_init()
gtk.main()

Run it with:

python vpn-notify.py

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 askubuntu.com/q/351309/169736 –  Braiam Sep 29 '13 at 3:01

Your Answer

 
discard

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.