1<?xml version="1.0" encoding="utf-8"?> 2<page xmlns="http://projectmallard.org/1.0/" type="topic" style="task" id="mime-types-application" xml:lang="tr"> 3 4 <info> 5 <link type="guide" xref="software#management"/> 6 <link type="seealso" xref="mime-types-application-user"/> 7 <link type="seealso" xref="mime-types-custom-user"/> 8 <link type="seealso" xref="mime-types-custom"/> 9 <revision pkgversion="3.30" date="2019-02-08" status="review"/> 10 11 <credit type="author copyright"> 12 <name>Petr Kovar</name> 13 <email>pknbe@volny.cz</email> 14 <years>2014</years> 15 </credit> 16 17 <include xmlns="http://www.w3.org/2001/XInclude" href="legal.xml"/> 18 19 <desc>Customize which application opens a specific MIME type.</desc> 20 </info> 21 22 <title>Override the default registered application for all users</title> 23 <p> 24 The <file>/usr/share/applications/mimeapps.list</file> and 25 <file>/usr/share/applications/gnome-mimeapps.list</file> files 26 specify which application is registered to open specific MIME types by 27 default. These files are provided by the distribution.</p> 28 29 <p>To override the system defaults for all users on the system, you 30 need to create a <file>/etc/xdg/mimeapps.list</file> or 31 <file>/etc/xdg/gnome-mimeapps.list</file> file with a list of MIME types 32 for which you want to override the default registered application.</p> 33 34 <note> 35 <p>Files located in <file>/etc/xdg/</file> take precedence over files 36 found in <file>/usr/share/applications/</file>. Additionally, 37 <file>/etc/xdg/gnome-mimeapps.list</file> takes precedence over 38 <file>/etc/xdg/mimeapps.list</file>, but can be overridden by the user's 39 configuration in <file>~/.config/mimeapps.list</file>.</p> 40 </note> 41 42 <steps> 43 <title>Override the default registered application for all users</title> 44 <item> 45 <p> 46 Consult the <file>/usr/share/applications/mimeapps.list</file> 47 file to determine the MIME types for which you want to change the 48 default registered application. For example, the following sample of 49 the <file>mimeapps.list</file> file specifies the default 50 registered application for the <code>text/html</code> and 51 <code>application/xhtml+xml</code> MIME types: 52 </p> 53 <code>[Default Applications] 54text/html=epiphany.desktop 55application/xhtml+xml=epiphany.desktop</code> 56 <p> 57 The default application (<app>Epiphany</app>) is 58 defined by specifying its corresponding <file>.desktop</file> 59 file (<file>epiphany.desktop</file>). The default location for 60 other applications’ <file>.desktop</file> files is 61 <file>/usr/share/applications/</file>. 62 </p> 63 </item> 64 <item> 65 <p> 66 Create the <file>/etc/xdg/mimeapps.list</file> 67 file. In the file, specify the MIME types and their corresponding 68 default registered applications: 69 </p> 70 <code>[Default Applications] 71text/html=<var>myapplication1.desktop</var> 72application/xhtml+xml=<var>myapplication2.desktop</var> 73 74[Added Associations] 75text/html=<var>myapplication1.desktop</var>; 76application/xhtml+xml=<var>myapplication2.desktop</var>;</code> 77 <p> 78 This sets the default registered application for the 79 <code>text/html</code> MIME type to <code>myapplication1.desktop</code>, 80 and the default registered application for the 81 <code>application/xhtml+xml</code> MIME type to 82 <code>myapplication2.desktop</code>.</p> 83 <p>For these settings to function properly, ensure that both the 84 <file>myapplication1.desktop</file> and 85 <file>myapplication2.desktop</file> files are placed in the 86 <file>/usr/share/applications/</file> directory. 87 </p> 88 </item> 89 <item> 90 <p> 91 You can use the <cmd>gio mime</cmd> command to verify 92 that the default registered application has been set correctly: 93 </p> 94 <screen><output>$ </output><input>gio mime text/html</input> 95Default application for “text/html”: myapplication1.desktop 96Registered applications: 97 myapplication1.desktop 98 epiphany.desktop 99Recommended applications: 100 myapplication1.desktop 101 epiphany.desktop</screen> 102 </item> 103 </steps> 104</page> 105