launcher(1)
NAME
- launcher - a one-stop solution for mapping filenames to
- handlers using MIME types
SYNOPSIS
launcher [--all] [--compressed] [--default] [--help] [--nowait] [--showtypes] [--type] [--version] filenames...
DESCRIPTION
- The launcher is intended to be invoked from a commandline
- or from any sort of program requiring application file handling
- facilities. It is a layer of indirection between any application
- and the helper applications required to open a particular file.
GENERAL OPERATION
- The launcher can be substituted anywhere a helper app
- would normally be deployed. Simply construct the commandline nec
- essary to satisfy the behavior expected by the calling applica
- tion.
- The Launcher uses two methods to determine the type of
- files passed in on the commandline and then maps a defined han
- dler (see below) to that file (or group of files). If more than
- one handler is defined for a given file type, a GUI window will
- be displayed allowing the user to choose which application to
- use.
- The Launcher's primary config file (discussed below) may
- be edited using either a standard text editor or the GUI configu
- rator which is installed as part of the Launcher package. This
- GUI can be called from the commandline as "launcherconfig" or may
- be invoked by clicking the third mouse button in the application
- selection GUI.
- This basic mode of operation may be modified by using the
- options defined below when calling the launcher from a command
- line.
OPTIONS
- --all Send all same-type files to the same handler invo
- cation if the configuration indicates that the handler can open
- multiple files. For instance, open all text/plain documents with
- the same copy of emacs. Note that not all helper apps support
- multiple files on their commandlines. If the defined app does not
- support multiple files, a separate instance will be launched for
- each file, regardless of the state of this flag. This option may
- be specified in the launcher.map file as a launcher directive.
- (see below)
- --compressed
- Peek inside compressed files to detect primary type
- using the file command's "-z" option. Note that this will return
- the internal type which will then be mapped to the handlers de
- fined for that type. If your defined handlers do not read com
- pressed data then this won't work very well. One option is to map
- compressed data reading handlers (like gv) to the compressed
- types as well as to their primary types. This can be used implic
- itly with the provided definition in the launcher mapfile called
- "Peek in compressed..." which will recursively call the launcher
- with the --compressed option for you.
- --default
- Surpress user queries and just use the default han
- dler for each type. The default handler is the *first* one de
- fined on any given type. This option may be specified in the
- launcher.map file as a launcher directive. (see below)
- --help Print out the usage message.
- --nowait
- Do not wait for each launched application to exit
- before continuing or exiting. Off by default. Some applications
- (i.e. Netscape) will delete temporary files when the helper app
- has exited. If the launcher returns immediately, the file in
- question may be deleted by the calling application before the
- handler has read it. This option may be specified in the launch
- er.map file as a launcher directive. (see below)
- --showtypes
- Print the name and MIME type of each file to stdout
- and exit without launching any handlers. This allows the launcher
- to be used as a generic MIME file typer.
- --type mimetype
- Force "mimetype" (of the form type/subtype) to the
- be type for all files specified on the commandline - bypasses all
- filetype tests. If "mimetype" is unrecognized business will pro
- ceed as usual.
- --version
- Print out the version and primary web address.
FILES
- /etc/mime.types, /usr/share/misc/magic, /etc/magic,
- /etc/launcher.map ~/.mime.types, ~/.magic.mime, ~/.launcher.map
- The launcher uses up to three files to determine file type
- and type/handler mappings. Personal user files override global
- system files. Only one mime.types or magic.mime file, personal or
- global, need be readable for the launcher to do its work. One
- launcher.map file is required.
- mime.types
- The mime.types file is a file extension to MIME
- type definition file. A copy should be included with the launcher
- distribution. A copy may also be obtained from the Apache web
- server distribution. Lines beginning with a "#" are comments. En
- tries follow the form:
- type/subtype ext [ext] [ext...]
e.g.
image/jpeg jpg jpeg jfif - magic The magic file is a standard "file" command format
- ted magic numbers file. Instead of outputting the normal human
- readable, difficult to parse text, it returns MIME types when
- possible. No attempt will be made to document the format here. A
- copy should have been included with the launcher distribution.
- Other copies may be obtained from the Apache web server package
- or the KDE desktop environment package.
- launcher.map
- The launcher.map file is the one launcher-specific
- config file in the package. It is designed to be easily parseable
- by any utility wishing to have access to the enclosed type/han
- dler mappings. Some of the launcher's commandline options may al
- so be set in this file. They are differentiated from the rest of
- the data so that other utilities parsing this file may safely ig
- nore them. This mapfile was also designed to overcome some limi
- tations of the common metamail .mailcap file format. Lines be
- ginning with a "#" are comments. All other entries begin with a
- keyword directive, and all otherwise unrecognized lines will be
- ignored by the launcher. All entries must appear one-per line
- with NO breaks within records. In the section below, a "
- Launcher options are set as follows:
- <directive> <option> <boolean value>
e.g.
launcher nowait 1 - See the options section of this manpage for which
- options are supported in the config file. The name used in the
- config file is identical to the long option name on the command
- line, but without the switch prefix "--".
- Handler/helper application definitions are set as
- follows:
- <directive> <macroname> <multiplefileflag> <pretty
- name> <handler definition>
e.g.
handler xv 1 "XV" xv -8 -owncmap %s
handler netscape_rf 0 "Netscape file" netscape3 - -remote openFile(%s)
- The character sequence "%s" will be replaced with
- the filename(s). Similarly, "%d" will be replaced with the parent
- directory of "%s". Fields with embedded spaces or tabs MUST be
- quoted. The multiplefileflag field indicates whether or not the
- application will accept more than one filename on the command
- line.
- Type/Handler mapping entries are set as follows:
- <directive> <mimetype> <handlermacro>
e.g.
map text/Makefile emacs
map text/Makefile make
map text/plain emacs jmacs gxedit xedit printtofile - make
- Multiple mappings may be defined for each type. The
- FIRST type defined for each type is the default. Multiple map
- pings may be spread across different entries or be strung togeth
- er on a single line. */* is the default handler for unrecognized
- types. Defining a handler for */* will prevent the hanlder disam
- biguation GUI from being displayed in favor of the default han
- dler. Wildcard type handlers such as image/* are not yet imple
- mented.
AUTHOR
Ethan Gold <etgold@cs.columbia.edu>
http://www.cs.columbia.edu/~etgold/software/launcher/
- Launcher version 0.85 May 31, 1999
- launch