Warning, /plasma/kde-cli-tools/doc/kcontrol6/filetypes/index.docbook is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" ?>
0002 <!DOCTYPE article PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN"
0003 "dtd/kdedbx45.dtd" [
0004 <!ENTITY % addindex "IGNORE">
0005 <!ENTITY % English "INCLUDE" > <!-- change language only here -->
0006 ]>
0007 
0008 <article id="filetypes" lang="&language;">
0009 <articleinfo>
0010 
0011 <title>File Associations</title>
0012 <authorgroup>
0013 <author>&Mike.McBride; &Mike.McBride.mail;</author>
0014 <!-- TRANS:ROLES_OF_TRANSLATORS -->
0015 </authorgroup>
0016 
0017 <date>2016-11-11</date>
0018 <releaseinfo>Plasma 5.8</releaseinfo>
0019 
0020 <keywordset>
0021 <keyword>KDE</keyword>
0022 <keyword>Systemsettings</keyword>
0023 <keyword>files association</keyword>
0024 <keyword>association</keyword>
0025 </keywordset>
0026 </articleinfo>
0027 <sect1 id="file-assoc">
0028 <title>File Associations</title>
0029 
0030 <sect2 id="file-assoc-intro">
0031 <title>Introduction</title>
0032 
0033 <para>One of the most convenient aspects of &kde;, is its ability to
0034 automatically match a data file with its application.  As an example,
0035 when you click on your favorite &calligrawords; document in the filemanager, &kde;
0036 automatically starts &calligrawords;, and automatically loads that file into
0037 &calligrawords; so you can begin working on it.</para>
0038 
0039 <para>In the example above, the &calligrawords; Data file is
0040 <emphasis>associated</emphasis> with &calligrawords; (the application).  These
0041 file associations are crucial to the functioning of &kde;.</para>
0042 
0043 <para>When &kde; is installed, it automatically creates hundreds of file
0044 associations to many of the most common data types. These initial
0045 associations are based on the most commonly included software, and the
0046 most common user preferences.</para>
0047 
0048 <para>Unfortunately, &kde; can not:</para>
0049 
0050 <itemizedlist>
0051 <listitem><para>predict every possible combination of software and data files</para></listitem>
0052 <listitem><para>prepare for file formats not yet invented</para></listitem>
0053 <listitem><para>or predict everyone's favorite application for certain file formats</para></listitem>
0054 </itemizedlist>
0055 
0056 <para>You can change your current file associations or add new file
0057 associations using this module.</para>
0058 
0059 <para>Each file association is recorded as a &MIME; type.
0060 &MIME; stands for <quote>Multipurpose Internet Mail
0061 Extensions</quote>. It allows a computer to determine the type of file,
0062 without opening and analyzing the format of each and every file.</para>
0063 
0064 </sect2>
0065 
0066 <sect2 id="file-assoc-use">
0067 <title>How to use this module</title>
0068 
0069 <para>You can start this module
0070 by opening &systemsettings; and selecting <menuchoice><guimenu>Applications</guimenu>
0071 <guimenuitem>File Associations</guimenuitem></menuchoice> in the
0072 <guilabel>Personalization</guilabel> category. Alternatively, you can start it by
0073 typing <command>kcmshell5 filetypes</command> from the terminal or &krunner;.</para>
0074 
0075 <para>The file associations are organized into several categories, and
0076 at a minimum you will have:</para>
0077 
0078 <orderedlist>
0079 <listitem><para>Application</para></listitem>
0080 <listitem><para>Audio</para></listitem>
0081 <listitem><para>Image</para></listitem>
0082 <listitem><para>Inode</para></listitem>
0083 <listitem><para>Message</para></listitem>
0084 <listitem><para>Multipart</para></listitem>
0085 <listitem><para>Text</para></listitem>
0086 <listitem><para>Video</para></listitem>
0087 </orderedlist>
0088 
0089 <para>All of the file associations are sorted into one of these
0090 categories.</para>
0091 
0092 <note><para>There is no functional difference between any of the
0093 categories.  These categories are designed to help organize your file
0094 associations, but they do not alter the associations in any way.
0095 </para></note>
0096 
0097 <para>The categories are listed in the box labeled <guilabel>Known
0098 Types</guilabel>.</para>
0099 
0100 <para>You can explore each of these categories, and see the file
0101 associations contained within each one, by simply double-clicking on the
0102 category name.  You will be presented with a list of the associated
0103 &MIME; types under that category.</para>
0104 
0105 <tip><para>You can also search for a particular &MIME; type by using the
0106 search box. The search box is labeled <guilabel>Search for file type or
0107 filename pattern...</guilabel> and is located above the category list.</para>
0108 
0109 <para>Simply type the first letter of the &MIME; type you are interested
0110 in.  The categories are automatically expanded, and only the &MIME; types
0111 that include that letter are displayed.</para>
0112 
0113 <para>You can then enter a second character and the &MIME; types will be
0114 further limited to &MIME; types containing those two
0115 characters.</para></tip>
0116 
0117 <sect3 id="file-assoc-use-add">
0118 <title>Adding a new MIME type</title>
0119 
0120 <para>If you want to add a new &MIME; type to your file associations,
0121 you can click on the <guibutton>Add...</guibutton> button.  A small
0122 dialog box will appear.  You select the category from the drop down
0123 box labeled <guilabel>Group:</guilabel>, and type the &MIME; name in the
0124 blank labeled <guilabel>Type name:</guilabel>.  Click <guibutton>OK</guibutton>
0125 to add the new &MIME; type, or click <guibutton>Cancel</guibutton> to not add
0126 any new &MIME; types.</para>
0127 
0128 </sect3>
0129 
0130 <sect3 id="file-assoc-use-del">
0131 <title>Removing a MIME type</title>
0132 
0133 <para>If you want to remove a &MIME; type, simply select the &MIME;
0134 type you want to delete by clicking once with the mouse on the &MIME;
0135 type name.  Then click the button labeled
0136 <guibutton>Remove</guibutton>.  The &MIME; type will be deleted
0137 immediately.</para>
0138 <para>You can remove only your own &MIME; types.</para>
0139 
0140 </sect3>
0141 
0142 <sect3 id="file-assoc-use-edit">
0143 <title>Editing a MIME types properties</title>
0144 
0145 <para>Before you can edit a &MIME; types property, you must first
0146 specify which &MIME; type.  Simply browse through the categories until
0147 you find the &MIME; type you want to edit, then click once on it with
0148 the mouse.</para>
0149 
0150 <para>As soon as you have selected the &MIME; type, the current values of
0151 the &MIME; type will appear in the module window.</para>
0152 
0153 <para>You will notice the current values are split into two tabs:
0154 <guilabel>General</guilabel> and <guilabel>Embedding</guilabel></para>
0155 
0156 <variablelist>
0157 <varlistentry>
0158 <term><guilabel>General</guilabel></term>
0159 <listitem>
0160 <para>There are 4 properties for each &MIME; type in this tab:</para>
0161 
0162 <orderedlist>
0163 <listitem><para><guilabel>Mime Type Icon</guilabel> is the icon that
0164 will be visible when using &dolphin; or &konqueror; as a file
0165 manager.</para></listitem>
0166 <listitem><para><guilabel>Filename Patterns</guilabel> is a search
0167 pattern which &kde; will use to determine the &MIME; type.</para></listitem>
0168 <listitem><para><guilabel>Description:</guilabel> is a short description
0169 of the file type. This is for your benefit only.</para></listitem>
0170 <listitem><para><guilabel>Application Preference Order</guilabel>
0171 determines which applications will be associated with the specified
0172 &MIME; type.</para></listitem>
0173 </orderedlist>
0174 </listitem>
0175 </varlistentry>
0176 
0177 <varlistentry>
0178 <term><guilabel>Embedding Tab</guilabel></term>
0179 <listitem>
0180 <para>The Embedding tab allows you to determine if a file will be
0181 viewed within a filemanager window, or by starting the
0182 application.</para>
0183 </listitem>
0184 </varlistentry>
0185 </variablelist>
0186 
0187 </sect3>
0188 
0189 <sect3 id="file-assoc-use-icon">
0190 <title>Changing the Icon</title>
0191 
0192 <para>To change the icon, simply click on the Icon button.  A dialog box
0193 will appear, which will show you all available icons.  Simply click once
0194 with the mouse on the icon of your choice, and click
0195 <guibutton>OK</guibutton>.</para>
0196 
0197 </sect3>
0198 
0199 <sect3 id="file-assoc-use-pattern">
0200 <title>Editing the MIME type patterns</title>
0201 
0202 <para>The box labeled <guilabel>Filename Patterns</guilabel>, determines
0203 what files will be included within this &MIME; type.</para>
0204 
0205 <para>Usually, files are selected based on their suffix.  (Examples:
0206 Files that end with <literal role="extension">.wav</literal> are sound
0207 files, using the WAV format and files that end in <literal
0208 role="extension">.c</literal> are program files written in C).</para>
0209 
0210 <para>You should enter your filename mask in this combo box.</para>
0211 
0212 <para>The asterisk (<literal>*</literal>) is a wildcard character that
0213 will be used with nearly every &MIME; type mask. A complete discussion
0214 of wildcards is beyond the scope of this manual, but it is important
0215 to understand that the asterisk (in this context),
0216 <quote>matches</quote> any number of characters.  As an example:
0217 <userinput>*.pdf</userinput> will match
0218 <filename>Datafile.pdf</filename>, <filename>Graphics.pdf</filename>
0219 and <filename>User.pdf</filename>, but not <filename>PDF</filename>,
0220 <filename>Datafile.PDF</filename>, or
0221 <filename>.pdf</filename>.</para>
0222 
0223 <tip><para>It is very beneficial to have multiple masks.  One for lower
0224 case, one for upper case, &etc;  This will help ensure that &kde; can
0225 determine the file type more accurately.</para></tip>
0226 
0227 </sect3>
0228 
0229 <sect3 id="file-assoc-use-desc">
0230 <title>Editing a MIME types description</title>
0231 
0232 <para>You can type a short description of the &MIME; type in the text
0233 box labeled <guilabel>Description:</guilabel>.  This label is to help
0234 you, it does not affect the function of the &MIME; type.</para>
0235 
0236 </sect3>
0237 
0238 <sect3 id="file-assoc-use-app">
0239 <title>Editing the application associations</title>
0240 
0241 <para>There are five buttons (<guibutton>Move Up</guibutton>,
0242 <guibutton>Move Down</guibutton>, <guibutton>Add...</guibutton>, <guibutton>Edit...</guibutton> and
0243 <guibutton>Remove</guibutton>) and a list box (which lists the
0244 applications) which are used to configure the applications.</para>
0245 
0246 <para>The list box lists all of the applications associated with a
0247 specific &MIME; type.  The list is in a specific order.  The top
0248 application is the first application tried.  The next application down
0249 the list is the second, &etc;</para>
0250 
0251 <note><para>What do you mean there is more than one application per
0252 &MIME; type?  Why is this necessary?</para>
0253 
0254 <para>We started out by saying that &kde; comes preconfigured with
0255 hundreds of file associations.  The reality is, each system that &kde;
0256 is installed on has a different selection of applications.  By
0257 allowing multiple associations per &MIME; type, &kde; can continue to
0258 operate when a certain application is not installed on the
0259 system.</para>
0260 
0261 <para>As an example:</para>
0262 <para>For the &MIME; type <literal>pdf</literal>, there are two
0263 applications associated with this file type.  The first program is
0264 called &okular;.  If your system does not
0265 have &okular; installed, then &kde;
0266 automatically starts the second application &krita;.
0267 As you can see, this will help keep &kde; running
0268 strong  as you add and subtract applications.</para></note>
0269 
0270 <para>We have established that the order is important.  You can change
0271 the order of the applications by clicking once with the mouse on the
0272 application you want to move, and then clicking either <guibutton>Move
0273 Up</guibutton> or <guibutton>Move Down</guibutton>.  This will shift
0274 the currently selected application up or down the list of
0275 applications. </para>
0276 
0277 <para>You can add new applications to the list by clicking the button
0278 labeled <guibutton>Add...</guibutton>.  A dialog box will appear. Using the
0279 dialog box, you can select the application you want to use for this &MIME;
0280 type.  Click <guibutton>OK</guibutton> when you are done, and the
0281 application will be added to the current list.</para>
0282 
0283 <para>To change the options of an application for a particular &MIME; type
0284 select it in the list and then press the <guibutton>Edit...</guibutton> button.
0285 This opens a new dialog with <guilabel>General</guilabel>, <guilabel>Permissions</guilabel>,
0286 <guilabel>Application</guilabel> and <guilabel>Details</guilabel> tabs.
0287 On the <guilabel>Application</guilabel> tab you can edit <guilabel>Name:</guilabel>,
0288 <guilabel>Description:</guilabel> and <guilabel>Comment:</guilabel>.
0289 In the <guilabel>Command:</guilabel> field you can have several place holders
0290 following the command, which will be replaced with the actual values
0291 when the actual program is run:</para>
0292 <itemizedlist>
0293 <listitem><para>%f - a single file name</para></listitem>
0294 <listitem><para>%F - a list of files; use for applications that can open several local files 
0295 at once</para></listitem>
0296 <listitem><para>%u - a single &URL;</para></listitem>
0297 <listitem><para>%U - a list of &URL;s</para></listitem>
0298 <listitem><para>%d - the folder of the file to open</para></listitem>
0299 <listitem><para>%D - a list of folders</para></listitem>
0300 <listitem><para>%i - the icon</para></listitem>
0301 <listitem><para>%m - the mini-icon</para></listitem>
0302 <listitem><para>%c - the caption</para></listitem>
0303 </itemizedlist>
0304 
0305 <para>You can remove an application (thereby ensuring that the
0306 application will never run with this &MIME; type by clicking once on the
0307 name of the application, and clicking the <guibutton>Remove</guibutton>
0308 button.</para>
0309 
0310 <tip><para>It is a good idea to use the <guibutton>Move Up</guibutton>
0311 and <guibutton>Move Down</guibutton> buttons to adjust the unwanted
0312 application to a lower position in the list, rather than deleting the
0313 application from the list entirely.  Once you have deleted an
0314 application, if your preferred application should become compromised,
0315 there will not be an application to view the data document.</para></tip>
0316 
0317 </sect3>
0318 
0319 <sect3 id="file-assoc-embedding">
0320 <title>Embedding</title>
0321 <para>These settings are valid only for &konqueror; used as file manager, &dolphin;
0322 is not able to use embedded views and opens a file always in the associated application.</para>
0323 <para>By clicking on the <guilabel>Embedding</guilabel> tab, you are
0324 presented with four radio buttons in the <guilabel>Left Click Action in Konqueror</guilabel>
0325 group.  These determine how the filemanager views the selected &MIME; type:</para>
0326 
0327 <variablelist>
0328 <varlistentry><term>Show file in embedded viewer</term>
0329 <listitem><para>If this is selected, the file will be shown <emphasis>within</emphasis> the filemanager window.</para></listitem></varlistentry>
0330 <varlistentry><term>Show file in separate viewer</term>
0331 <listitem><para>This will cause a separate window to be created when showing this &MIME; type.</para></listitem></varlistentry>
0332 <varlistentry><term>Use settings for 'application' group</term>
0333 <listitem><para>This will cause the &MIME; type to use the settings for the &MIME; type group.
0334 (if you are editing an audio &MIME; type, then the settings for the audio group are used).</para></listitem></varlistentry>
0335 <varlistentry><term>Ask whether to save to disk instead</term>
0336 <listitem><para>This setting applies only to &konqueror; in browser mode and determines
0337 if the file is shown in an embedded viewer or if you are asked to save the file to disk instead.</para></listitem></varlistentry>
0338 </variablelist>
0339 
0340 <para>Below this is a listbox labeled <guilabel>Services Preference
0341 Order</guilabel>.</para>
0342 
0343 <para>When you use a filemanager like &dolphin; or &konqueror;, you can
0344 <mousebutton>right</mousebutton> mouse click, and a menu will with an
0345 entry labeled <guimenuitem>Open with...</guimenuitem> will appear.  This box
0346 lists the applications that will appear, in the order they will
0347 appear, under this menu.</para>
0348 
0349 <para>You can use the <guibutton>Move Up</guibutton> and
0350 <guibutton>Move Down</guibutton> buttons to change the order.</para>
0351 
0352 </sect3>
0353 
0354 <sect3 id="file-assoc-use-done">
0355 <title>Making changes permanent</title>
0356 
0357 <para>When you are done making any changes to &MIME; types, you can click
0358 <guibutton>Apply</guibutton> to make your changes permanent, but keep
0359 you in this module.</para>
0360 
0361 </sect3>
0362 </sect2>
0363 
0364 </sect1>
0365 
0366 </article>