MOXFM(1)

NAME
moxfm - Motif file and application manager

SYNOPSIS
moxfm [options ...]

DESCRIPTION
Moxfm is an OSF/Motif based file and application manager for Unix workstations running the X window system. Moxfm is quite similar to the Athena widgets based xfm filemanager, and it was developed using the source code of xfm. Moxfm uses configuration files with the same format as xfm (except the device configuration file, see CONFIGURATION). Moxfm - as xfm - allows you to browse your directory tree and to copy, move, link and delete files in an intuitive way by simple drag-and-drop actions. It provides context-sensitive popup menus. Directory displays are updated automatically in regular intervals when the contents of the directory changes. The integrated application manager provides a kind of ``shelf'' on which you can place your favorite 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. You can place files and applications as icons on the root window and use them both for starting applications, opening directory windows, and as drop sites. Application windows as well as the desktop icons can also be updated automatically whenever the corresponding application files change. Furthermore, moxfm provides a monitoring facility which allows to ``have an eye'' on important files and directories and respond with user-defined actions to certain types of events when the status of one of these files changes. Last not least, moxfm can automatically mount and unmount special devices like floppies as you open and close the corresponding directories (mount points) or copy files to them.

OPTIONS
Moxfm accepts all the usual toolkit options. Furthermore, the following options let you print moxfm's version number and control which windows are displayed at startup.

-version
    Print the version number and exit.

-appmgr
    Only display the application manager window and the desktop icons initially.

-filemgr
    Only display the file manager window initially.

-dir path
    Only display a file manager window of path.

-ignorestartup
    Ignore the (optional) startup file, which specifies which windows are opened at which locations at startup.

When both -appmgr and -filemgr are specified, the main application window and a file manager window of the home directory will be displayed, which is also the default when there is no startup file, or when the -ignorestartup option is given.

RUNNING MOXFM FOR THE FIRST TIME
The first time a user is running moxfm, the program will copy a number of configuration files into a directory, which is defined by the applicationCfgPath resource (usually ~/.moxfm), unless this directory already exists. These personal configuration files may be edited to customise moxfm and xfm to the user's taste. In addition, the user might want to copy the application defaults file Moxfm into his home directory and customize it.

USAGE
Most of it should be fairly obvious. There is an arbitrary number of application and file windows. Each file window shows the contents of one directory. In order to perform an action on a single file or directory, you can press the right mouse button over it to obtain a popup menu, or you press the middle mouse button on it and drag it to a second file window, a directory icon (e.g.) in the same file window, a button in an application window, or the background of an application window. If you want to copy the contents of an ASCII file into e.g. a Motif editor (such as nedit), you can drop the file over the editor window as well. You can also double-click on an item to start a corresponding action (like launching an application, editing a file, or changing directories). If you want to perform an action on multiple files/directories simultaneously, you can select multiple files with the left mouse key in combination with the Ctrl key. Then you can select an action from the pulldown file menu, or you can drag the files by pressing the middle mouse button in one of the selected items and moving the mouse. If you want to select a number of files in consecutive order, you can select the first file of the block with the left mouse key and then select the last file with the left mouse key in connection with the Shift key.

If you drop files and/or directories onto the background of a file window or onto a directory icon within a file or application window, the files/directories are moved to the corresponding directory. If you want to copy the items instead of moving them, you have to hold the Ctrl key pressed when releasing the middle mouse button. You can make links to the files/directories in a different directory by pressing the Ctrl Shift keys when releasing the middle mouse key over the corresponding directory.

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 for the type of the file in the xfmrc file (see CONFIGURATION below). Moxfm can determine the type of the file by reading the first 1 KB of its contents and comparing it with the "magic headers" of known file types (unless moxfm has been compiled without the -DMAGIC_HEADERS option), and/or by matching the file name with predefined patterns in the xfmrc file. On slow devices, such as floppies or CD-ROMs, reading the headers of all files in a directory can take unacceptably long time. Therefore moxfm can be told to use an alternative xfmrc-nomagic file without magic headers for those devices (see the description of the noMagicConfigFile resource below).

In the xfmrc file you can also specify drop actions for different file types, so when you drop files onto a file of one of these types the appropriate action is performed. Applications can be launched by dropping files on them. When you drop files onto a file for which there is no drop action defined, the files are copied, moved or linked to the directory of the file window. In file windows, valid drop sites are always highlighted when you drag files over them.

