OLD | NEW |
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859
-1"><title>xdg-mime</title><meta name="generator" content="DocBook XSL Styleshee
ts V1.69.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840
084" alink="#0000FF"><div class="refentry" lang="en"><a name="xdg-mime"></a><div
class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>xdg-mime —
; command line tool for querying information about file type handling | 1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859
-1"><title>xdg-mime</title><meta name="generator" content="DocBook XSL Styleshee
ts V1.75.2"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840
084" alink="#0000FF"><div class="refentry" title="xdg-mime"><a name="xdg-mime"><
/a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>xdg-mime
— command line tool for querying information about file type handling |
2 and adding descriptions for new file types</p></div><div class="refsynopsisdiv">
<h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">xdg-mime</cod
e> query { filetype | default } ... </p></div><div class="cmdsynopsis"><p
><code class="command">xdg-mime</code> default <em class="replaceable"><code
>application</code></em> <em class="replaceable"><code>mimetype(s)</code></em>
</p></div><div class="cmdsynopsis"><p><code class="command">xdg-mime</code> i
nstall [<code class="option">--mode <em class="replaceable"><code>mode</code></
em></code>] [<code class="option">--novendor</code>] <em class="replaceable"><c
ode>mimetypes-file</code></em> </p></div><div class="cmdsynopsis"><p><code class
="command">xdg-mime</code> uninstall [<code class="option">--mode <em class="
replaceable"><code>mode</code></em></code>] <em class="replaceable"><code>mimet
ypes-file</code></em> </p></div><div class="cmdsynopsis"><p><code class="command
">xdg-mime</code> { <code class="option">--help</code> | <code class="option
">--manual</code> | <code class="option">--version</code> }</p></div></div><d
iv class="refsect1" lang="en"><a name="description"></a><h2>Description</h2><p> | 2 and adding descriptions for new file types</p></div><div class="refsynopsisdiv"
title="Synopsis"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="comma
nd">xdg-mime</code> query { filetype | default } ... </p></div><div class
="cmdsynopsis"><p><code class="command">xdg-mime</code> default <em class="r
eplaceable"><code>application</code></em> <em class="replaceable"><code>mimety
pe(s)</code></em> </p></div><div class="cmdsynopsis"><p><code class="command">xd
g-mime</code> install [<code class="option">--mode <em class="replaceable"><c
ode>mode</code></em></code>] [<code class="option">--novendor</code>] <em class
="replaceable"><code>mimetypes-file</code></em> </p></div><div class="cmdsynopsi
s"><p><code class="command">xdg-mime</code> uninstall [<code class="option">-
-mode <em class="replaceable"><code>mode</code></em></code>] <em class="replace
able"><code>mimetypes-file</code></em> </p></div><div class="cmdsynopsis"><p><co
de class="command">xdg-mime</code> { <code class="option">--help</code> | <c
ode class="option">--manual</code> | <code class="option">--version</code> }<
/p></div></div><div class="refsect1" title="Description"><a name="description"><
/a><h2>Description</h2><p> |
3 The xdg-mime program can be used to query information about file types | 3 The xdg-mime program can be used to query information about file types |
4 and to add descriptions for new file types. | 4 and to add descriptions for new file types. |
5 </p></div><div class="refsect1" lang="en"><a name="commands"></a><h2>Command
s</h2><div class="variablelist"><dl><dt><span class="term">query</span></dt><dd>
<p> | 5 </p></div><div class="refsect1" title="Commands"><a name="commands"></a><h2>
Commands</h2><div class="variablelist"><dl><dt><span class="term">query</span></
dt><dd><p class="simpara"> |
6 Returns information related to file types. | 6 Returns information related to file types. |
7 » </p><p> | 7 » </p><p class="simpara"> |
8 The <span class="emphasis"><em>query</em></span> option is for use i
nside a desktop session only. | 8 The <span class="emphasis"><em>query</em></span> option is for use i
nside a desktop session only. |
9 It is not recommended to use xdg-mime query as root. | 9 It is not recommended to use xdg-mime query as root. |
10 » </p><p> | 10 » </p><p class="simpara"> |
11 The following queries are supported: | 11 The following queries are supported: |
12 » </p><p>query filetype <em class="replaceable"><code>FILE</code></em>: | 12 » </p><p class="simpara">query filetype <em class="replaceable"><code>FI
LE</code></em>: |
13 Returns the file type of <em class="replaceable"><code>FILE</code></
em> in the form of a MIME type. | 13 Returns the file type of <em class="replaceable"><code>FILE</code></
em> in the form of a MIME type. |
14 » </p><p>query default <em class="replaceable"><code>mimetype</code></em
>: | 14 » </p><p class="simpara">query default <em class="replaceable"><code>mim
etype</code></em>: |
15 Returns the default application that the desktop environment uses fo
r opening | 15 Returns the default application that the desktop environment uses fo
r opening |
16 files of type <em class="replaceable"><code>mimetype</code></em>. Th
e default application is | 16 files of type <em class="replaceable"><code>mimetype</code></em>. Th
e default application is |
17 identified by its *.desktop file. | 17 identified by its *.desktop file. |
18 » </p></dd><dt><span class="term">default</span></dt><dd><p> | 18 » </p></dd><dt><span class="term">default</span></dt><dd><p class="simpa
ra"> |
19 Ask the desktop environment to make <em class="replaceable"><code>ap
plication</code></em> | 19 Ask the desktop environment to make <em class="replaceable"><code>ap
plication</code></em> |
20 the default application for opening | 20 the default application for opening |
21 files of type <em class="replaceable"><code>mimetype</code></em>. An | 21 files of type <em class="replaceable"><code>mimetype</code></em>. An |
22 application can be made the default for several file types by | 22 application can be made the default for several file types by |
23 specifying multiple mimetypes. | 23 specifying multiple mimetypes. |
24 » </p><p> | 24 » </p><p class="simpara"> |
25 <em class="replaceable"><code>application</code></em> is the desktop
file | 25 <em class="replaceable"><code>application</code></em> is the desktop
file |
26 id of the application and has the form vendor-name.desktop | 26 id of the application and has the form vendor-name.desktop |
27 <em class="replaceable"><code>application</code></em> must already b
e installed | 27 <em class="replaceable"><code>application</code></em> must already b
e installed |
28 in the desktop menu before it can be made the default handler. | 28 in the desktop menu before it can be made the default handler. |
29 The aplication's desktop file must list support for all the | 29 The aplication's desktop file must list support for all the |
30 MIME types that it wishes to be the default handler for. | 30 MIME types that it wishes to be the default handler for. |
31 » </p><p> | 31 » </p><p class="simpara"> |
32 Requests to make an application a default handler may be | 32 Requests to make an application a default handler may be |
33 subject to system policy or approval by the end-user. xdg-mime | 33 subject to system policy or approval by the end-user. xdg-mime |
34 query can be used to verify whether an application is the | 34 query can be used to verify whether an application is the |
35 actual default handler for a specific file type. | 35 actual default handler for a specific file type. |
36 » </p><p> | 36 » </p><p class="simpara"> |
37 The <span class="emphasis"><em>default</em></span> option is for use
inside a desktop session only. | 37 The <span class="emphasis"><em>default</em></span> option is for use
inside a desktop session only. |
38 It is not recommended to use xdg-mime default as root. | 38 It is not recommended to use xdg-mime default as root. |
39 </p></dd><dt><span class="term">install</span></dt><dd> | 39 </p></dd><dt><span class="term">install</span></dt><dd> |
40 Adds the file type descriptions provided in <em class="replaceable">
<code>mimetypes-file</code></em> | 40 Adds the file type descriptions provided in <em class="replaceable">
<code>mimetypes-file</code></em> |
41 to the desktop environment. <em class="replaceable"><code>mimetypes-
file</code></em> | 41 to the desktop environment. <em class="replaceable"><code>mimetypes-
file</code></em> |
42 must be a XML file that follows the freedesktop.org | 42 must be a XML file that follows the freedesktop.org |
43 Shared MIME-info Database specification | 43 Shared MIME-info Database specification |
44 and that has a mime-info element as its document root. For | 44 and that has a mime-info element as its document root. For |
45 each new file type one or more icons with name | 45 each new file type one or more icons with name |
46 <em class="replaceable"><code>major</code></em>-<em class="replaceab
le"><code>minor</code></em> | 46 <em class="replaceable"><code>type</code></em>-<em class="replaceabl
e"><code>subtype</code></em> |
47 must be installed with the <span><strong class="command">xdg-icon-re
source</strong></span> | 47 must be installed with the <span class="command"><strong>xdg-icon-re
source</strong></span> |
48 command in the <span class="emphasis"><em>mimetypes</em></span> cont
ext. For example the | 48 command in the <span class="emphasis"><em>mimetypes</em></span> cont
ext. For example the |
49 application/vnd.oasis.opendocument.text filetype requires an | 49 filetype application/vnd.oasis.opendocument.text requires an |
50 icon by the name of application-vnd.oasis.opendocument.text | 50 icon named application-vnd.oasis.opendocument.text |
51 to be installed. | 51 to be installed (unless the file type recommends another icon name). |
52 </dd><dt><span class="term">uninstall</span></dt><dd> | 52 </dd><dt><span class="term">uninstall</span></dt><dd> |
53 Removes the file type descriptions provided in <em class="replaceabl
e"><code>mimetypes-file</code></em> | 53 Removes the file type descriptions provided in <em class="replaceabl
e"><code>mimetypes-file</code></em> |
54 and previously added with <span><strong class="command">xdg-mime ins
tall</strong></span> from the | 54 and previously added with <span class="command"><strong>xdg-mime ins
tall</strong></span> from the |
55 desktop environment. <em class="replaceable"><code>mimetypes-file</c
ode></em> | 55 desktop environment. <em class="replaceable"><code>mimetypes-file</c
ode></em> |
56 must be a XML file that follows the freedesktop.org | 56 must be a XML file that follows the freedesktop.org |
57 Shared MIME-info Database specification | 57 Shared MIME-info Database specification |
58 and that has a mime-info element as its document root. | 58 and that has a mime-info element as its document root. |
59 » </dd></dl></div></div><div class="refsect1" lang="en"><a name="options
"></a><h2>Options</h2><div class="variablelist"><dl><dt><span class="term"><code
class="option">--mode</code> <em class="replaceable"><code>mode</code></em></sp
an></dt><dd><p><em class="replaceable"><code>mode</code></em> can be | 59 » </dd></dl></div></div><div class="refsect1" title="Options"><a name="o
ptions"></a><h2>Options</h2><div class="variablelist"><dl><dt><span class="term"
><code class="option">--mode</code> <em class="replaceable"><code>mode</code></e
m></span></dt><dd><p class="simpara"><em class="replaceable"><code>mode</code></
em> can be |
60 <span class="emphasis"><em>user</em></span> or <span class="emphasis
"><em>system</em></span>. | 60 <span class="emphasis"><em>user</em></span> or <span class="emphasis
"><em>system</em></span>. |
61 In user mode the file is (un)installed for the current user | 61 In user mode the file is (un)installed for the current user |
62 only. In system mode the file is (un)installed for all users | 62 only. In system mode the file is (un)installed for all users |
63 on the system. Usually only root is allowed to install in | 63 on the system. Usually only root is allowed to install in |
64 system mode. | 64 system mode. |
65 » </p><p> | 65 » </p><p class="simpara"> |
66 The default is to use system mode when called by root | 66 The default is to use system mode when called by root |
67 and to use user mode when called by a non-root user. | 67 and to use user mode when called by a non-root user. |
68 » </p></dd><dt><span class="term"><code class="option">--novendor</code>
</span></dt><dd><p> | 68 » </p></dd><dt><span class="term"><code class="option">--novendor</code>
</span></dt><dd><p class="simpara"> |
69 Normally, xdg-mime checks to ensure that the | 69 Normally, xdg-mime checks to ensure that the |
70 <em class="replaceable"><code>mimetypes-file</code></em> to be insta
lled | 70 <em class="replaceable"><code>mimetypes-file</code></em> to be insta
lled |
71 has a proper vendor prefix. This option can be | 71 has a proper vendor prefix. This option can be |
72 used to disable that check. | 72 used to disable that check. |
73 » </p><p> | 73 » </p><p class="simpara"> |
74 A vendor prefix consists of alpha characters ([a-zA-Z]) and is | 74 A vendor prefix consists of alpha characters ([a-zA-Z]) and is |
75 terminated with a dash ("-"). | 75 terminated with a dash ("-"). |
76 Companies and organizations are encouraged to use a word | 76 Companies and organizations are encouraged to use a word |
77 or phrase, preferably the organizations name, for which they hold | 77 or phrase, preferably the organizations name, for which they hold |
78 a trademark as their vendor prefix. | 78 a trademark as their vendor prefix. |
79 The purpose of the vendor prefix is to prevent name conflicts. | 79 The purpose of the vendor prefix is to prevent name conflicts. |
80 </p></dd><dt><span class="term"><code class="option">--help</code></sp
an></dt><dd> | 80 </p></dd><dt><span class="term"><code class="option">--help</code></sp
an></dt><dd> |
81 Show command synopsis. | 81 Show command synopsis. |
82 </dd><dt><span class="term"><code class="option">--manual</code></span
></dt><dd> | 82 </dd><dt><span class="term"><code class="option">--manual</code></span
></dt><dd> |
83 Show this manualpage. | 83 Show this manualpage. |
84 </dd><dt><span class="term"><code class="option">--version</code></spa
n></dt><dd> | 84 </dd><dt><span class="term"><code class="option">--version</code></spa
n></dt><dd> |
85 Show the xdg-utils version information. | 85 Show the xdg-utils version information. |
86 </dd></dl></div></div><div class="refsect1" lang="en"><a name="env_var
s"></a><h2>Environment Variables</h2><p> | 86 </dd></dl></div></div><div class="refsect1" title="Environment Variabl
es"><a name="env_vars"></a><h2>Environment Variables</h2><p> |
87 xdg-mime honours the following environment variables: | 87 xdg-mime honours the following environment variables: |
88 </p><div class="variablelist"><dl><dt><span class="term">XDG_UTILS_DEBUG_LEV
EL</span></dt><dd> | 88 </p><div class="variablelist"><dl><dt><span class="term">XDG_UTILS_DEBUG_LEV
EL</span></dt><dd> |
89 Setting this environment variable to a non-zero numerical value | 89 Setting this environment variable to a non-zero numerical value |
90 makes xdg-mime do more verbose reporting on stderr. | 90 makes xdg-mime do more verbose reporting on stderr. |
91 Setting a higher value increases the verbosity. | 91 Setting a higher value increases the verbosity. |
92 </dd><dt><span class="term">XDG_UTILS_INSTALL_MODE</span></dt><dd> | 92 </dd><dt><span class="term">XDG_UTILS_INSTALL_MODE</span></dt><dd> |
93 This environment variable can be used by the user or | 93 This environment variable can be used by the user or |
94 administrator to override the installation mode. | 94 administrator to override the installation mode. |
95 Valid values are <span class="emphasis"><em>user</em></span> and | 95 Valid values are <span class="emphasis"><em>user</em></span> and |
96 <span class="emphasis"><em>system</em></span>. | 96 <span class="emphasis"><em>system</em></span>. |
97 » </dd></dl></div></div><div class="refsect1" lang="en"><a name="exitcod
es"></a><h2>Exit Codes</h2><p> | 97 » </dd></dl></div></div><div class="refsect1" title="Exit Codes"><a name
="exitcodes"></a><h2>Exit Codes</h2><p> |
98 An exit code of 0 indicates success while a non-zero exit code | 98 An exit code of 0 indicates success while a non-zero exit code |
99 indicates failure. The following failure codes can be returned: | 99 indicates failure. The following failure codes can be returned: |
100 </p><div class="variablelist"><dl><dt><span class="term"><code class="option
">1</code></span></dt><dd> | 100 </p><div class="variablelist"><dl><dt><span class="term"><code class="option
">1</code></span></dt><dd> |
101 Error in command line syntax. | 101 Error in command line syntax. |
102 </dd><dt><span class="term"><code class="option">2</code></span></dt><
dd> | 102 </dd><dt><span class="term"><code class="option">2</code></span></dt><
dd> |
103 One of the files passed on the command line did not exist. | 103 One of the files passed on the command line did not exist. |
104 </dd><dt><span class="term"><code class="option">3</code></span></dt><
dd> | 104 </dd><dt><span class="term"><code class="option">3</code></span></dt><
dd> |
105 A required tool could not be found. | 105 A required tool could not be found. |
106 </dd><dt><span class="term"><code class="option">4</code></span></dt><
dd> | 106 </dd><dt><span class="term"><code class="option">4</code></span></dt><
dd> |
107 The action failed. | 107 The action failed. |
108 </dd><dt><span class="term"><code class="option">5</code></span></dt><
dd> | 108 </dd><dt><span class="term"><code class="option">5</code></span></dt><
dd> |
109 No permission to read one of the files passed on the command | 109 No permission to read one of the files passed on the command |
110 line. | 110 line. |
111 » </dd></dl></div></div><div class="refsect1" lang="en"><a name="seealso
"></a><h2>See Also</h2><p><span class="citerefentry"><span class="refentrytitle"
>xdg-icon-resource</span>(1)</span>, | 111 » </dd></dl></div></div><div class="refsect1" title="See Also"><a name="
seealso"></a><h2>See Also</h2><p><span class="citerefentry"><span class="refentr
ytitle">xdg-icon-resource</span>(1)</span>, |
112 <span class="citerefentry"><span class="refentrytitle">xdg-desktop-menu</s
pan>(1)</span> | 112 <span class="citerefentry"><span class="refentrytitle">xdg-desktop-menu</s
pan>(1)</span> |
113 </p></div><div class="refsect1" lang="en"><a name="examples"></a><h2>Example
s</h2><p> | 113 </p></div><div class="refsect1" title="Examples"><a name="examples"></a><h2>
Examples</h2><p> |
114 </p><pre class="programlisting"> | 114 </p><pre class="programlisting"> |
115 xdg-mime query filetype /tmp/foobar.png | 115 xdg-mime query filetype /tmp/foobar.png |
116 </pre><p>Prints the MIME type of the file /tmp/foobar.png, in this | 116 </pre><p>Prints the MIME type of the file /tmp/foobar.png, in this |
117 case image/png | 117 case image/png |
118 </p><p> | 118 </p><p> |
119 </p><pre class="programlisting"> | 119 </p><pre class="programlisting"> |
120 xdg-mime query default image/png | 120 xdg-mime query default image/png |
121 </pre><p>Prints the .desktop filename of the application which is | 121 </pre><p>Prints the .desktop filename of the application which is |
122 registered to open PNG files. | 122 registered to open PNG files. |
123 </p><p> | 123 </p><p> |
(...skipping 12 matching lines...) Expand all Loading... |
136 <glob pattern="*.shiny"/> | 136 <glob pattern="*.shiny"/> |
137 <glob pattern="*.shi"/> | 137 <glob pattern="*.shi"/> |
138 </mime-type> | 138 </mime-type> |
139 </mime-info> | 139 </mime-info> |
140 </pre><p>An icon for this new file type must also be installed, for | 140 </pre><p>An icon for this new file type must also be installed, for |
141 example with: | 141 example with: |
142 </p><pre class="programlisting"> | 142 </p><pre class="programlisting"> |
143 xdg-icon-resource install --context mimetypes --size 64 shiny-file-icon.png text
-x-shiny | 143 xdg-icon-resource install --context mimetypes --size 64 shiny-file-icon.png text
-x-shiny |
144 </pre><p> | 144 </pre><p> |
145 </p></div></div></body></html> | 145 </p></div></div></body></html> |
OLD | NEW |