~saiarcot895/ubuntu/wily/xdg-utils/fix-multiple-execs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl"
   href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
]>
<refentry id="xdg-icon-resource">
  <refentryinfo>
    <title>xdg-icon-resource Manual</title>
    <copyright>
      <year>2006</year>
    </copyright>
    <author>
      <firstname>Kevin</firstname>
      <surname>Krammer</surname>
    </author>
    <address><email>kevin.krammer@gmx.at</email></address>
    <author>
      <firstname>Jeremy</firstname>
      <surname>White</surname>
    </author>
    <address><email>jwhite@codeweavers.com</email></address>
    <releaseinfo>xdg-utils 1.0</releaseinfo>
  </refentryinfo>

  <refmeta>
    <refentrytitle>xdg-icon-resource</refentrytitle>
    <manvolnum>1</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>xdg-icon-resource</refname>
    <refpurpose>command line tool for (un)installing icon resources</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>xdg-icon-resource</command>
      <arg choice="plain">install</arg>
      <arg><option>--noupdate</option></arg>
      <arg><option>--novendor</option></arg>
      <arg><option>--theme <replaceable>theme</replaceable></option></arg>
      <arg><option>--context <replaceable>context</replaceable></option></arg>
      <arg><option>--mode <replaceable>mode</replaceable></option></arg>
      <arg choice="plain"><option>--size <replaceable>size</replaceable></option></arg>
      <arg choice="plain"><replaceable>icon-file</replaceable></arg>
      <arg><replaceable>icon-name</replaceable></arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>xdg-icon-resource</command>
      <arg choice="plain">uninstall</arg>
      <arg><option>--noupdate</option></arg>
      <arg><option>--theme <replaceable>theme</replaceable></option></arg>
      <arg><option>--context <replaceable>context</replaceable></option></arg>
      <arg><option>--mode <replaceable>mode</replaceable></option></arg>
      <arg choice="plain"><option>--size <replaceable>size</replaceable></option></arg>
      <arg choice="plain"><replaceable>icon-name</replaceable></arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>xdg-icon-resource</command>
      <arg choice="plain">forceupdate</arg>
      <arg><option>--theme <replaceable>theme</replaceable></option></arg>
      <arg><option>--mode <replaceable>mode</replaceable></option></arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>xdg-icon-resource</command>
      <group choice="req">
        <arg choice="plain"><option>--help</option></arg>
        <arg choice="plain"><option>--manual</option></arg>
        <arg choice="plain"><option>--version</option></arg>
      </group>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1 id="description">
    <title>Description</title>
    <para>
      The xdg-icon-resource program can be used to install icon resources
      into the desktop icon system in order to illustrate menu entries,
      to depict desktop icons or to graphically represent file types.
    </para>
    <para>
      The desktop icon system identifies icons by name. Depending on the
      required size, the choice of icon theme and the context in which the
      icon is used, the desktop icon system locates an appropriate
      icon resource to depict an icon. Icon resources can be XPM files or
      PNG files. 
    </para>
    <para>
      The desktop icon system works according to the
      XDG Icon Theme Specification at
      <ulink url="http://www.freedesktop.org/wiki/Specifications/icon-theme-spec"/>
    </para>
  </refsect1>
  <refsect1 id="commands">
    <title>Commands</title>
    <variablelist>
      <varlistentry>
	<term>install</term>
	<listitem>
	  <simpara>
	    Installs the icon file indicated by <replaceable>icon-file</replaceable>
            to the desktop icon system under the name 
            <replaceable>icon-name</replaceable>. 
            Icon names do not have an extension.
            If <replaceable>icon-name</replaceable> is not provided the name is
            derived from <replaceable>icon-file</replaceable>.
            The icon file must have
            <emphasis>.png</emphasis> or <emphasis>.xpm</emphasis>
            as extension. If a corresponding <emphasis>.icon</emphasis>
            file exists in the same location as <replaceable>icon-file</replaceable>
            it will be installed as well.
	  </simpara>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>uninstall</term>
	<listitem>
	  <simpara>
	    Removes the icon indicated by <replaceable>icon-name</replaceable>
            from the desktop icon system. Note that icon names do not have
            an extension.
	  </simpara>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>forceupdate</term>
	<listitem>
	  <simpara>
	    Force an update of the desktop icon system. This is only useful if
	    the last call to xdg-icon-resource included the <option>--noupdate</option> option.
	  </simpara>
	</listitem>
      </varlistentry>
    </variablelist>
  </refsect1>
  <refsect1 id="options">
    <title>Options</title>
    <variablelist>
      <varlistentry>
	<term><option>--noupdate</option></term>
	<listitem>
	  <simpara>
	    Postpone updating the desktop icon system. If multiple icons are
	    added in sequence this flag can be used to indicate that
	    additional changes will follow and that it is not
            necessary to update the desktop icon system right away.
	  </simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><option>--novendor</option></term>
	<listitem>
	  <simpara>
	    Normally, xdg-icon-resource checks to ensure that an icon file
	    to be installed in the <emphasis>apps</emphasis> context has
	    a proper vendor prefix. This option can be used to disable
	    that check.
	  </simpara>
	  <simpara>
            A vendor prefix consists of alpha characters ([a-zA-Z]) and is
            terminated with a dash ("-").
            Companies and organizations are encouraged to use a word
            or phrase, preferably the organizations name, for which they hold
            a trademark as their vendor prefix.
            The purpose of the vendor prefix is to prevent name conflicts.
          </simpara>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><option>--theme</option> <replaceable>theme</replaceable></term>
	<listitem>
	  <simpara>
	    Installs or removes the icon file as part of 
	    <replaceable>theme</replaceable>. If no theme is specified the
	    icons will be installed as part of the default <emphasis>hicolor</emphasis> theme.
	    Applications may install icons under multiple themes but should
	    at least install icons for the default <emphasis>hicolor</emphasis> theme.
	  </simpara>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><option>--context</option> <replaceable>context</replaceable></term>
	<listitem>
	  <simpara>
	    Specifies the context for the icon. Icons to be used in the
            application menu and as desktop icon should use
            <emphasis>apps</emphasis> as context which is the default
            context. Icons to be used as file icons should use
            <emphasis>mimetypes</emphasis> as context.
            Other common contexts are <emphasis>actions</emphasis>,
            <emphasis>devices</emphasis>, <emphasis>emblems</emphasis>,
            <emphasis>filesystems</emphasis> and <emphasis>stock</emphasis>.
	  </simpara>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><option>--size</option> <replaceable>size</replaceable></term>
	<listitem>
	  <simpara>
	    Specifies the size of the icon. All icons must be square.
	    Common sizes for icons in the apps context are:
	    16, 22, 32, 48, 64 and 128.  
	    Common sizes for icons in the mimetypes context are:
	    16, 22, 32, 48, 64 and 128
	  </simpara>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><option>--mode</option> <replaceable>mode</replaceable></term>
	<listitem>
	  <simpara><replaceable>mode</replaceable> can be
            <emphasis>user</emphasis> or <emphasis>system</emphasis>.
            In user mode the file is (un)installed for the current user
            only. In system mode the file is (un)installed for all users
            on the system. Usually only root is allowed to install in
            system mode.
	  </simpara>
	  <simpara>
	    The default is to use system mode when called by root
	    and to use user mode when called by a non-root user.
	  </simpara>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><option>--help</option></term>
	<listitem>
	  <simpara>
	    Show command synopsis.
	  </simpara>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><option>--manual</option></term>
	<listitem>
	  <simpara>
	    Show this manual page.
	  </simpara>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--version</option></term>
        <listitem>
          <simpara>
            Show the xdg-utils version information.
          </simpara>
        </listitem>
      </varlistentry>

    </variablelist>
  </refsect1>
  <refsect1 id="env_vars">
    <title>Environment Variables</title>
    <para>
      xdg-icon-resource honours the following environment variables:
    </para>
    <variablelist>
      <varlistentry>
	<term>XDG_UTILS_DEBUG_LEVEL</term>
	<listitem>
	  <simpara>
	    Setting this environment variable to a non-zero numerical value
	    makes xdg-icon-resource do more verbose reporting on stderr.
	    Setting a higher value increases the verbosity.
	  </simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term>XDG_UTILS_INSTALL_MODE</term>
	<listitem>
	  <simpara>
	    This environment variable can be used by the user or
            administrator to override the installation mode.
	    Valid values are <emphasis>user</emphasis> and
            <emphasis>system</emphasis>.  
	  </simpara>
	</listitem>
      </varlistentry>
    </variablelist>
  </refsect1>

  <refsect1 id="exitcodes">
    <title>Exit Codes</title>
    <para>
      An exit code of 0 indicates success while a non-zero exit code
      indicates failure. The following failure codes can be returned:
    </para>
    <variablelist>
      <varlistentry>
	<term><option>1</option></term>
	<listitem>
	  <simpara>
	    Error in command line syntax.
	  </simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><option>2</option></term>
	<listitem>
	  <simpara>
	    One of the files passed on the command line did not exist.
	  </simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><option>3</option></term>
	<listitem>
	  <simpara>
	    A required tool could not be found. 
	  </simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><option>4</option></term>
	<listitem>
	  <simpara>
	    The action failed. 
	  </simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><option>5</option></term>
	<listitem>
	  <simpara>
	    No permission to read one of the files passed on the command
            line.
	  </simpara>
	</listitem>
      </varlistentry>
    </variablelist>
  </refsect1>
  <refsect1 id="seealso">
    <title>See Also</title>
    <para><citerefentry><refentrytitle>xdg-desktop-icon</refentrytitle>
        <manvolnum>1</manvolnum>
      </citerefentry>,
      <citerefentry><refentrytitle>xdg-desktop-menu</refentrytitle>
        <manvolnum>1</manvolnum>
      </citerefentry>,
      <citerefentry><refentrytitle>xdg-mime</refentrytitle>
        <manvolnum>1</manvolnum>
      </citerefentry>
    </para>
  </refsect1>
  <refsect1 id="examples">
    <title>Examples</title>
    <para>
To install an icon resource to depict a launcher for the application
myfoobar, the company ShinyThings Inc. can use:
<programlisting>
xdg-icon-resource install --size 64 shinythings-myfoobar.png
</programlisting>
    </para>
    <para>
To install an icon for a new application/x-foobar file type one can use:
<programlisting>
xdg-icon-resource install --context mimetypes --size 48 ./mime-foobar-48.png application-x-foobar
xdg-icon-resource install --context mimetypes --size 64 ./mime-foobar-64.png application-x-foobar
</programlisting>This will install two icons with the name application-x-foobar
but with different sizes.
    </para>
  </refsect1>
</refentry>