Chapter 2: Using xwatch

You typically start xwatch when activating an X session; e.g., from the file which xdm uses to fire up a user's session (this file is normally /usr/X11/lib/X11/xdm/Xsession). The command that starts xwatch is something like

xwatch [options] files &

where `options' are optional flags, files are the files to watch, and the ampersand character is used to start xwatch in the background. The files to watch are typically in the directory /var/adm/: files which are created by the syslog daemon (see the file syslogd.conf.SAMPLE in the distribution for an example). XWatch accepts only filenames which are:

Other files as stated on the commandline are not monitored. When any `non-proper' file is given on the commandline, xwatch warns about the file not being acceptable and deletes it from its list of names.

2.1: Options to the xwatch program

The options are many, start xwatch without arguments to see what is supported. All options can also be stated in the file /usr/lib/X11/app-defaults/XWatch as X resources (see the file XWatch.ap as an example). In the following enumeration, a nr denotes a number:

Debian Maintainer's note: Applications defaults are stored in /etc/X11/app-defaults/XWatch . System adminitrators who want to customize xwatch globally may also create a file /etc/X11/Xresources/xwatch for these configurations by prefixing the entries with Xwatch (see /usr/share/doc/xwatch/README.Debian for an example). Individual users can make the same types of changes in their ~/.Xdefaults or ~/.Xresources files.

Before you extensively use the options, create an application defaults file /usr/lib/X11/app-defaults/XWatch. You can do so by copying the file XWatch.ap, extracted from the archive, to /usr/lib/X11/app-defaults/XWatch. The comments in the distributed application defaults file explain what you can configure and show examples.

Some systems do not have the directory /usr/lib/X11/app-defaults. In that case, you should create the following links:

Then edit the file XWatch in the application defaults directory, and follow the instructions therein to define your favorite settings. If you need to start xwatch incidentally with another setting, use a flag.

2.2: File arguments

The filename arguments can optionally be followed by a color specification that applies only to that particular file. E.g., say you want to see all the files in /var/adm normally in blue text; but you want to see /var/adm/critical (critical messages from applications) in yellow and /var/adm/auth (authentification messages) in red. In that case, the course to follow would be:

Such a commandline would cause xwatch to complain about the multiple presence of /var/adm/critical (once from the separate argument, and once from the wildcard argument) and similarly about /var/adm/auth. If this bothers you, turn off the initial warnings (e.g., using -firstwarnings 0 or in the application defaults file).

Note that besides the color specifications for filenames, you can also specify coloring for lines that match a given string in all files. See the above description of the switch -colorstring for more information.