Directories can be displayed in two different forms: icon view (display directories and files as icons) and text view (similar to ls -l). These view types are selected from the Options menu, the default view type is given by the initialDisplayType resource.

There are several ways to change the directory displayed in a file window. You can directly edit the text field which displays the name of the shown directory and press the Enter key, or you can double-click on a directory icon. To go to your home directory you can also select the Go home item from the Directory menu or simply press the button with the symbol of a (typical swedish) house; to go to the parent directory you can select the Go up item from the Directory menu or press the button with the parent directory symbol. You can change into one of the current directory's ancestor directories by pressing the right mouse button over the directory text field and choosing a directory from the posted popup menu.

The other buttons in the file windows have the following meanings. When you press the button with the glasses symbol, the directory contents will be reread and redisplayed. Clicking on the button with two directory symbols on it opens a second window of the same directory. Pressing the button which shows the symbol of a window with colored icons will cause a new instance of the main application window to come up. When you click on the button with the green leftarrow, all your changes to the text field containing the directory name are discarded (unless you have already pressed the Enter key).

The application windows contain arbitrary numbers of buttons, for which a push and/or a drop action can be defined. You can change the actions and the icon of a button by pressing the right mouse button over it and selecting Edit from the popup menu. For the syntax of the push action and drop action fields, see FILE TYPE CONFIGURATION below. To create a new button, press the right mouse button over the background of the application window and select the Install application... item, or drag a file or directory from a file window to the background of the application window. In this case a new button is created, taking the push and drop actions for the type of the file as the push and drop actions for the button. Clicking on a directory button in an application window will start a file window showing the contents of the directory. You can also copy and move buttons between different application windows or within an application window by drag'n'drop with the middle mouse button. If the Ctrl key is pressed when releasing the middle mouse button, the button is copied, otherwise it is moved.

You can also drop other types of objects, such as text strings, on the application window. Users may define the object types which can be dropped on application windows in the targets configuration file (see below). For each object dropped onto an application window a button is created, which can be used as a drag source. The push action of the button is specified in the targets file.

There is one main application group, which is specified by the mainApplicationFile resource. An application window with this main menu is opened e.g. when you start moxfm using the -appmgr option. Each application window may contain buttons for further application groups. When you press such a button, the application window will show the buttons of that group instead. When you select the Open item from the popup menu of such a button, a new application window showing the selected application group is opened.

You can place files and applications as icons on the root window by choosing the Put on desktop item from their popup menus. For these desktop icons a push action and a drop action can be defined, as for application buttons. To invoke the push action of a desktop icon you have to double-click on it. To change the actions you can select Edit from the icon's popup menu.

MENU COMMANDS

FILE MENU

File manipulation operations.

New...
    Create a new (and empty) file.

Copy...
    Create a copy of a single item with a new name or copy selected items to another directory.

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

Link...
    Like Copy, but creates symbolic links rather than copying the selected items.

Perform action...
    You are prompted for an action to be performed on the selected items.

Delete
    Delete the selected items.

Select...
    Select items by pattern. The usual metacharacters are recognized (*, ?, [ ]). (Currently there is no provision for escaping these.)

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

Deselect all
    Deselect all items.

Edit config file
    The xfmrc configuration file is loaded into the default editor.

Edit monitor file
    The xfmmon file (see CONFIGURATION) is loaded into the default editor.

Reload configuration
    The xfmrc, xfmmon and magic configuration files are reread and all file and application windows are updated.

About moxfm...
    A message box with some information about moxfm (copying etc.) is popped up.

Close window
    Close the current file window

Exit.
    Terminate moxfm.

DIRECTORY MENU

Operations dealing with directories and the file window.

Make directory...
    Create a new directory.

Filesystem info...
    Show information on free space and filesystem parameters.

Reread files.
    Reread and redisplay directory contents.

Filter files...
    Only show files whose names match the given pattern. The usual metacharacters are recognized (*, ?, [ ]). (Currently there is no provision for escaping these.) This only affects normal files, i.e. directory items will not be filtered. The Clear button in the Filter dialog form reverts to the full display.

Go home
    Change to your home directory.

Go up
    Go to the parent directory.

Enter command...
    You are prompted for a command, which will be interpreted by your default shell in the directory of the file window.

WINDOWS MENU

Operations concerning windows.

New file window
    Open another window on the current directory.

New application window
    Open a window with the main application menu.

