Results 1 to 2 of 2

Thread: Mime types for custom file type

  1. #1
    Join Date
    May 2006
    Beans
    57

    Mime types for custom file type

    I'm trying to register a custom file type as a mime-type in linux. My custom filetype, with a custom extension, is actually a zip archive containing various xml and other files.

    The problem I'm having is that my operating system (kubuntu) won't recognize the file as my custom mime-type but insists on it being a zip file.

    I'm not sure where I should start trying to fix my problem. I've used the following mime info file (tugraz-caleydo.sharedmimeinfo):
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
    <mime-type type="application/x-cal">  
    <comment>Caleydo Project</comment>
    <glob pattern="*.cal"/>
    </mime-type>
    </mime-info>
    My Desktop Entry (caleydo.desktop, correctly registered in /usr/share/applications):
    Code:
    [Desktop Entry]
    Version=2.01
    Encoding=UTF-8
    Name=Caleydo
    GenericName=Data Visualization 
    Comment=Visualization for Molecular Biology
    Exec=/usr/bin/caleydo
    Icon=/usr/share/pixmaps/caleydo_256.png
    StartupNotify=true
    Type=Application
    Categories=Science;
    MimeType=application/x-cal;
    And these are the commands I'm trying to use:
    Code:
    sudo xdg-mime install --mode system tugraz-caleydo.sharedmimeinfo
    sudo xdg-mime default caleydo.desktop application/x-cal
    sudo update-mime-database /usr/share/mime
    However, this still gives me:
    Code:
    $ xdg-mime query filetype export_2012.cal 
    application/zip

  2. #2
    Join Date
    May 2006
    Beans
    57

    Re: Mime types for custom file type

    I finally found the issue:

    the mime info file has to have exactly the name of the mime type. Renaming it to x-cal.xml did the trick.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •