xtoolwait - start X client and wait for it to map a window
[ -display display-name
] [ -timeout nseconds
] [ -pid ] [ -help ] [ -version ] command
notably decreases the startup time of an X session by reducing
the load on the X server and the OS. Xtoolwait
starts the X client
in the background. It then waits until a window is mapped on
the root window and exits. Xtoolwait
also exits if a time-out occurs
(by default after 15 seconds), or if command
- -display display-name
- Monitor the X display display-name for window mapping events. If
this option is not used, the X display defaults to the value of the
DISPLAY environment variable. See also section NOTES
- -timeout nseconds
- Use a time-out period of nseconds seconds. If this option is not
used, the time-out period defaults to 15 seconds.
- -mappings nwindows
- Exit after nwindows windows have been mapped, instead of the
default of one window. Use this option only if you are absolutely sure
that command will map nwindows top-level windows, in which
case it will slightly increase the performance.
- Print the process id (pid) of command to standard output. This
option is useful for shell scripts that want to wait for (or send a signal
to) command. To support shell command substitution (`command`),
Xtoolwait redirects the standard output of command to
- Print out the `Usage:' command syntax summary.
- Print out the version number.
This is the relevant part of my own .xinitrc file, showing the proper use of
# Startup the window manager first
olvwm & wmpid=$!
# Restore desktop settings
# Do _not_ put xtoolwait in the background
xtoolwait -mappings 2 contool -Wp 30 30 -Ws 575 246 -WP 3 533 -Wi
xtoolwait xeyes -geom 77x60+640+107
xtoolwait ansi_xterm -geom 80x24+22+11
xtoolwait clock -Wp 90 90 -Ws 150 150 -WP 733 110 -Wi
# Wait for the window manager
Note that the window manager must be started first. Xtoolwait
it to detect window mappings. The first instance of Xtoolwait
until both the window manager and the X client have finished their
Note also that the first Xtoolwait
uses the -mappings
detect the virtual desktop window, which is mapped by virtual window managers.
Omit this option if you use a non-virtual window manager.
returns 0 if it detected the mapping of a window on the root
window, and 1 otherwise. The one exception to this rule is when command
exits normally before mapping a window, in which case its return value is
- The default display name to monitor
does not propagate the -display
. If you use this option, you should feed it both to
and to command
. This is intentional, so don't report
this as a bug.
was written by Richard Huveneers
<firstname.lastname@example.org>. Check out http://www.hacom.nl/~richard for
more information about the author.
Copyright (C) 1995-1999 Richard Huveneers <email@example.com>.
is released under the GNU General Public License. The full
copyright notice is stated at the start of the source code.
tries to ignore windows that are mapped by other X clients. The
method used will fail if two or more X clients are started almost
simultaneously. This situation does not arise as long as all X clients are
started by Xtoolwait
during the X session startup.