Mount table window
    Open a window which displays the configured mountable devices (if not yet present).

Raise desktop icons
    Raise the desktop icons to the top.

Start xterm
    Start an xterm from the current directory.

Save windows
    Save positions and states of all moxfm's windows to the startup file. The desktop icons are saved, too.

Save desktop icons
    The desktop icons and their positions are saved.

OPTIONS MENU

Options for the directory display.

Icon view
    Select the icons form display.

Text view
    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.

Show hidden files.
    Show hidden files (files starting with a dot).

Show directories
    Show directory items.

Directories first
    Show directories first in the window.

Use magic headers
    Determine the file types by reading the first 1 KB of each file and comparing them with the magic headers of known file types. Switch this off, if file type recognition is too slow. This requires that you have specified an alternative xfmrc-nomagic file (see noMagicCfgFile resource).

FILE POPUP MENU

Operations on a single file. This menu pops up when pressing the right mouse button on a directory or file icon. Not all of these operations are available for all filetypes.

Open
    Open a file window on the selected item. This option is only available if the selected item is a directory.

Execute
    Launch the selected application. You are prompted for command line parameters. This option is only available for executables.

Edit
    Edit the selected item using the program specified in the defaultEditor resource (only available if the selected item is not a directory).

View
    Same as Edit, but invokes a program for viewing the file (defaultViewer resource).

Perform action...
    You are prompted for an action to perform on the selected item.

Rename...
    Rename the selected item.

Copy...
    Copy the selected item.

Move...
    Same as rename, but the old name is not displayed in the dialog.

Link...
    Create a symbolic link to the selected item.

Delete
    Delete the selected item.

Properties...
    Display information about the selected item (file size, permissions and such). You can change permissions and ownership.

Put on desktop
    Place the selected item as an icon on the root window.

APPLICATION GROUP MENU

Operations for managing the application window. This menu pops up when pressing the right mouse button on the background of an application window.

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

New application group...
    Simplified install dialog form for creating a new application box and making it accessible from the current application menu (see APPLICATION FILES).

Save setup
    Save the configuration of the current application window.

Reload setup
    Reload the configuration of the current application window from the configuration file and discard all recent changes.

Edit setup file
    Open the configuration file of the current application window with the default editor.

Windows
    A cascade menu with items listed below is posted.

Close window
    Close the current application window.

Exit
    Terminate moxfm.

Windows Cascade Menu

Main appl window
    Open a new application window with the main apllication menu.

Open file window
    Open a file window displaying your home directory.

Mount table window
    Open a window which displays the configured mountable devices (if not yet present).

Raise desktop icons
    Raise the desktop icons to the top.

Save windows
    Save positions and states of all moxfm's windows to the startup file. The desktop icons are saved, too.

Save desktop icons
    The desktop icons and their positions are saved.

APPLICATION POPUP MENU

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

Open
    If the selected item represents an application menu, a new application window displaying this menu is opened. Otherwise, the default push action of the selected button is invoked.

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).

Delete
    Remove the selected button from the application window.

Put on desktop
    Place the selected item as an icon on the root window.

DESKTOP ICON POPUP MENU

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

Open
    If the selected icon represents an application menu, a new application window displaying this menu is opened. Otherwise, the default push action of the selected icon is invoked.

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

Save icon
    Save the position and state of the selected icon (only available if the autoSave resource is false, see RESOURCES).

Remove from desktop
    Remove the selected icon from the root window.

RESOURCES
Various aspects of moxfm can be configured by changing corresponding resource settings in the application defaults file. Some important resources are listed below:

bitmapPath

pixmapPath
    The path on which to search for bitmap and pixmap icons, respectively. Different directories are separated by a colon.

mainApplicationFile

configFile

noMagicConfigFile

startupFile

DTIconFile

devFile

userObjectFile

