Name

xkillall — Kills all X windows running a specific command.

Synopsis

xkillall -c TEXT | --command TEXT [ -d TEXT | --display TEXT ] [ -h [true]|false | --help [true]|false ] [ -H [true]|false | --help-long [true]|false ] [ -v [true]|false | --verbose [true]|false ] [ --version [true]|false ]

Description

This script makes use of the xlsclients and xkill commands to track down processes running on a X display by name and kill them. It is particularily handy in killing X commands which don't have the standard window frames (such as dockapps).

Here is a example of using xkillall to kill all instances of the wmmemload dockapp running on the current X display (as dictated by the DISPLAY environment variable). Verbose output has been enabled via the -v option:

[root@probe ~]# xkillall -c wmmemload -v
Searching for wmmemload in output of /usr/bin/xlsclients...
Killing wmmemload on :6.0 with Window ID: 0x2800002
Successfully killed wmmemload with Window ID: 0x2800002
[root@probe ~]# 

Here is a example of using xkillall to kill all instances of the wmmemload dockapp running on X display :7.0 with verbose output (notice how two instances were killed in this example):

[root@probe ~]# xkillall --command wmmemload --display :7.0 --verbose
Searching for wmmemload in output of /usr/bin/xlsclients...
Killing wmmemload on :7.0 with Window ID: 0x1000002
Successfully killed wmmemload with Window ID: 0x1000002
Killing wmmemload on :7.0 with Window ID: 0x1400002
Successfully killed wmmemload with Window ID: 0x1400002
[root@probe ~]# 

Note

This script will pause for a moment if you specify a X display which isn't actually running. It will eventually time out.

Options

The following command line options are available:

-c TEXT | --command TEXT

This option is used to specify the name of the command to be killed. It must match the basename of the command reported by xlsclient -al (the first field next to the Command: label).

[-d TEXT] | [--display TEXT]

By default, we kill the commands found on the current X display (as dictated by the DISPLAY environment variable). If you want to kill a command running on a different X display (or your DISPLAY environment variable isn't set), you can use this option. For example: xkillall -c wmmemload -d ":7.0" could be used to kill all wmmemload dockapps running on X display 7.

[-h [true]|false] | [--help [true]|false]

When this option is specified, xkillall will display a short one line description of xkillall, followed by a short description of each of the supported command line options. After displaying this information xkillall will terminate.

[-H [true]|false] | [--help-long [true]|false]

This option will attempt to pull up additional xkillall documentation within a text based web browser. You can force which browser we use setting the environment variable TEXTBROWSER, otherwise, we will search for some common ones.

[-v [true]|false] | [--verbose [true]|false]

When you set this option to true, xkillall will produce additional output. This is typically used for diagnostic purposes to help track down when things go wrong.

[--version [true]|false]

If this option is specified, the version number of the script is displayed.

Environment

TEXTBROWSER

This controls what text based browser is used to display help information about the script. If not set, we will search your system for available text-based browsers (Ex: elinks, lynx ...).

See Also

xlsclients(1), xkill(1), Network Security Toolkit