Difference between revisions of "Changing filetype association via MIME"

From ArchWiki
Jump to: navigation, search
(Deleted section - this is already covered in xdg-open)
(Redirect - it's covered in Default Applications#Custom File Associations)
Line 1: Line 1:
[[Category:Wine]]
+
#REDIRECT [[Default Applications]]
[[ru:Changing filetype association via MIME]]
+
{{Merge|Default Applications|add content of this page to the newer article}}
+
 
+
Many of you will be wanting to run Windows applications within your Linux installation, and you can do this via the wonderful [[Wine]]. This guide will show you how to alter your MIME database in a safe way so that you can associate Windows executables with Wine.
+
'''Warning''': Do NOT attempt to modify the mime database directly!
+
 
+
First, create the file {{ic|~/.local/share/mime/packages/mime.xml}} as such:
+
$ mkdir -p ~/.local/share/mime/packages
+
$ touch ~/.local/share/mime/packages/mime.xml
+
 
+
Next, open up {{ic|mime.xml}} and paste the following inside:
+
<?xml version="1.0" encoding="UTF-8"?>
+
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+
  <mime-type type="application/x-ms-dos-executable">
+
          <comment xml:lang="en">Windows Executable</comment>
+
          <glob pattern="*.exe"/>
+
  </mime-type>
+
</mime-info>
+
 
+
Finally, enter this at the command prompt:
+
$ update-mime-database ~/.local/share/mime
+
 
+
That's it!
+
 
+
The method outlined above will integrate the xml file you made with the mime database, so that you can make your own associations for .exe files (probably [[Wine]]).
+
 
+
== Resources ==
+
* http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec
+

Revision as of 18:44, 5 June 2013