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've built an application I want to release however I would like the files to open with the application.

I have modified the .desktop file accordingly, however quickly seems to have no option for MIME files and I don't have a clue how to add them.

(Also, I'm not sure if this belongs here, because it's a developer question but Quickly was made by Ubuntu)

share|improve this question

1 Answer 1

up vote 4 down vote accepted

You can add mime types to a system by using xdg-mime.

command line tool for querying information about file type handling and adding 
descriptions for new file types

Command to add a new mime type:
xdg-mime install [--mode mode] [--novendor] mimetypes-file

From the man page:

mode: can be user or system; for system you need root permissions.
install: Adds the file type descriptions provided in mimetypes-file to the
desktop environment.  mimetypes-file must be a XML file that
follows the freedesktop.org Shared MIME-info Database specification
and that has a mime-info element as its document root. For each new
file type one or more icons with name type-subtype must be
installed with the xdg-icon-resource command in the mimetypes
context. For example the filetype
application/vnd.oasis.opendocument.text requires an icon named
application-vnd.oasis.opendocument.text to be installed (unless the
file type recommends another icon name).

Alternatively you could use the ubuntu wiki on mime types. This uses manual instructions to edit in this text

gksudo gedit /etc/mime.types

and to edit it something like

text/extension extension

This editing of /etc/mime.types can also be accomplished with the command line stream line editor sed but I would suggest using xdg-mime.

share|improve this answer
1  
Thanks, I also found some more information for packages data_files=[('/usr/share/mime/packages', ['one-click-installer.xml'])], is added to the setup.py –  Joe Simpson May 30 '11 at 15:50

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.