views:

604

answers:

1

Can someone provide example on how to use (with GNOME Ubuntu) the XDG-MIME command? I'm struggling to get anything working even with the docs.

For example if I want to register the extension .mfe with an application called MyApp what would the steps be? This is my attempt so far, I would appreciate any pointers on getting this right...

This is my xml (MyApp-MyFileType.xml) How is the file name relavent?

<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'&gt;
  <mime-type type="text/mfe">
    <comment>File for MyApp</comment>
    <glob pattern="*.mfe"/>
  </mime-type>
</mime-info>

Then is run this command?

xdg-mime install MyApp-MyFileType.xml

And then I run this? What does the xxx relate to?, I understand it to be an identifier to my application but how do I define it?

xdg-mime default xxx.desktop text/mfe
+1  A: 

xdg-mime --manual | less will bring up some information on it. In short you need to create an XML file for your extension (an example is toward the end of the manual) and invoke xdg-mime install against it, followed by xdg-icon-resource install and xdg-mime default.

Ignacio Vazquez-Abrams

related questions