Commits

Byron Clark committed 562ac47

Add notifications on unmount.

Comments (0)

Files changed (1)

 import os
 
 import dbus
+import pynotify
 
 import udiskie.device
 
         except dbus.exceptions.DBusException, dbus_err:
             logger.error('failed to unmount device %s: %s' % (device,
                                                               dbus_err))
+            return
+
+        pynotify.Notification('Device unmounted',
+                              '%s unmounted' % (device.device_file(),),
+                              'drive-removable-media').show()
     else:
         logger.debug('skipping unhandled device %s' % (device,))
 
         log_level = logging.DEBUG
     logging.basicConfig(level=log_level, format='%(message)s')
 
+    pynotify.init('udiskie.umount')
+
     if options.all:
         unmount_all()
     else: