XBROWSER

Section: User Commands (1)
Updated: 25 October 1988
Index Return to Main Contents
 

NAME

xbrowser - simple directory and file browser for X  

SYNTAX

xbrowser [ -toolkitoption ...] [ directory ]  

OPTIONS

Xbrowser accepts all of the standard X Toolkit command line options, (such as geometry, etc.) plus:
directory
Specifies the startup directory for subsequent searches within xbrowser. If no directory is specified, the current working directory is chosen as the startup directory.
 

DESCRIPTION

Xbrowser provides a graphical interface to browse directories, select files from directory listings and invoke commands on them, such as invoking the editor on these files, search files for specified patterns, move, copy or delete files. The application provides a window consisting of the following areas:
Commands Menu
Specifies commands for browsing directories and invoking the editor on selected files (possible commands are Quit, List, Edit, Parent, Shell, Copy, Move, Delete).
File Pattern Box
Defines the file name pattern for searching directories. It accepts the same notation as ls (except for environment variables which are currently not supported). The characters *, $ and ~ are expanded as defined by C-Shell. The current working directory and the pattern defined by the File Pattern Box are combined to define the search directory and the search pattern for files. For example, "net/src/*.c" searches in the directory "<current directory>/net/src" for all files whose name end with ".c". After each search the file pattern box is updated: only the file pattern is displayed, the directory portion is extracted. The search directory becomes the current working directory of xbrowser.
Directory Label
Displays the current working directory of xbrowser. If the file pattern does not specify an absolute path name, the current directory is prepended to define the search directory.
Message Window
Displays xbrowser messages, such as error messages or messages returned by shell programs which were invoked via the Shell command.
File Window
Displays a list of files which are members of the current directory used by xbrowser. The files listed in this window depend on the pattern defined by the File Pattern Box. Each line of the File Window displays the characteristics of one file (the window does not use word wrap; the toolkit should display a horizontal scrollbar for the text widget but the current version does not implement it correctly).

The meaning of the characteristics is exactly the same as for the ls command. xbrowser displays the file type, the access rights, the number of links, the owner, the file size in bytes, the last modification date and the file name. This window allows the user only to select one or several lines; individual characters cannot be selected.

A single click of the left mouse button selects one line. The selection of files may be extended by using the right mouse button. The selected files can be de-selected by hitting a character generating key (no modifier keys) of the keyboard or by clicking the middle button of the mouse. A double click on a line is a shortcut for selecting a file and invoking explicitly the commands List or View/Edit. If the double-clicked file is a directory the List command is executed; otherwise the command View/Edit is executed (if the resource ViewEdit is set to "true" xbrowser invokes the desired editor rather than xmore).

Search Commands
Lists the commands to search text files for specified patterns (possible commands are Edit and Grep).
Grep Window
Displays lines of text files which match the current search pattern. Each line consists of the file name, followed by a colon and a space, followed by the matching line (restricted to 256 characters). This window allows the user only to select one or several lines; individual characters cannot be selected.

A double click on a line is a shortcut for selecting a file and invoking explicitly the command View/Edit (if the resource ViewEdit is set to "true" xbrowser invokes the desired editor rather than xmore).

 

COMMANDS

Quit
Exits xbrowser. Windows created via the Edit or Shell command buttons ( xterm windows) are not deleted. However, all dialog boxes and dialog windows are destroyed.
List
Searches directories to list all files which match the pattern defined in the File Pattern Box. If a directory is selected in the File Window, it is assumed to be the current search directory. If the file selected in the File Window is not a directory, an error message is returned. If no file is selected or the selected file is not a directory, xbrowser combines the current working directory with the string specified in the File Pattern Box to determine the current search directory and file pattern. After the List command is performed successfully, the current directory of xbrowser is updated (see Directory Label).

Pressing the left mouse button sorts the files in the ascending order of the current sorting option (e.g. starting from A to z in case of file names). If the middle button is pressed xbrowser applies the current sorting option, but in reverse order. If the right button is pressed, an option menu is displayed for choosing the current sorting option, the option to display owner or group associated with the file, and the option to print files starting with a dot or not. The files may be sorted by file name, file size or date (in ascending or descending order depending if the left or the middle button is pressed). If an option is selected it is displayed in reverse video.

View/Edit
Invokes the viewer or the editor on the file selected in the File Window. Only one file may be selected at a time. Clicking the left mouse button runs the xmore application and loads the selected file. The file cannot be edited. Clicking the middle mouse button invokes the preferred editor on the selected file. This commands checks the environment variable XEDITOR to determine the preferred editor. If the environment variable is not set, xedit is invoked.

For each viewer or editor instance a new process and a new X window is created. If the favourite text editor is vi the environment variable XEDITOR must be set to "xterm -e vi" (which assures the creation of a new X window). The cursor is always positioned at the beginning of the file.

The Search Commands also include an View/Edit command (left button for viewer; middle button for editor). It works on selections in the Grep Window rather than selections in the File Window. If the preferred viewer/editor supports line number selection from the command line, such as jhsxedit, emacs or vi, then the cursor of the viewer/editor is positioned at that line of the file which corresponds to the grep match displayed in the grep window. Otherwise the cursor is positioned at the beginning of the file. xmore and xedit do not support line positioning.