magicFile
    The names of the application and configuration files used by moxfm (see CONFIGURATION). Normally, these files will be located in ~/.moxfm. You may wish to change this, e.g., if you want to provide a system-wide xfmrc file. (The application files should always be kept in the user's home directory, such that each user can save his/her private application settings.) You may specify these pathnames as ~/path, but not as ~user/path.

applicationCfgPath
    The directory in which the application files for new application groups are located (see the Install group option of the application menu), usually ~/.moxfm.

tmpObjectDir
    This resource points to the directory where temporary object files are created. These files contain the data of user defined objects dropped on application windows and are deleted when the corresponding buttons are removed.

updateInterval
    Set the time interval in milliseconds in which to perform automatic folder (and application window) updates. Default: 10000.

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

firstIconPos
    Specifies the position of the first desktop icon. Notation: [+-]x[+-]y. The default is +0+0 (upper left corner of screen).

iconAlignment
    This resource determines the direction of the desktop icons' alignment relative to the first desktop icon. Allowed values are Up, Down, Left and Right. Down (which is the default) e.g. means that the second desktop icon is placed under the first, the third under the second, etc.

iconsOverrideRedirect
    Some mwm-incompatible window managers such as ol[v]wm and twm won't display desktop icons correctly (e.g., the window borders may not be completely removed). In this case you might want to set this resource to true, which makes the window manager ignore desktop icons. This might cause strange side effects, esp. when you are moving icons.

checkFiles
    Set this to true (default) if you want the time stamps of all files (except subdirectories) shown by the file windows to be checked on automatic folder updates. If set to false, only the timestamp of the directory itself is checked.

checkApplicationFiles
    Set this to true (default) if you want application windows to be updated automatically whenever the time stamp on the application file changes. (This option is ignored when the autoSave resource is set to false, see below.)

autoSave
    When you change the contents of an application group, or create, remove or change a desktop icon, moxfm will automatically save the changes to the configuration file, if this resource is set to true. Otherwise, you are asked if you want to save your changes when you close the application window or change the application group. Set this resource to true if you want to enable automatic updates of application files (see above).

saveOnExit
    If you want moxfm to change all window positions and contents automatically on exit (i.e., when you explicitly quit the program or it receives a TERM signal), set this resource to true.

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

newWinOnDirPopup
    You can select a new directory to be viewed from the popup menu of the directory text field. This resource determines, if you want the directory to be displayed in the current window (if false; default), or if you want to open a new file window showing the selected directory.

defaultEditor
    The command with which moxfm invokes your favorite editor.

defaultViewer
    The command with which moxfm invokes your favorite viewer.

xterm
    The command with wich moxfm starts an xterm.

BourneShells
    Moxfm calls other programs by executing your shell (as taken from the environment variable SHELL). Since Bourne compatible shells need one extra parameter, moxfm needs to know about the type of the shell. If this resource is not set (default), or is equal to the special string AUTO, a quick-and-dirty test is done at startup. This test will fail if the shell's initialisation files cause some output. If this happens, change these files, or set the BourneShells resource to a comma separated list of full path names of Bourne compatible shells. If your shell matches an entry in this list, moxfm will assume it is a Bourne shell.

suppressWarnings
    If this is set to true, both X Toolkit warnings (type: 'Action not found') and warnings about pixmaps which could not be found are suppressed. (Default: false)

showCopyInfo
    Normally there is a window informing you when moxfm is copying files. If you set this resource to false, this window is suppressed.

showOwner

showDate

showPermissions

showLength
    These resources determine which file information is displayed in text view mode.

startFromXterm
    If you set this to true, all applications are launched from xterms. (Default: false)

keepXterm
    This resource applies only if startFromXterm is set to true. If you set both resources to true, the xterms from wich the applications are launched are not closed, when the applications terminate. (Default: false)

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, moxfm can be configured by means of seven different files, which are usually named xfmrc, xfmrc-nomagic, Desktop, xfmmon, moxfmdev, targets and magic, and are located in the ~/.moxfm directory. Moreover, there is a number of so-called application files, from which moxfm determines the contents of the application windows, like the Main file which usually describes the contents of the main application group. All these files are plain ASCII files which can be edited using any text editor. (Note that application files also can be written by moxfm itself when you change the contents of an application group interactively; see the autoSave resource.) 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 (specified by the configFile resource) determines the types of ordinary (non-executable, non-directory) files which moxfm should recognize. Each file type associates a pattern with an icon and two different kinds of actions (commands to be executed on the file). If moxfm has been compiled with the MAGIC_HEADERS option it is possible to specify icons (but not actions) for directories and executables as well. 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
    This field allows you to specify which files belong to the type. File types can either be specified by a filename pattern, which refers to the name of a file, or a magic header, which refers to the contents of the file, or both.

    There are three types of filename 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*.''

    Magic headers are specified by a symbolic name given in the magic file, enclosed in angle brackets. Entries referring to a magic header cause the contents of the file to be checked against the magic numbers in the magic file. The format of these entries is described in Section MAGIC HEADERS below.

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 three special kinds of push actions built into moxfm, EDIT and VIEW which invoke the default editor and default viewer on the selected file, respectively, and LOAD which loads the selected file as an application file and opens a new application window (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 tar files. The push action causes the contents of the archive to be shown by the xless browser, while the drop adds the files which have been dragged onto the tar-file to the archive and pipes the output of tar to xless.

*.tar.gz:xfm_taz.xpm:exec tar tfvz $1 | xless:exec tar
    rfvz $* | xless

(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 moxfm 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 tfvz $1 | xless:exec tar
    rfvz $* | xless
*.gz:xfm_z.xpm:exec gunzip -c $1 | xless:

Moxfm 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.

The xfmrc-nomagic file (specified by the noMagicConfigFile resource) is an alternative file type configuration file which must not use magic headers. Using this file instead of the standard xfmrc file for slow devices such as floppies or CD-ROMs can increase performance. See DEVICE CONFIGURATION below.

MAGIC HEADERS
When compiled with the MAGIC_HEADERS option, moxfm can determine file types using the magic numbers contained in the files.

The magic numbers are described in a configuration file whose path is obtained from the magicFile resource. The format of the file is the same as that of the magic(5) file, with some extensions like regular expression matching. (See xfmtype(1).)

There are five built-in types which are used if all the patterns in the magic file fail:

unreadable
    Read failed.

empty
    File size is zero.

special
    Not a regular file.

ascii
    Could be read and looks like ASCII.

data
    Could be read but all tests failed and doesn't look like ASCII.

To specify a magic file type you include it between angle brackets at the beginning of the pattern field:

<GIF>:xfm_gif.xpm:exec xpaint $1:

or combined with a filename pattern:

<ascii>*.cc:xfm_cc.xpm:EDIT:

In the latter case, the file must meet both conditions, i.e. be an ASCII file and have a .cc suffix.

To include angle brackets in the type or the pattern you must escape them using backslashes.

If moxfm is compiled with the MAGIC_HEADERS option, it is also possible to specify custom icons for directories and executables. For this purpose, the magic file distributed with moxfm provides magic file types named <DIR>, <EXEC>, etc. For instance, here is an entry which specifies a special icon for hidden directories:

<DIR>.*:hidden_dir.xpm::

In the same way you can also override the built-in icons for displaying arbitrary directories and executables:

<DIR>..:parent_dir.xpm::
<DIR>:plain_dir.xpm::
<DIR LNK>:link_dir.xpm::

DEVICE CONFIGURATION
The device configuration file, moxfmdev, lets you specify which mount points moxfm should keep track of, and which actions to perform in order to mount and unmount the corresponding file systems. Caution: The format of this file is different from xfm's xfmdev file! When you have a properly configured moxfmdev file, you can 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 moxfmdev - i.e. a mount point - (e.g. by opening a file window on it or by copying files to it), and moxfm will automatically perform the corresponding mount action for you. Likewise, if you leave such a directory (or the file copy operation is finished, respectively), moxfm 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.) When you have configured directories as mount points in moxfmdev, a mount table window is shown, which informs you about the current state of the corresponding devices. You can also manually mount devices by pressing the mount button in the mount table window, but then moxfm will not automatically unmount them when they are no longer needed and you have to take care of pressing the unmount button in the mount table window.

An entry of the moxfmdev file has the following format:

label:special-device:mount-point:mount-action:
    umount-action:slow-device

The label field specifies the label of the device shown in the mount table window. Special-device denotes the special device (e.g. /dev/fd0) to be mounted on the mount-point. Mount-action defines the command to be executed in order to mount the file system, and umount-action the command for unmounting the file system. It is important that the /etc/mtab (or, on HP-UX machines, the /etc/mnttab) file is properly updated by the mount-action and the umount-action in order for the Update display button of the mount table window to work properly! On Linux systems, you can use the usermount and userumount programs distributed with moxfm (see usermount(1)). slow-device can either be a zero-length string or the word SLOW. In the last case, the device is considered slow, which means that the xfmrc-nomagic configuration file is used in stead of xfmrc for file windows showing directories on this device.

Here is a ``typical'' entry from my moxfmdev file:

Floppy:/dev/fd0:/floppy:usermount /dev/fd0:userumount
    /dev/fd0:SLOW

Of course, the details of how to mount a floppy file system may vary from system to system, so if you want to use the usermount program on a non-Linux system, you will have to change the arguments of the mount and umount system calls accordingly. The programs used to mount and unmount filesystems have to be suid root if you want ordinary users to be able to mount or unmount filesystems (caution!).

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 updated by moxfm whenever the contents of the application window changes (see autoSave resource). An understanding of the application data is necessary, however, if you want to edit an existing or create a new entry using the Install application or Edit options of the application menus. 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 clicks on the button 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 moxfm when the user drags a file or directory onto the application window. Moxfm 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 push and drop actions are executed in the directory specified by the directory field, if it is nonempty. Otherwise, the push action is started from the user's home directory, and the drop action in the directory of the dropped files.

In an application file, moxfm recognizes four special types of built-in push actions. The EDIT and VIEW actions, as in xfmrc, invoke the default editor and viewer, respectively. The OPEN action indicates that the target file actually is a directory onto which moxfm should open a new file window when the user presses the corresponding button. Finally, the LOAD action tells moxfm that the target is an application file whose contents are to be loaded into the application window. This action allows you to change between different groups of applications. In addition, moxfm has the special built-in drop action COPY (xfm does not support this). It can be specified for directory targets and means that the dropped files are moved, copied or linked (depending on the key which eventually is held down while releasing the middle mouse button, see above) into the directory.

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

Terminal:::xterm.xpm:exec xterm:exec xterm -e $1
Editor:::editor.xpm:exec emacs:exec emacs $*
Printer:::printer.xpm:exec lpq | xless:exec lpr $*

Moxfm 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:mactrash.xpm:OPEN:shift;mv -f -b -V numbered $*
    ~/.trash
Floppy:/:floppy:disk.xpm:OPEN:COPY

A typical entry for an application group looks as follows:

Toolbox:~/.moxfm:Toolbox:apps.xpm:LOAD:

It is also instructive to take a look at how moxfm 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.

DESKTOP ICON CONFIGURATION
The Desktop file, specified by the DTIconFile resource, is a special application configuration file. It determines the properties and positions of all desktop icons managed by moxfm. The entries have the following form:

name:directory:filename:icon:push-action:drop-action:
    x-pos:y-pos

The first six fields are identical to those of the ordinary application configuration files, the last to fields determine the position of the icon on the screen (x and y coordinate of the icon's upper left corner, respectively). The Desktop file is written when you select the Save desktop icons or the Save windows actions.

PARAMETER DIALOGS
Moxfm 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.) Moxfm replaces each such %...% construct with the corresponding value entered by the user. For instance, here is an entry which allows you to print files on different printers:

Printer:::printer.xpm:exec lpq -P%Printer:--deskjet% |
    xless:exec lpr -P%Printer:--deskjet% -#%Number of
    copies:--1% $*

As the drop action in the example indicates, it is possible to specify more than one parameter field, and a default value for a parameter is specified using the notation

%parameter-name--default-value%

USER DEFINED OBJECTS
You can drop objects such as e.g. text strings, pixmaps, etc. on application windows and this way create buttons representing the dropped objects. For each dropped object a file is created, which is deleted as soon as the corresponding button is removed. The types of objects accepted for drop actions are determined by the targets file (specified by the userObjectFile resource). The form of each entry in this file is as follows:

target:push-action:button-title:button-icon:drag-icon

The target field gives the name of the drop atom. Some target names, such as STRING and PIXMAP, are defined by the ICCCM protocol. By default, application windows support ICCCM's FILE_NAME target as well as moxfm's own FILE_LIST and APPLICATION targets, so these should not be included in the targets file.

The push-action field specifies the action invoked when a button representing a user-defined object is pressed. The EDIT action (see APPLICATION FILES) might be appropriate for a variety of drop targets, including the STRING target. The argument of the push action is the temporary file containing the dropped data. The button-title resource determines the label of the created button. If you specify CONTENTS as button-title the first 10 bytes of the dropped data are used as the button title (should be avoided for non-textual data). The button-icon and drag-icon fields define the pixmaps used for the application button's icon and the drag icon, respectively.

MONITORING
Moxfm provides a monitoring facility which allows to keep track of the status of certain files and directories and invoke user-defined actions in response to different types of changes. The actions are first considered when moxfm starts up and then later during the regular updates of file and application windows. The relevant files and directories and the corresponding actions are specified in the xfmmon file. Each entry in this file has the following format:

filename:event:type:action

The different fields in an entry have the following meaning:

filename
    Absolute path to the file or directory to be checked (as usual, ~ expands to the user's home directory; the string MAILPATH is expanded to the user's mailfile, typically $MAILPATH or /var/spool/mail/$USER).

event
    Specifies the event to check for. The possible values for this field are: DELETE, CREATE (file has been deleted/created); EMPTY, NONEMPTY (file exists and has become empty/nonempty; directories are considered empty when they do not have any entries distinct from . and ..); and EQ, NE, LT, LE, GT, GE (compare file sizes of the new and the old version of the file). If this field is left empty then the action applies to any change in status.

type
    Specifies the type of action. Recognized values are STARTUP (the action is only invoked at startup time) and UPDATE (the action is only invoked during regular updates). If omitted, the action applies both at startup and during updates.

action
    The action to invoke when the specified event takes place. The same actions EDIT, VIEW, OPEN and LOAD as in push actions are recognized; any other value is interpreted as a shell command to be executed.

During initialization time there is no previous state to compare with (the current status is not saved when moxfm exits), thus STARTUP actions can only respond to EMPTY and NONEMPTY events. STARTUP actions with an empty event field are a means to unconditionally execute a command when moxfm initializes.

If there are several applicable actions they are executed in the indicated order. Shell command actions are invoked synchronously (in contrast to applications executed using push or drop actions). This ensures that the executed actions take effect before file and application windows are first displayed or updated.

For instance, here are two entries from the sample xfmmon file distributed with moxfm. The entries implement a sensitive trashcan icon on the desktop. It is checked whether the trash directory has become empty or nonempty and the corresponding desktop icon is changed accordingly. (This will only work if the checkApplicationFiles resource is set to true, see RESOURCES above.)

~/.trash:EMPTY::sed -e "s/mactrash_full.xpm/mactrash.xpm/"
    ~/.moxfm/Desktop > ~/.moxfm/Desktop.new; mv
    ~/.moxfm/Desktop.new ~/.moxfm/Desktop
~/.trash:NONEMPTY::sed -e "s/mactrash.xpm/mactrash_full.xpm/"
    ~/.moxfm/Desktop > ~/.moxfm/Desktop.new; mv
    ~/.moxfm/Desktop.new ~/.moxfm/Desktop

CONSOLE OUTPUT
Programs started by moxfm inherit their standard output and error streams from moxfm. Therefore, if you start moxfm from your session or window manager instead of an xterm, you should redirect moxfm's standard output and error to something which you can read while moxfm 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:

moxfm >/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
Moxfm supports icons in both the X bitmap and Arnaud Le Hors' XPM format. A collection of useful icons is included in the distribution.

FILES

~/.moxfm
    Standard location for moxfm configuration and application files (see CONFIGURATION above).

SEE ALSO
magic(5), mount(8), usermount(1), X(1), xconsole(1), xfm(1), xfmtype(1), xterm(1), Arnaud Le Hors: XPM Manual. The X PixMap Format, Groupe Bull, 1993.

CAVEATS AND BUGS
Moxfm catches the TERM signal to gracefully terminate the program, unmounting all open file systems which have been mounted by moxfm. 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 moxfm or manually close file windows mounted by moxfm before exiting X.

Do not specify a relative path in the directory field of an application item, because when you execute a push action on the application the current directory might not always be what you expect. This will probably be fixed in a future release. ;-)

Moxfm depends on your shell - see resource BourneShells.

COPYRIGHT
Copyright (c) 1990-1993 by Simon Marlow
Copyright (c) 1994-1996 by Albert Graef
Copyright (c) 1995-1996 by Oliver Mai

AUTHORS
The xfm program was originally 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 xfm-1.3.x, which contains many bug fixes and enhancements. Other people have contributed additional features: Dave Safford (dave.safford@edu.tamu.sc; automatic folder updates); Robert Vogelgesang (vogelges@rhrk.uni-kl.de; shell detection code); Juan D. Martin (juando@cnm.us.es; magic headers); Kevin Rodgers (rodgers@lvs-emh.lvs.loral.com; Filter option); Scott Heavner (sdh@falstaff.MAE.cwru.edu; View option); Brian King (ender@ee.WPI.EDU; default values in parameter dialogs).

Moxfm was developed by Oliver Mai (mai@sugra.desy.de) at the university of Hamburg, using source code and general ideas of xfm-1.3.2. The code for the automatic update of application windows and the monitoring function was contributed by Albert Graef.