.TH XFM_MAILCAP 5 "20 April, 2006" "xfm" XFM .\" Copyright (C) 2006, Bernhard R. Link .\" You may distribute under the terms of the GNU General Public .\" License as specified in the file COPYING that comes with xfm. .SH NAME xfm_mailcap \- mailcap information for usage within xfm or xfmmailcap .SH DESCRIPTION To determine what command to use to open a file with a specific mime type, \fBxfm\fP(1) uses files in a format similar to the mailcap format. The extensions are special actions to open directories or files to load into the application window and to include other mailcap files, so that the default mailcap databases in \fB~/.mailcap\fP, \fB/etc/mailcap\fP, \fB/usr/share/etc/mailcap\fP and \fB/usr/local/etc/mailcap\fP can be included. This man page describes which fields are used and the extensions. For general information of the syntax of these files read the man pages \fBmailcap\fP(5) and \fBupdate\-mime\fP(8). While this files are supposed to be read by \fBxfm\fP(1), there also is the program \fBxfmmailcap\fP(1) to ease debugging. .SH "GENERAL FORMAT" There is one entry per line. Empty lines and lines starting with a hash (#) are ignored. Each line consists of parts separated by semicolons (;). The first part is the mime part or the token \fBinclude\fP. The second part is the \fIview\fP option. This is followed by an arbitrary number of option names, followed by a value after a equal sign, if they have a value. .SH INCLUDES Lines with a mime-type \fBinclude\fP or \fB!include\fP are not treated as mailcap specifiers, but cause the filename described by the second argument to be read at this place. I recommend placing the following line at the end of every \fI$HOME\fP\fB/.xfm/xfm_mailcap\fP file: include; /etc/X11/xfm/mailcap .SH "OPTIONS USED BY XFM" .TP .B test The value of this option (after unescaping) is executed using \fBsystem\fP(3). If it fails, the content of the line is not used for anything but increasing the amount of output. Some tests weather a \fIDISPLAY\fP environment variable are set are omitted and considered always true. .TP .B nametemplate If this option has a value, the filename has to match it when a action is executed. Otherwise it is replaced by a symlink matching it. It has to contain exactly one unescaped occurrence of \fB%s\fP, which is used as wild card for any positive number of characters. .TP .B edit This is the preferred action to open a file. Unless it is one of the special actions explained below, it has to contain exactly one unescaped occurance of \fB%s\fP, which is replaced by the filename to open, or the filename of a symlink to the file to open in the case the filename might be dangerous or does not match the nametemplate of this line. .TP .B needsterminal If this option, which normally has no value, is there, the actions specified in this line are executed in an X terminal emulator. .SH "SPECIAL ACTIONS" If the action with the highest priority is one the special strings \fBOPEN\fP or \fBLOAD\fP, no shell is spawned and no command executed. Instead the current file window is changed to the selected directory (\fBOPEN\fP) or the file is supposed to be in the \fBxfm\fP(5) format and loaded into the application window(\fBLOAD\fP). .SH FILES .TP .B \fI$HOME\fP/.xfm/xfm_mailcap Unless \fBxfm\fR(1) is told to look at a different place via X resource \fBXfm.mailcapFile\fP, this is the first place xfm looks for a file with the describes format. \fBxfmmailcap\fP(1) always looks here first. .TP .B /etc/X11/xfm/xfm_mailcap If the first file does not exists, \fBxfm\fP(1) (unless it gets told a different place via the X resource \fBXfm.systemwideMailcapFile\fP) and \fBxfmmailcap\fP(1) look for this file. It is recommended that the file in the home directory includes this file to get the system wide defaults. .SH "SEE ALSO" .BR xfm (1), .BR xfmmailcap (1), .BR mailcap (5), .BR update\-mime (8).