XFM

Section: User Commands (1)
Updated: May 16 1994
Index Return to Main Contents
 

NAME

xfm - X file and applications manager

 

SYNOPSIS

xfm [options ...]

 

DESCRIPTION

Xfm is a file and applications manager program for the X window system. It provides virtually all of the features that you would expect in a file manager - move around your directory tree in multiple windows, move, copy or delete files, and launch programs with simple mouse operations. Directory displays are updated automatically in regular intervals when the contents of the directory changes. The integrated application manager provides a kind of ``shelf'' onto which you can place your favourite applications, as well as the files and directories you are currently working with. It also allows you to access different groups of applications and files. User-definable file types let you specify a command to be executed when double-clicking on a file or dropping other files onto it. Last not least, xfm can automatically mount and unmount special devices like floppies as you open and close the corresponding directories (mount points).  

OPTIONS

Xfm accepts all the usual toolkit options. Furthermore, the following options let you control which windows should be displayed at startup.
-appmgr
Only display the application manager window.
-filemgr
Only display the file manager window.

If both -appmgr and -filemgr are specified, then the applications and one file manager window will be displayed, which is also the default. If only -filemgr is specified, the application manager will not be available in this session.  

RUNNING XFM FOR THE FIRST TIME

There are a number of configuration files which need to be placed in your home directory in order to run xfm. To install the default configuration files, run the program xfm.install which will create a directory ~/.xfm and install some files in there. These are your personal configuration files, and may be edited to customise Xfm to your own tastes.  

USAGE

Most of it should be fairly obvious. There is one application window and zero or more file windows in which directories (also termed folders) are displayed. In order to perform an action, you either select items and then invoke a menu operation, or you drag items from a file window to a second (maybe the same) file window or the application window. You can also double-click on an item to start a corresponding action (like launching an application, editing a file, or changing directories), and press the right menu button on an item to bring up a menu containing operations for a single file or application. Pressing the right button on the background of the application window displays the application menu. File operations are accessed from the file window menu bar as usual.

The left-hand mouse button selects an item (and deselects all others in the same window). The second button toggles the selected state of an item.

You can drag with the left-hand button to another window (or another icon, in general a valid destination will be highlighted with a border when the cursor is over it) to move files from one directory to another. The second button used in the same way will copy files. Applications can be launched by dropping files on them; and installing files and programs in the application manager can be done by dropping files on the background of the application window. Finally, new file windows can be opened by simply dragging a directory icon to the root window.

The action taken when double-clicking on a file depends on the type of the file. If it is a directory, it is displayed in the file window. If it is an executable, the program is started. Other files are opened in the default editor (specified by the defaultEditor resource), unless another action is given in the xfmrc file (see CONFIGURATION below).

Directories can be displayed in three different forms: tree (display subdirectories in tree-like form), icon (display directories and files as icons) and text (similar to ls -l). These options are selected from the View menu. In the tree form, clicking on the arrows takes you up or down one level.  

MENU COMMANDS

FILE MENU

File manipulation operations.

New...

Create a new (and empty) file.
Move

Rename a single item (directory or file) or move selected items to another directory.
Copy

Create a copy of a single item under a new name or copy selected items to another directory.
Link...

Create a symbolic link.
Delete

Delete the selected items.
Select...

Select items by pattern.
Select all

Select all items in the current directory (except the parent directory).
Deselect

Deselect all items.
Quit

Terminate xfm.

FOLDER MENU

Operations dealing with directories and the file window.

New...

Create a new directory.
Go to...

Display the specified directory.
Home

Display your home directory.
Up

Display the parent directory.
Empty

Delete all items in the current directory.
Close

Close this file window.

VIEW MENU

Options for the directory display.

Tree

Select the tree form display.
Icons

Select the icons form display.
Text

Select the text form display.
Sort by name

Sort directory by name.
Sort by size

Sort directory by size.
Sort by date

Sort directory by date.
Hide folders

Suppress directory items.
Mix folders/files

Mix directories and other files.
Show hidden files

Show hidden files (files starting with a dot).

FILE POPUP MENU

Operations on a single file. This menu pops up when pressing the right mouse button on a directory or file icon.

Open
Edit

Open a new file window if the selected item is a directory, otherwise edit the selected file.
Move

