FILE TYPE DATABASE

A file type database is a plain text file comprised of one or more records. See FILES section in this manual for database file locations.

A record starts with a type name string, consisting of alpha-numeric characters that may contain spaces, followed by an opening bracket { on the same or following line, and ends with a closing bracket } on a separate line.

Within record's scope, properties and matching patterns are specified as name/value pairs.

Comments may be specified following the # character.

  Record Fields

icon <string>
    Specifies icon name to be displayed for this file type.

mime <string>
    Specifies MIME type. This is not used internally, but is accessible through a context dependent variable %m.

match_name <glob pattern>
    One or more glob patterns† to match the file name against.

match_content #<offset> <data>
    One or more data patterns† to match file contents against.

action <name>: <command>
    Action to be displayed in the file context menu. Any character in the name may be prefixed with & to specify a mnemonic. Literal & may be specified using the \ escape character.

NOTE: Multiple values may be specified for file name and content patterns, - one per line - within a scope delimited by an opening bracket { on the same or following line, and a closing bracket } on a separate line.

  Variable Expansion

Unix shell like variable expansion is supported in action command strings.

XFile local and context dependent variables start with the % character, while environment variables start with $. The sh syntax ${...} and respectively %{...} is also supported.

Local variables are defined using X resources in form:
XFile.variables.<name>: <value>

Substitute name with the variable name of choice, and value with the value desired.

  Context Dependent Variables

%n	File name of the selected item.
%p	Path name of the selected item (working directory).
%m	MIME string (if specified in the database).

  Predefined Variables

The default database makes use of several predefined variables listed below. These may be set in user's .Xresources (see Variable Expansion above) to accommodate the environment, without modifying the database.

terminal, textEditor, webBrowser, imageViewer, imageEditor, audioPlayer, videoPlayer.

NOTE:
    The terminal command must treat all arguments passed to it as a list of commands and their respective arguments to be executed (it defaults to xterm -e)