Unmounting removable devices
James Westby
jw+debian at jameswestby.net
Wed Nov 12 15:56:05 GMT 2008
On Wed, 2008-11-12 at 10:20 +0100, Martin Pitt wrote:
> > I have a 20 line python script that implements what I would like by
> > hooking up gio and libnotify.
>
> Hm, it sounds as if that were a daemon which would need to run all the
> time? IMHO having a permanenlty running python blob for just this task
> is a bit too heavy. Or is it just producing the notification? Then
> using the binary in libnotify-bin might be sufficient, and avoids
> dynamic linking (although I don't think that it hurts to link nautilus
> against libnotify).
Oh, I was just stating that doing it is really easy thanks to gio and
libnotify. I don't think running something else for this is a good idea
either.
> > I'm looking for somewhere appropriate to put it. nautilus may be
> > appropriate, but I'm having a bit of trouble seeing how to use their
> > particular brand of gtk+.
>
> Is that any special? My gut feeling is that adding it to nautilus is
> appropriate, since it already listens to gio/hal events and thus can
> easily detect the hal "device removed" event, too. It could then just
> either use libnotify or libnotify-bin to produce the notification.
Yeah, it's just my inexperience with C/gtk+.
> > Another place would be gnome-settings-daemon, but it's not a good fix
> > their in terms of intent.
>
> Agreed. Maybe gvfs-hal-volume-monitor or gvfsd. Discussing that with
> davidz might yield some more insights/options.
That could be good as well.
I have a preliminary patch for this, but I was finding oddness when
testing it. When I pulled out the storage without unmounting the device
was unmounted. I don't see how my patch changed this. One thing that
I did while playing with this was to remove gnome-volume-manager, which
could be related. You said that we don't use that anymore, is it still
installed by default? Since when is it not "used". Do you know how this
could cause the mount to be removed on removal?
Thanks,
James
More information about the ubuntu-desktop
mailing list