summaryrefslogtreecommitdiff
path: root/scripts/html/xdg-icon-resource.html
blob: d2605858297de6b1cc594b29c880d185e71523fd (plain)
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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xdg-icon-resource</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="xdg-icon-resource"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>xdg-icon-resource &#8212; command line tool for (un)installing icon resources</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">xdg-icon-resource</code>   install  [<code class="option">--noupdate</code>] [<code class="option">--theme <em class="replaceable"><code>theme</code></em></code>] [<code class="option">--context <em class="replaceable"><code>context</code></em></code>] [<code class="option">--size <em class="replaceable"><code>size</code></em></code>] { <code class="option">--user</code>  |   <code class="option">--system</code> }  <em class="replaceable"><code>icon-file</code></em>  [<em class="replaceable"><code>icon-name</code></em>]</p></div><div class="cmdsynopsis"><p><code class="command">xdg-icon-resource</code>   uninstall  [<code class="option">--noupdate</code>] [<code class="option">--theme <em class="replaceable"><code>theme</code></em></code>] [<code class="option">--context <em class="replaceable"><code>context</code></em></code>] [<code class="option">--size <em class="replaceable"><code>size</code></em></code>] { <code class="option">--user</code>  |   <code class="option">--system</code> }  <em class="replaceable"><code>icon-name</code></em> </p></div><div class="cmdsynopsis"><p><code class="command">xdg-icon-resource</code>   forceupdate  [<code class="option">--theme <em class="replaceable"><code>theme</code></em></code>] { --user  |   --system }</p></div><div class="cmdsynopsis"><p><code class="command">xdg-icon-resource</code>  { <code class="option">--help</code>  |   <code class="option">--manual</code>  |   <code class="option">--version</code> }</p></div></div><div class="refsect1" lang="en"><a name="description"></a><h2>Description</h2><p>
      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.
    </p><p>
      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,
      PNG files or SVG files. 
    </p><p>
      The desktop icon system works according to the
      XDG Icon Theme Specification at
      http://www.freedesktop.org/Standards/icon-theme-spec
    </p></div><div class="refsect1" lang="en"><a name="commands"></a><h2>Commands</h2><div class="variablelist"><dl><dt><span class="term">install</span></dt><dd>
	    Installs the icon file indicated by <em class="replaceable"><code>icon-file</code></em>
            to the desktop icon system under the name 
            <em class="replaceable"><code>icon-name</code></em>. If  
            <em class="replaceable"><code>icon-name</code></em> is not provided the name is
            derived from <em class="replaceable"><code>icon-file</code></em>.
            The icon file must have
            <span class="emphasis"><em>.png</em></span>, <span class="emphasis"><em>.xpm</em></span> or
            <span class="emphasis"><em>.svg</em></span> as extension. If a corresponding
            <span class="emphasis"><em>.icon</em></span> file exists in the same location as <em class="replaceable"><code>icon-file</code></em>
            it will be installed as well.
	  </dd><dt><span class="term">uninstall</span></dt><dd>
	    Removes the icon file indicated by <em class="replaceable"><code>icon-name</code></em>
            from the desktop icon system.
	  </dd><dt><span class="term">forceupdate</span></dt><dd>
	    Force an update of the desktop icon system. This is only useful if
	    the last call to xdg-icon-resource included the <code class="option">--noupdate</code> option.
	  </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">--noupdate</code></span></dt><dd>
	    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
            necassery to update the desktop icon system right away.
	  </dd><dt><span class="term"><code class="option">--theme</code> <em class="replaceable"><code>theme</code></em></span></dt><dd>
	    Installs or removes the icon file as part of 
	    <em class="replaceable"><code>theme</code></em>. If no theme is specified the
	    icons will be installed as part of the default <span class="emphasis"><em>hicolor</em></span> theme.
	    Applications may install icons under multiple themes but should
	    at least install icons for the default <span class="emphasis"><em>hicolor</em></span> theme.
	  </dd><dt><span class="term"><code class="option">--context</code> <em class="replaceable"><code>context</code></em></span></dt><dd>
	    Specifies the context for the icon. Icons to be used in the
            application menu and as desktop icon should use
            <span class="emphasis"><em>apps</em></span> as context which is the default
            context. Icons to be used as file icons should use
            <span class="emphasis"><em>mimetypes</em></span> as context.
            Other common contexts are <span class="emphasis"><em>actions</em></span>,
            <span class="emphasis"><em>devices</em></span>, <span class="emphasis"><em>emblems</em></span>,
            <span class="emphasis"><em>filesystems</em></span> and <span class="emphasis"><em>stock</em></span>.
	  </dd><dt><span class="term"><code class="option">--size</code> <em class="replaceable"><code>size</code></em></span></dt><dd>
	    Specifies the size of the icon (required for png and xpm icons).
	    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
	  </dd><dt><span class="term"><code class="option">--user</code></span></dt><dd>
	    Installs or uninstalls the icon for the current user only.
	  </dd><dt><span class="term"><code class="option">--system</code></span></dt><dd>
	    Installs or uninstalls the icon for all users on the system.
            Usually only root is allowed to do this.
	  </dd><dt><span class="term"><code class="option">--help</code></span></dt><dd>
	    Show command synopsis.
	  </dd><dt><span class="term"><code class="option">--manual</code></span></dt><dd>
	    Show this manualpage.
	  </dd><dt><span class="term"><code class="option">--version</code></span></dt><dd>
            Show the xdg-utils version information.
          </dd></dl></div></div><div class="refsect1" lang="en"><a name="env_vars"></a><h2>Environment Variables</h2><p>
      xdg-icon-resource honours the following environment variables:
    </p><div class="variablelist"><dl><dt><span class="term">XDG_UTILS_DEBUG_LEVEL</span></dt><dd>
	    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.
	  </dd></dl></div></div><div class="refsect1" lang="en"><a name="exitcodes"></a><h2>Exit Codes</h2><p>
      An exit code of 0 indicates success while a non-zero exit code
      indicates failure. The following failure codes can be returned:
    </p><div class="variablelist"><dl><dt><span class="term"><code class="option">1</code></span></dt><dd>
	    Error in command line syntax.
	  </dd><dt><span class="term"><code class="option">2</code></span></dt><dd>
	    One of the files passed on the command line did not exist.
	  </dd><dt><span class="term"><code class="option">3</code></span></dt><dd>
	    A required tool could not be found. 
	  </dd><dt><span class="term"><code class="option">4</code></span></dt><dd>
	    The action failed. 
	  </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-desktop-icon</span>(1)</span>,
      <span class="citerefentry"><span class="refentrytitle">xdg-desktop-menu</span>(1)</span>,
      <span class="citerefentry"><span class="refentrytitle">xdg-mime</span>(1)</span>
    </p></div><div class="refsect1" lang="en"><a name="examples"></a><h2>Examples</h2><p>
To install an icon resource to depict a launcher for the application myfoobar one can use:
</p><pre class="programlisting">
xdg-icon-resource install --system --size 64 myfoobar.png
</pre><p>
    </p><p>
To install an icon for a new application/x-foobar file type one can use:
</p><pre class="programlisting">
xdg-icon-resource install --system --context mimetypes --size 48 ./mime-foobar-48.png application-x-foobar.png
xdg-icon-resource install --system --context mimetypes --size 64 ./mime-foobar-64.png application-x-foobar.png
</pre><p>This will install two icons with the name application-x-foobar.png
but with different sizes. The icons will be installed for use by all users.
    </p></div></div></body></html>