For both View/Edit commands the created windows are not deleted when the user quits xbrowser. The user must close all windows separately.

Parent
Clears the File and Grep Window, and changes the current directory of xbrowser to the parent of the current directory. If the left mouse button is pressed, the current file pattern is applied to list the files of the new current directory using the last sorting option. If the middle button is pressed, the new current directory is not listed. Pressing the right mouse button performs no action; the current directory stays unchanged.
Shell
Provides the option to execute shell programs or to create new xterm windows.

If the left mouse button is pressed, xbrowser displayes a dialog box in which the user may type a shell command (note the execution uses sh rather then csh; certain special characters, such as ~ are not valid for sh). If the user selected one or several files in the File Window, their names are displayed in the dialog box. The dialog window also displays 2 options: Return Ouput and Return Diagnostics. In the first case the standard output generated by the shell command is displayed in the Message window (if the information consists only of a few lines) or in a separate popup window; in the second case the standard error information is returned to the user. Both buttons are toggles and the user may enable/disable them. If an option is selected, it is displayed in reverse video. If the user disables both options, messages are displayed in the xterm startup window. The user must quit the popup window, before he/she may invoke new commands in xbrowser.

If the middle button is pressed a new xterm window is created inheriting the current working directory of xbrowser. If the user quits xbrowser, xterm windows are not deleted. They must be closed separately.

Copy
Copies files selected in the File Window. The user is prompted in a dialog box to specify the target file or target directory. The File Window is updated.
Move
Moves files selected in the File Window. The user is prompted in a dialog box to specify the target file or target directory. The File Window is updated.
Delete
Deletes files selected in the File Window. For each file the user is prompted in a dialog box, if he/she wants to delete this file (yes button) or skip this file (no button) or cancel the delete operation (cancel button). If the user selects the cancel button during the interaction, the Delete command is aborted and no file is deleted (even if the user answered yes to previous prompts). The actual deletion occurs after the user answered all prompts with yes or no.
Grep
Searches files to find lines which match the pattern defined in the string box after the Grep command. The files searched is determined by the pattern in the File Pattern Box, the files selected in the File Window and selections in the dialog box associated with Grep (the dialog box is invoked by pressing the right mouse button; see below). All files selected in the File Window which satisfy the file pattern in the File Pattern Box are searched. If no file is selected in the File Window, all files which satisfy the file pattern are searched. The search pattern for Grep is a regular expression as defined by the grep shell command. xbrowser attempts to determine the file type (executable, text, etc). Only text files are searched. This allows the user to extend the file selection across non-text files (e.g., select all .c and .o files in a directory; but .o files are not searched).

Clicking the left mouse button continues until all files which match the file pattern are searched. Clicking the middle button stops searching at the first file which contains a match for the string to be searched.

Clicking the right button displays a dialog window which allows the user to specify the search behavior in case Grep encounters a directory. The user may skip all directories (this is the default) that means only files selected in the File Window are searched. The user may select the option "search next-level directory" which specifies that all directories which are selected in the File Window are searched, i.e. files in these directories whose file names satisfy the pattern in the File Pattern Box. The last option allows the user to recursively search all directories which are encountered. Grep for this option may take a long time (depending on the size of the underlying directory structure). The file pattern in the File Pattern Box is only interpreted for the files which are actually searched for the string pattern. It is not a selection criteria for directory names.

The dialog window for Grep also supports a toggle for case-sensitive or case insensitive search. The default setting is case-sensitive.

 

X DEFAULTS

xbrowser supports the following resource which may be set in the .Xdefaults file:
ViewEdit
specifies the tool to be invoked after the user double-clicks a text file of the File Window or the Grep Window. If the resource is set to "false" xbrowser invokes xmore on the double-clicked file (the default setting of ViewEdit is false). Otherwise xbrowser invokes the user desired editor on the double-clicked file.
 

FILES

~/.XtActions, ~/.Xdefaults
/usr/lib/X11/.XtActions  

SEE ALSO

X(1), xedit(1), ls(1), grep(1), sh(1), csh(1), jhsxedit(1);  

BUGS

Beware of using the geometry resource in your .Xdefaults file for xbrowser. The toolkit obviously interprets these values not only for the toplevel windows but also for the popup windows (dialog boxes). I tried to overwrite the values, but it does not work consistently. If you specify a geometry resource for xbrowser in your .Xdefaults file, the dialog boxes will have initially these geometry sizes (you might have very strange shaped command buttons). Geometry values specified on the command line which called xbrowser do not affect the dialog box geometry.

If you use the window manager twm, your .twmrc must set NoTitleFocus otherwise the dialog boxes and the text windows do not work correctly. There is a bug in twm.  

RESTRICTIONS

 

COPYRIGHT

Copyright 1988, Xerox Corporation.  

AUTHOR

Hans Schlichter, Xerox Corporation.


 

Index

NAME
SYNTAX
OPTIONS
DESCRIPTION
COMMANDS
X DEFAULTS
FILES
SEE ALSO
BUGS
RESTRICTIONS
COPYRIGHT
AUTHOR

This document was created by man2html, using the manual pages.
Time: 06:01:47 GMT, December 12, 2024