summaryrefslogtreecommitdiffstats
path: root/trunk/gnome2-system-admin-guide/C/themes.xml
blob: 79b2e753d88b6e24ce0cf972b1b57586c1751b25 (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
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
373
374
375
376
377
378
379
380
381
382
383
384
385
386
<chapter id="themes-0">
  <title>Installing Themes</title>
  <highlights>
    <para>This chapter describes themes, the theme settings that are
available in the GNOME Desktop, how to install options for theme settings,
and how to create a custom option.</para>
  </highlights>
  <sect1 id="themes-1">
    <title>Introduction to Themes</title>
    <indexterm>
      <primary>themes</primary>
      <secondary>introduction</secondary>
    </indexterm>
    <para>A theme is a group of coordinated settings that specifies the visual
appearance of a part of the GNOME Desktop. Users can choose themes to change
the appearance of the GNOME Desktop.</para>
    <para>A theme contains settings that affect different parts of the GNOME Desktop,
as follows:</para>
    <variablelist>
      <varlistentry>
        <term>Controls</term>
        <listitem>
          <para><indexterm><primary>themes</primary><secondary>controls options</secondary><tertiary>introduction</tertiary></indexterm><indexterm><primary>GTK+ themes</primary><see>themes, controls
options</see></indexterm>The controls setting for a theme determines the visual
appearance of windows, panels, and applets. The controls setting also determines
the visual appearance of the GNOME-compliant interface items that appear on
windows, panels, and applets, such as menus, icons, and buttons. Some of the
controls setting options that are available are designed for special accessibility
needs. Users can choose an option for the controls setting from the <guilabel>Controls</guilabel> tabbed section in the <application>Theme</application>
preference tool.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>Window frame</term>
        <listitem>
          <para><indexterm><primary>themes</primary><secondary>window frame options</secondary><tertiary>introduction</tertiary></indexterm><indexterm><primary>Metacity themes</primary><see>themes, window frame options</see></indexterm>The window frame setting for
a theme determines the appearance of the frames around windows only. Users
can choose an option for the window frame setting from the <guilabel>Window
Border</guilabel> tabbed section in the <application>Theme</application> preference
tool.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>Icon</term>
        <listitem>
          <para><indexterm><primary>themes</primary><secondary>icons options</secondary><tertiary>introduction</tertiary></indexterm><indexterm><primary>icon themes</primary><see>themes, icons options</see></indexterm>The icon setting for a theme determines the appearance of
the icons on panels and the desktop background. Users can choose an option
for the icon setting from the <guilabel>Icons</guilabel> tabbed section in
the <application>Theme</application> preference tool.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </sect1>
  <sect1 id="themes-17">
    <title>Theme Index File</title>
    <para>Each theme has an index file which defines the characteristics of the
theme. The name of the index file is <filename>/usr/share/themes/<replaceable>theme-name</replaceable>/index.theme</filename>. </para>
    <para>The following is a sample theme index file:</para>
    <programlisting>[Desktop Entry]
Type=X-GNOME-Metatheme
Name=High Contrast Large
Name[es]=Alto contraste grande
Comment=Large black-on-white text and icons
Comment[es]=Textos e iconos grandes en negro sobre blanco
Encoding=UTF-8

[X-GNOME-Metatheme]
GtkTheme=HighContrastLargePrint
IconTheme=HighContrast
MetacityTheme=Atlanta
ApplicationFont=sans 18
</programlisting>
    <para>The following table describes the keys in theme index files:</para>
    <table frame="topbot" id="themes-TBL-18">
      <title>Keys in Theme Index Files</title>
      <tgroup cols="2" colsep="0" rowsep="0">
        <colspec colname="colspec0" colwidth="33*"/>
        <colspec colname="colspec1" colwidth="67*"/>
        <thead>
          <row rowsep="1">
            <entry>
              <para>Index File Key</para>
            </entry>
            <entry>
              <para>Description</para>
            </entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry colname="colspec0" valign="top">
              <para>
                <literal>Type</literal>
              </para>
            </entry>
            <entry colname="colspec1" valign="top">
              <para>Specifies that this theme determines
the appearance of several theme options, such as controls, window frames,
and icons.</para>
            </entry>
          </row>
          <row>
            <entry colname="colspec0" valign="top">
              <para>
                <literal>Name</literal>
              </para>
            </entry>
            <entry colname="colspec1" valign="top">
              <para>The name of the theme. This is
the name of the theme that is displayed in the <application>Theme</application>
preference tool.</para>
            </entry>
          </row>
          <row>
            <entry colname="colspec0" valign="top">
              <para>
                <literal>Comment</literal>
              </para>
            </entry>
            <entry colname="colspec1" valign="top">
              <para>A brief description of the theme.
This is the text that is displayed under the name of the theme in the <application>Theme</application> preference tool.</para>
            </entry>
          </row>
          <row>
            <entry valign="top">
              <para>
                <literal>GtkTheme</literal>
              </para>
            </entry>
            <entry valign="top">
              <para>Corresponds to the controls setting in the <application>Theme</application> preference tool. Specifies which controls setting option
to apply to windows, panels, and applets.</para>
            </entry>
          </row>
          <row>
            <entry valign="top">
              <para>
                <literal>IconTheme</literal>
              </para>
            </entry>
            <entry valign="top">
              <para>Corresponds to the icons setting in the <application>Theme</application> preference tool. Specifies which icons setting option
to apply to panels and the desktop background.</para>
            </entry>
          </row>
          <row>
            <entry valign="top">
              <para>
                <literal>MetacityTheme</literal>
              </para>
            </entry>
            <entry valign="top">
              <para>Corresponds to the window frame setting in the <application>Theme</application> preference tool. Specifies which window frame setting
option to apply to windows.</para>
            </entry>
          </row>
          <row>
            <entry colname="colspec0" valign="top">
              <para>
                <literal>ApplicationFont</literal>
              </para>
            </entry>
            <entry colname="colspec1" valign="top">
              <para>Corresponds to the application font setting in the <application>Font</application>
preference tool.</para>
            </entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </sect1>
  <sect1 id="themes-3">
    <title>To Install a New Controls Option</title>
    <indexterm>
      <primary>themes</primary>
      <secondary>controls options</secondary>
      <tertiary>installing</tertiary>
    </indexterm>
    <para>You can add a new option
for the controls setting in the <application>Theme</application> preference
tool. Controls options reside in the <filename>/usr/share/themes</filename>
directory. The typical structure of a controls option in the file system is
as follows:</para>
    <variablelist>
      <varlistentry>
        <term>Option file</term>
        <listitem>
          <para>
            <filename>/usr/share/themes/<replaceable>option-name</replaceable>/gtk-2.0/gtkrc</filename>
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>Image files</term>
        <listitem>
          <para>
            <filename>/usr/share/themes/<replaceable>option-name</replaceable>/pixmaps/*.*</filename>
          </para>
        </listitem>
      </varlistentry>
    </variablelist>
    <para>Typically, a new option for the controls setting is supplied
as a <filename>.tar.gz</filename> file. To install the new controls option,
unzip the <filename>.tar.gz</filename> file, then untar the <filename>.tar</filename> file into the <filename>/usr/share/themes</filename> directory.</para>
    <para>Users can install their own options for the controls setting. If a user
installs an option for the controls setting, the option is stored in the <filename>$HOME/.themes</filename> directory.</para>
  </sect1>
  <sect1 id="themes-5">
    <title>To Install a New Window Frame Option</title>
    <indexterm>
      <primary>themes</primary>
      <secondary>window frame options</secondary>
      <tertiary>installing</tertiary>
    </indexterm>
    <para>You can add a new option
for the window frame setting in the <application>Theme</application> preference
tool. Window frame options reside in the <filename>/usr/share/themes/<replaceable>option-name</replaceable>/metacity-1</filename> directory. The typical structure
of a window frame option in the file system is as follows:</para>
    <variablelist>
      <varlistentry>
        <term>Option file</term>
        <listitem>
          <para>
            <filename>/usr/share/themes/<replaceable>option-name</replaceable>/metacity-1/metacity-theme-1.xml</filename>
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>Image files</term>
        <listitem>
          <para>
            <filename>/usr/share/themes/<replaceable>option-name</replaceable>/metacity-1/*.*</filename>
          </para>
        </listitem>
      </varlistentry>
    </variablelist>
    <para>Typically, a new option for the window frame setting
is supplied as a <filename>.tar.gz</filename> file. To install the new window
frame option, unzip the <filename>.tar.gz</filename> file, then untar the <filename>.tar</filename> file into the <filename>/usr/share/themes</filename> directory.</para>
    <para>Users can install their own options for the window frame setting. If
a user installs an option for the window frame setting, the option is stored
in the <filename>$HOME/.themes</filename> directory.</para>
  </sect1>
  <sect1 id="themes-16">
    <title>To Install a New Icons Option</title>
    <indexterm>
      <primary>themes</primary>
      <secondary>icons options</secondary>
      <tertiary>installing</tertiary>
    </indexterm>
    <para>You can add a new option for the icons
setting in the <application>Theme</application> preference tool. Icons options
reside in the <filename>/usr/share/icons/<replaceable>option-name</replaceable></filename>
directory. The typical structure of an icons option in the file system is
as follows:</para>
    <variablelist>
      <varlistentry>
        <term>Option file</term>
        <listitem>
          <para>
            <filename>/usr/share/icons/<replaceable>option-name</replaceable></filename>
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>Image files</term>
        <listitem>
          <para>
            <filename>/usr/share/icons/<replaceable>option-name</replaceable>/icons/*.*</filename>
          </para>
        </listitem>
      </varlistentry>
    </variablelist>
    <para>Typically, a new option for the icons setting is supplied
as a <filename>.tar.gz</filename> file. To install the new icons option, unzip
the <filename>.tar.gz</filename> file, then untar the <filename>.tar</filename>
file into the <filename>/usr/share/icons</filename> directory.</para>
    <para>Users can install their own options for the icons setting. If a user
installs an option for the icons setting, the option is stored in the <filename>$HOME/.icons/<replaceable>option-name</replaceable></filename> directory.</para>
  </sect1>
  <sect1 id="themes-11">
    <title>Installing Icons for Themes</title>
    <indexterm>
      <primary>themes</primary>
      <secondary>installing icons</secondary>
    </indexterm>
    <para>The GNOME Desktop provides several themes that are designed
for users with special visual needs. For example, some of the themes are designed
for users with low vision. Several versions of icons might be required so
that the icon can be displayed properly in each theme.</para>
    <para>You might need to install a new icon for an application. When you install
a new icon, you must create several versions of the icon, so that the icon
displays correctly in the themes. You must create several versions of the
following types of icon:</para>
    <itemizedlist>
      <listitem>
        <para>Icons that are used within applications in the GNOME Desktop.</para>
      </listitem>
      <listitem>
        <para>Icons that are used internally by GTK+ applications, or GTK+
stock icons.</para>
      </listitem>
    </itemizedlist>
    <para>When you install a new icon, you must create several versions of the
icon, so that the icon displays correctly in the themes. You can create the
icons in several formats, for example Portable Network Graphic (PNG) format.
The suggested size of icons for the desktop environment is 48 pixels by 48
pixels. At this size, most themes can rescale the icons.</para>
    <para>When you install a new icon, create the following 48 pixel by 48 pixel
versions of the icon:</para>
    <itemizedlist>
      <listitem>
        <para>Regular icon</para>
      </listitem>
      <listitem>
        <para>Low contrast icon</para>
      </listitem>
      <listitem>
        <para>High contrast icon</para>
      </listitem>
      <listitem>
        <para>Inverse high contrast icon</para>
      </listitem>
    </itemizedlist>
    <para>If possible, create 16 pixel by 16 pixel versions of the each of the
icons above also, for themes that do not require large print.</para>
    <para>Install the icons to the image files location that is specified for
the theme in <xref linkend="themes-3"/> or <xref linkend="themes-5"/>. For example,
to add icons to the HighContrastLargePrint theme, add the icons to the <filename>/usr/share/themes/HighContrastLargePrint/pixmaps</filename> directory. Add
references to the icons to the relevant theme files. For example, to add icons
to the HighContrastLargePrint theme, add references to the icons to the <filename>/usr/share/themes/HighContrastLargePrint/gtk-2.0/gtkrc</filename> file. Modify
the <filename>gtkrc</filename> file for the theme to associate the icon with
a GTK stock icon identifier.<!--More info required from Calum.--></para>
    <para>For more information on how to create icons for application launchers
and for panels, see <ulink url="http://www.freedesktop.org/Standards/icon-theme-spec">http://www.freedesktop.org/Standards/icon-theme-spec</ulink>.</para>
  </sect1>
  <sect1 id="themes-15">
    <title>To Create a Custom Controls Option</title>
    <indexterm>
      <primary>themes</primary>
      <secondary>controls options</secondary>
      <tertiary>creating custom</tertiary>
    </indexterm>
    <para>If the options for the
controls setting are not suitable for the needs of your users, you can create
a custom controls option. To create a custom controls option, perform the
following steps:</para>
    <orderedlist>
      <listitem>
        <para>Create a directory structure for the option in the <filename>/usr/share/themes</filename> directory. Use the same directory structure that
other options use. For example, to create an option that is called SmallPrint,
create the following directories:</para>
        <itemizedlist>
          <listitem>
            <para>
              <filename>/usr/share/themes/SmallPrint</filename>
            </para>
          </listitem>
          <listitem>
            <para>
              <filename>/usr/share/themes/SmallPrint/gtk-2.0</filename>
            </para>
          </listitem>
        </itemizedlist>
      </listitem>
      <listitem>
        <para>Locate the <filename>gtkrc</filename> file that is closest
to meeting the needs of your users. Copy the file to the <filename>gtk-2.0</filename> directory of your new option.</para>
      </listitem>
      <listitem>
        <para>Open the <filename>gtkrc</filename> file in a text editor,
 and modify the attributes of the interface elements as required. </para>
      </listitem>
      <listitem>
        <para>If the new option includes images, install the images for
the new option in the <filename>pixmaps</filename> directory of your new option.
If the new option uses images from another option, you do not need to create
copies of the images for the new option. Instead, ensure that the reference
to the images in the <literal>pixmap_path</literal> entry in the <filename>gtkrc</filename> file is correct.</para>
      </listitem>
    </orderedlist>
    <para>Users can now choose the new option for the controls setting.</para>
    <para>For more information on <filename>gtkrc</filename> files, see <ulink url="http://developer.gnome.org/doc/API/2.0/gtk/index.html">http://developer.gnome.org/doc/API/2.0/gtk/index.html</ulink>.</para>
  </sect1>
</chapter>