xzap - X Process Zapper
xzap [ -toolkitoption ...] [ -xzapoption ...] [ ps options ]
Xzap accepts all of the standard X Toolkit command line
options (see X(1)), plus several xzap specific options (see
RESOURCES section below). The [ ps options ] are those
accepted by the ps(1) command, these must come after any
Xzap provides an easy way to to send signals to Unix
processes, typically, but not necessarily, to kill them. It
was inspired by the zap command described in Kernighan &
Pike's "The Unix Programming Environment".
Xzap provides a window consisting of two areas:
Commands Section A set of command buttons that allow
you to exit, zap selected
processes, pop up an options menu,
pop up a help window, clear
(deselect) processes, invoke a ps
Ps Output Window Displays the output from the ps
command within a multilist widget
and allows processes to be selected
with mouse button 1 ready for
zapping with the zap command.
Clicking with button 1 on an
already selected process deselects
it. Clicking with button 3
"extends" the "closest" selection.
quit Quits xzap.
zap Represented by a bitmap, often the "skull and
crossbones". zap delivers a signal to processes
selected in the "Ps Output Window". By default this
is the TERM (terminate, 15) signal but it may be
changed by use of the options menu. The terminate
signal will kill processes that do not catch the
signal but sending KILL is a sure kill, as the KILL
(9) signal cannot be caught.
A successfully delivered signal is indicated by the
appropriate line of ps output becoming insensitive.
(This does not necessarily mean the process has been
killed, you must reinvoke ps to confirm this).
help Pops up a help window.
clear Deselects all selected processes in the "Ps Output
ps Invokes a ps(1) command whose arguments are the
contents of the neighbouring text widget
By default, accelerators are defined such that:
typing a <return> in the psoptions text widget cause the ps
command to be invoked,
typing anywhere causes characters to be entered into the
psoptions text widget (so typing <return> anywhere causes
the ps command to be invoked too),
hitting mouse button 2 in the "Ps Output Window" causes
"zap" to be invoked, but only if the zapAccelerator
application resource is set.
xzap has the following application specific resources:
command (Class Command)
An alternative command to run instead of ps.
defaultSignal (Class DefaultSignal)
Initial setting of the signal menu, hence the
default signal sent when a process is zapped
(default 15 i.e SIGTERM).
pidColumn (Class PidColumn)
A string defining the column contain the process ids
(default " PID").
psOnDeiconify (Class PsOnDeiconify)
Causes a ps to be executed automatically when xzap
is deiconifed, useful in conjuction with the
standard toolkit resource iconic, (default false).
psOptionsList (Class PsOptionsList)
Determines the content of the second section of the
options menu. Each line resource represents two
strings separated by :. The first string of a pair
is copied into the psoptions text widget when the
menu item named by the second string is selected
from the options menu.
scrollHeight (Class ScrollHeight)
Xzap resizes its main window to display the output
of each ps command up to a height specified by the
scrollHeight resource, at which point it adds a
scrollbar. Manual resizing has the effect of
changing this resource (default 300).
rootCursor (Class RootCursor)
Changes the cursor to indicate running as root
(default "pirate") (on pre-X11R5 systems you will
always get "pirate" if this resource is set).
rootTitleSuffix (Class RootTitleSuffix)
Appends to the title to indicate running as root
(default " (root)"))
rootIconNameSuffix (Class RootIconNameSuffix)
Appends to the icon name to indicate running as root
(default " (root)" )
signalList (Class SignalList)
An arbitary number of lines of the form
number:bitmap:name. These determine the content of
the first section of the options menu. Each number
should represent a valid signal, xzap does not check
this. The bitmap is used to change the appearance of
the "zap" command button when a new signal is
chosen, and the name is that displayed in the menu.
The name may contain any characters except : (and
zapAccelerator (Class ZapAccelerator)
Installs an accelerator for the "zap" command button
in the "Ps Output Window", normally mouse button 2
These resources can all be specified as command line
eg. to use sps instead of ps invoke xzap as:
xzap -command sps -pidColumn Proc#
A personal xzap resource file, called Xzap and normally in
your home directory, might contain the following to cater
for both ps and sps:
aux|sort -r -n +4 -5:sort all on size
When invoked as xsps the sps relevant resources apply. This
may be achieved via the -name toolkit option i.e. xzap -name
In order to specify further resources, it is useful to know
the hierarchy of the widgets which compose xzap. In the
notation below, indentation indicates hierarchical
structure. The widget class name is given first, followed
by the widget instance name.
would cause xzap to start up by executing "ps aux".
would force the use of the pirate cursor (but note the
cursorName resource does not exist pre X11R5).
DISPLAY to get the default host and display number.
to get the name of a resource file that overrides
the global resources stored in the RESOURCE_MANAGER
/usr/lib/X11/app-defaults/Xzap - specifies required
ps(1), X(1), xrdb(1), Athena Widget Set, FWF widget set
Ps output is limited to 500 lines.
Can't figure out whether output is really from a ps.
Can deadlock if data produced on stderr not small.
Copyright 1993, The Computing Laboratory, University of
Newcastle Upon Tyne
Gerry Tomlinson (firstname.lastname@example.org)
Thanks to Brian Totty <email@example.com> for the Multilist
widget from the Free Widget Foundation widget set.