Move the selected item.
Copy

Copy the selected item.
Delete

Delete the selected item.
Information...

Display information about the selected item (file size, permissions and such).
Permissions...

Change the permissions of the selected item.

APPLICATION MENU

Operations for managing the applications window.

Install...

Install a new application in the applications window. Pops up a dialog form into which you can enter the necessary information (see CONFIGURATION for a discussion of the fields in this form).
Delete

Delete the selected items from the applications window.
Save setup

Save the state of the applications window in the applications file (see CONFIGURATION below).
Load setup

Restore the setup from the applications file.
File window

Open a new file window.
Quit

Terminate xfm.

APPLICATION POPUP MENU

Operations on a single application item. This menu pops up when pressing the right mouse button on an icon in the application window.

Edit

Edit an application item. Pops up a dialog form which allows you to change the configuration information associated with the selected item (see CONFIGURATION for a discussion of the fields in this form).
Move

Move the selected item to the bottom of the applications window. This operation provides a (rather awkward) way of rearranging the order of application items.
Copy

Copy the selected item to the bottom of the applications window.
Delete

Delete the selected item from the applications window.
 

RESOURCES

Various aspects of xfm can be configured by changing corresponding resource settings in the applications default file. Some important resources are listed below:
bitmapPath
pixmapPath

The path on which to search for bitmap and pixmap icons, respectively.
applicationDataFile
configFile
devFile

