Penguin
Blame: gnome-vfs-mime(5)
EditPageHistoryDiffInfoLikePages
Annotated edit history of gnome-vfs-mime(5) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 GNOME
2 !!!GNOME
3 NAME
4 MIME type of files
5 MIME type definition files.
6 MIME key information
7 Special key used by the GNOME system
8 AUTHOR
9 ----
10 !!NAME
11
12
13 GNOME MIME configuration files
14
15
16 The GNOME system uses MIME types to classify content. Each
17 MIME type on the GNOME system has a number of attributes
18 attached to it. Some of these attributes have a special
19 meaning to the GNOME system.
20 !!MIME type of files
21
22
23 There are two ways of classifying a file in the GNOME
24 system: by matching their extension or a regular expression
25 with their name or by its content. GNOME applications use
26 one of those two methods depending on speed contraints and
27 the specific setup. The MIME types available on the system
28 can be configured at runtime by putting special files in
29 either the GNOME MIME directory
30 ''(${prefix}/share/mime-info)'' or the user
31 ''~/.gnome/mime-info'' directory.
32 !!MIME type definition files.
33
34
35 The routines that classify a file by its name, use the
36 contents of all of the files with the extension ''.mime''
37 from the ''${prefix}/share/mime-info'' directory and the
38 ''~/.gnome/mime-info'' to build the database for filename
39 matching. The latter is supported to enable users to provide
40 their mime types to extend the system defaults.
41
42
43 Application that wish to install their own MIME types only
44 need to install a file in this directory.
45
46
47 The file ''${prefix}/share/mime-info/gnome.mime'' is
48 special, as it contains the defaults for gnome, and is read
49 first. In addition, the file
50 ''~/.gnome/mime-info/user.mime'' is read last. This will
51 guarantee that there is a way to set system defaults, and
52 there is a way for the user to override them. There is
53 currently no way to tell anything about the order of the
54 other files in those directories, nor is there anyway to
55 override system defaults yet.
56
57
58 The format is the following:
59
60
61 mime-type-name
62 ext[[,priority]: ext1 ext2 ext3
63 ext[[,priority]: ext4
64 regex[[,priority]: regex1
65 regex[[,priority]: regex2
66 where
67
68
69 For example, for a vCalendar application, this file would be
70 installed:
71
72
73 ------ calendar.mime -------
74 application/v-calendar:
75 ext: vcf
76 -----------------------------
77 !!MIME key information
78
79
80 To add keys to a MIME type, it is necessary to install a
81 file with the extension ''.keys'' in the
82 ''${prefix}/share/mime-info'' directory or in the
83 ''~/.gnome/mime-info'' directory. The former is for
84 system-provided mime-information and the latter is to enable
85 the user to extend the actions as provided by the
86 system.
87
88
89 The file ''${prefix}/share/mime-info/gnome.keys'' is
90 special, as it contains the defaults for gnome, and is read
91 first. In addition, the file
92 ''~/.gnome/mime-info/user.keys'' is read last. This will
93 guarantee that there is a way to set system defaults, and
94 there is a way for the user to override them. There is
95 currently no way to tell anything about the order of the
96 other files in those directories, nor is there anyway to
97 override system defaults yet.
98
99
100 The ''.keys'' files have the following
101 format:
102
103
104 mime-type-match:
105 [[]key=value
106 Above, the ''key'' is the key that is being defined and ''value'' is the value we bind to it. The optional ''[[LANG]'' represents a language in which this definition is valid. If this part is specified, then the definition will only be valid if LANG matches the setting of the environment variable LANG. The LANG setting is used to provide keys which can be displayed to the user in a localized way.
107
108
109 This is an example to bind the key ''open'' to all of the
110 mime-types matching ''image/*'' and the
111 ''icon-filename'' key is bound to the
112 ''/opt/gimp/share/xcf.png'' value:
113
114
115 image/*:
116 open=gimp %f
117 image/x-xcf:
118 icon-filename=/opt/gimp/share/xcf.png
119 This will make the GIMP the handler for the open action. Files of type xcf would use the filename pointed in the ''icon-filename'' key.
120
121
122 ''%f gets'' interpolated with the file name or the list
123 of file names that matched this mime-type.
124
125
126 As you can see from the example above, a ''.keys'' file
127 does not need to provide all of the values, it can just
128 provide or override some of the actions.
129
130
131 User defined bindings in ''.keys file will take''
132 precedence over system installed files.
133 !!Special key used by the GNOME system
134
135
136 The following keys are currently used in the GNOME
137 desktop:
138
139
140 ''open''
141
142
143 Open the file with this command.
144
145
146 ''icon-filename''
147
148
149 The filename with the icon that should be used to represent
150 files of this type.
151
152
153 ''view''
154
155
156 Command to view the file contents.
157
158
159 ''ascii-view''
160
161
162 A command that should be used to do an ascii-rendering of
163 the file. Used as a fallback by the filemanager if a ''view
164 action'' does not exist.
165
166
167 ''fm-open''
168
169
170 file-manager open. If present, the file manager will use
171 this action instead of the value in open to perform this
172 action (the filemanager for example will open archive files
173 as if they were directories by using the VFS).
174
175
176 ''fm-view''
177
178
179 file-manager view. If present, invoking the view opertion on
180 the file manager will use the value defined here instead of
181 the value in
182
183
184 ''fm-ascii-view''
185
186
187 Fallback operation for the file manager as
188 well.
189
190
191 Those keys are also queried on the metadata (except in the
192 cases where the lookup would be too expensive).
193 !!AUTHOR
194
195
196 This manual page has been written by Miguel de Icaza
197 (miguel@gnu.org)
198 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.