Ubuntu – How to add a MIME type with a project created in Quickly

application-developmentdevelopmentmime-typequickly

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)

Best Answer

  • 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.