The names of the application and configuration files used by xfm (see CONFIGURATION). Normally, these will be hidden files in your home directory. You may wish to change this, e.g., if you want to provide a system-wide xfmrc file. (The applications file should always be kept in the user's home directory, such that each user can save his/her private application settings.)
autoSave

Enable or disable automatic saving of application files. When this feature is enabled (which it is by default), then xfm saves your application setup (if modified) whenever you switch to a new file (by means of the LOAD action, see CONFIGURATION), or when you terminate xfm.
doubleClickTime

Set the time interval in milliseconds for which a sequence of two mouse clicks should be interpreted as a double click. Default: 500.
updateInterval

Set the time interval in milliseconds in which to perform automatic folder updates. Default: 10000.
confirmXXX

Resources to request confirmation for various operations. XXX can be any one of Deletes, DeleteFolder, Copies, Moves, Overwrite and Quit. By default these are all enabled.
defaultEditor

The command with which xfm invokes your favourite editor.

There are way too many available resources to list them all in this manual page, so please take a look at the application defaults file for more information.  

CONFIGURATION

Besides the application resources, xfm can be configured by means of three different files, which are usually named xfmrc, xfmdev and xfm-apps, and are located in the ~/.xfm directory. These are plain ASCII files which can be edited using any text editor. (Note that the xfm-apps file is also written by xfm when invoking the corresponding menu command, and when the autosave feature is enabled.) Any line in these files which starts with a hash sign (#) is interpreted as a comment; empty lines are ignored.  

FILE TYPE CONFIGURATION

The xfmrc file specifies the types of ordinary (non-executable, non-directory) files which xfm should recognize. Each line has the following format:

        pattern:icon:push-action:drop-action

As indicated, the different fields are separated by a colon (use \: to escape the : character, and \\ to escape the backslash character itself). The meaning of these fields is explained below.

pattern
The filename pattern a file must match in order to belong to this type. There are three types of patterns: Literal patterns specify a literal filename such as ``core.'' Suffix patterns specify a suffix the filename must match, and are indicated by a leading asterisk, as in ``*.c.'' (All characters following the initial * are interpreted as literals; there is no expansion of embedded wildcards.) Finally, prefix patterns specify a prefix to be matched against the filename. They are denoted by a trailing asterisk, as in ``README*.''
icon
The name of the bitmap or pixmap file containing the icon to be displayed for this file type.
push-action
The command to be executed when the user double-clicks on a file of this type. This command is passed to the shell (via -c), together with the name of the selected file. The command is executed in the directory where the selected file is located. The filename is available in the command as the positional parameter number one, such that an action of the form xyz $1 invokes the command xyz on the selected file. There are also two special kinds of push actions built into xfm, EDIT which invokes the default editor on the selected file, and LOAD which loads the selected file as an applications file (discussed in Section APPLICATION FILES).
drop-action
Similar to the push action, this field denotes a command to be executed when a collection of selected files is dropped onto the file. The absolute target filename itself is available as positional parameter $1, the remaining arguments denote the names of the files dropped onto the target file. The command is executed in the directory which contains the selected files. No special built-in commands are available for this type of action.

If an action field is empty, the corresponding action defaults to ``do nothing.'' For instance, the following entry defines an icon and an EDIT push action for .c files:

        *.c:xfm_c.xpm:EDIT:

As another example, here is an entry for compressed (i.e. gzipped) tar files. The push action causes the archive to be extracted, while the drop action replaces the contents of the archive with the files which have been dragged onto the archive:

        *.tar.gz:xfm_taz.xpm:exec tar xfvz $1:exec tar cfvz $*

(Note the use of the shell's exec command. Since actions are invoked through the shell, it is often useful to replace the shell with the actual command which is to be executed, in order to conserve memory space on small systems.)

It is possible that different patterns given in the xfmrc file overlap. In this case xfm uses the first pattern which matches. Therefore you should always list the more specific patterns first. For instance, the following two entries specify what to do with compressed tar files (specific case) and other .gz files (default case):

        *.tar.gz:xfm_taz.xpm:exec tar xfvz $1:exec tar cfvz $*
        *.gz:xfm_z.xpm:exec gunzip $1:

Xfm also enables you to prompt for additional parameters before an action is executed. This is generally more useful with application entries than with file actions, and will therefore be described in the context of application configuration, see PARAMETER DIALOGS below.  

DEVICE CONFIGURATION

The device configuration file, xfmdev, lets you specify which mount points xfm should keep track of, and which actions to perform in order to mount and unmount the corresponding file systems. This allows you to access file systems on special devices such as floppies, CD-Roms, etc. in a transparent way. All you have to do is to enter a directory named in xfmdev (e.g. by opening a file window on it), and xfm will automatically perform the corresponding mount action for you. Likewise, if you leave such a directory, xfm invokes the corresponding unmount action. (CAUTION: You still have to take care that you unmount a file system, e.g. by closing every file window which has been opened on it, before you physically remove the corresponding medium.)

An entry of the xfmdev file has the following format:

        directory:mount-action:umount-action

The directory field denotes the mount point of the file system, mount-action the command to be executed in order to mount the file system, and umount-action the command for unmounting the file system. Here is a ``typical'' entry from my xfmdev file:

        /disk/a:mount -t msdos -o user /dev/fd0 /disk/a:umount /disk/a

Of course, the details of how to mount a floppy file system may vary from system to system, and you might have to take special actions if you want to use mount as an ordinary user. See mount(8) for details.  

APPLICATION FILES

Application files are used to specify the contents of the application window. Normally, these files are not altered with a text editor, but are written by xfm using the corresponding menu operation or the autosave feature. An understanding of the application data is necessary, however, if you want to edit an existing or create a new entry using the Install and Edit options of the applications menu. Each entry has the following form:

        name:directory:filename:icon:push-action:drop-action

The name and icon fields specify the name of the application and a corresponding icon which should be displayed in the application window. The push-action and drop-action fields have the same meaning as in the xfmrc file: they indicate the commands to be passed to the shell when the user double-clicks on the icon or drops files onto it, respectively. The directory and filename fields let you specify a file to be passed to the application. These fields are filled in by xfm when the user drags a file or directory onto the application window. Xfm also properly sets up the action fields when installing a file which has a matching entry in the xfmrc file.

As usual, the target file (if specified) and any dropped files are passed to the push and drop actions as the first and the remaining parameters, respectively, see FILE TYPE CONFIGURATION for details. The drop action is executed in the directory containing the selected files, while the push action starts in the directory specified by the directory field, if it is nonempty, and in the user's home directory otherwise.

In an application file, Xfm recognizes three special types of built-in push actions. The EDIT action, as in xfmrc, invokes the default editor. The OPEN action indicates that the target file actually is a directory onto which xfm should open a new file window when the user double-clicks on the corresponding icon. Finally, the LOAD action tells xfm that the target is an application file whose contents are to be loaded into the application window. This action allows you to manage different groups of applications. For instance, you might have an entry loading a ``toolbox'' applications file from xfm-apps which in turn contains an entry to reload the xfm-apps file. By these means, application groups can be organized in a tree-like fashion. Note that application files can also be loaded by a corresponding file type entry, since the LOAD action is also supported in the xfmrc file. (The OPEN action is not supported there, however, as it wouldn't make sense anyhow. Note that you can only specify file types for regular files.)

It is time for some examples. Here are three useful entries from my xfm-apps files which I use to start an xterm, my favourite editor, and print a file using lpr, respectively:

        Terminal:::xterm.xpm:exec xterm:
        Editor:::editor.xpm:exec emacs:exec emacs $*
        Printer:::printer.xpm::exec lpr $*

Xfm gives you great flexibility in configuring special types of actions. For instance, the following entries can be used to implement a simple trashcan feature and an action to open a window on a floppy disk:

        Trash::.trash:trash.xpm:OPEN:shift; mv $* ~/.trash
        A\::/disk:a:disk.xpm:OPEN:

It is also instructive to take a look at how xfm sets up the entries when you drag files or directories to the application window. Play around with these features. It is fun! Many things can be done, if not with a single command then maybe with a tiny shell script.  

PARAMETER DIALOGS

Xfm lets you prompt the user for additional parameters when a push or drop action is invoked. In such a case, a dialog form appears, with one field for each parameter, into which the user can enter the required arguments. Currently, no checking is done on the supplied parameters; in fact, the user can simply leave all fields empty. Parameters are specified in an action using the form

        %parameter-name%

where parameter-name is an arbitrary string not containing the % character, which will be displayed in the dialog form. (As usual, a literal % character can be escaped with the backslash.) Xfm replaces each such %...% construct with the corresponding value entered by the user.

For instance, here is an entry for the xfm-apps file which invokes grep to search a given collection of files for a regular expression the user is prompted for:

        grep:::grep.xpm::grep '%Regular expression\:%' $*

More than one parameter field may be specified. For instance:

        find:::find.xpm:find %Directory\:% %Find expression\:%:

 

CONSOLE OUTPUT

Programs started by xfm inherit their standard output and error streams from xfm. Therefore, if you start xfm from your session or window manager instead of an xterm, you should redirect xfm's standard output and error to something which you can read while xfm is running, if the window manager does not already do that for you. Usually, you will reassign both stdout and stderr to /dev/console, using the command:

        xfm >/dev/console 2>&1

Then you can read error messages and other output produced by launched applications in the console window on your desktop (such as xconsole, or xterm -C).  

ICONS

Xfm supports icons in both the X bitmap and Arnaud Le Hors' XPM format. A collection of useful icons is included in the distribution.  

FILES

~/.xfm
Standard location for xfm configuration files.
 

SEE ALSO

X(1), xconsole(1), xterm(1), mount(8), Arnaud Le Hors: XPM Manual. The X PixMap Format, Groupe Bull, 1993.  

CAVEATS AND BUGS

xfm catches the TERM signal to gracefully terminate the program, saving the current application file if the autosave feature is enabled, and unmounting all open file systems which have been mounted by xfm. However, some window and session managers may not send TERM signals to their client applications when terminating an X session. Therefore it might be necessary to explicitly quit xfm or manually save the applications file and close file windows before exiting X.  

COPYRIGHT

Copyright (c) 1990-1993 by Simon Marlow
Copyright (c) 1994 by Albert Graef  

AUTHORS

The original version of this program was written by Simon Marlow (simonm@dcs.glasgow.ac.uk) at the University of Glasgow. Albert Graef (ag@muwiinfa.geschichte.uni-mainz.de) at the University of Mainz is the author of the present version which contains many bug fixes and enhancements.


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
RUNNING XFM FOR THE FIRST TIME
USAGE
MENU COMMANDS
RESOURCES
CONFIGURATION
FILE TYPE CONFIGURATION
DEVICE CONFIGURATION
APPLICATION FILES
PARAMETER DIALOGS
CONSOLE OUTPUT
ICONS
FILES
SEE ALSO
CAVEATS AND BUGS
COPYRIGHT
AUTHORS

This document was created by man2html, using the manual pages.
Time: 01:02:59 GMT, May 19, 2025