Re: how can I configure 'Open With' in a script or app



On Wed, 2008-10-15 at 16:48 -0500, Xavier Toth wrote:
> I'm trying to figure out how to configure "Open With" for a file type
> during the post install phase of a package that is installing the
> script which is used to open the file type. Is there an API to do this
> hopefully with python bindings in nautilus-python?

It's not entirely clear to me what you are asking. 

If you are asking how to associate a MIME type with an application, you
should use the MimeType key in the desktop file for the application.
Then your application will automagically show up in the "Open With"
menus etc. in Nautilus. See

http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys

Of course you may need to create a desktop file for this to work. You
will also need to run update-desktop-database in the RPM %post (or
similar if not using RPM), see the packaging guidelines for the platform
you are targeting.

Hope this helps.

     David




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]