Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ xprop(1X) — A/UX 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

X(1X)

xwininfo(1X)




xprop(1X) xprop(1X)
NAME xprop - displays X properties SYNOPSIS xprop [-help] [-grammar] [-id id] [-root] [-name name] [-frame] [-font font] [-display display] [-len n] [-notype] [-fs file] [-remove property-name] [-spy] [-f atom format [dformat]]* [format [dformat] atom]* DESCRIPTION xprop displays window and font properties in an X server. For each property, its value on the selected window or font is displayed using any supplied formatting information. If no formatting information is supplied, defaults are used. Each property name is displayed by printing first the pro- perty name, then printing its type (if it has one) in parentheses, followed by its value. If a property is not defined on the selected window or font, not defined is displayed as the value for that property. If no property list is given, all the properties possessed by the selected window or font are displayed. You can also use xprop to remove a property from a window. Options The xprop command accepts these options: -display display Specifies the server to connect to. See X(1X) for details. -f atom format [dformat]* Specifies the format and dformat for atom. If dfor- mat is missing, xprop uses = $0+\n. See ``Property formats'' later in the ``Description'' section for details. -font font Specifies that the properties of a font, specified by font, should be displayed. -frame Causes xprop to examine the window manager frame, if any, instead of the client window when using a command-line option to select a window. -fs file Specifies that file should be used as a source of more formats for properties. -help Displays a summary of the command syntax. -grammar November, 1990 1



xprop(1X) xprop(1X)
Displays a grammar for all command-line options. -id id Causes the properties of the window specified by id to be displayed. You can obtain the window ID by us- ing xwininfo(1X), and you can specify the ID in de- cimal or hexadecimal (if preceded by 0x). This op- tion is useful in debugging X applications where the target window is not mapped to the screen or where the use of the pointer might be impossible or inter- fere with the application. -len n Specifies that at most n bytes of any property should be read or displayed. This is useful, for example, when displaying the cut buffer on the back- ground window, which could run to several pages if displayed in full. -name name Specifies that the window named name is the target window. -notype Specifies that the type of each property should not be displayed. -remove property-name Specifies the name of a property to be removed from the target window. -root Specifies that the background window is the target window. This is useful when the background window is completely obscured. -spy Causes xprop to examine window properties forever, looking for property change events. Using xprop You can select a window in one of four ways. You can use the -id, -name, or -root option on the command line. If none of these options is specified on the command line, xprop displays a crosshair pointer. You can select any visible window by positioning the pointer in the desired window and pressing the mouse button (or the LEFT ARROW key or RIGHT ARROW key). Property formats The formatting information for a property actually consists of two parts, format and dformat. The format information specifies the actual format of the property (for example, consisting of words or bytes), while dformat specifies the display format that specifies how the property should be shown on the screen. 2 November, 1990



xprop(1X) xprop(1X)
The following paragraphs describe how to construct an actual format and a display format. However, for the vast majority of users and uses, this information should not be necessary because the built-in defaults contain the actual and display formats necessary to display all the standard properties. It should only be necessary to specify actual formats and display formats if a new property is being dealt with or you dislike the standard display format. An actual format consists of a 0, 8, 16, or 32 followed by a sequence of one or more format characters. The 0, 8, 16, and 32 specify how many bits per field there are in the pro- perty. The 0 is a special case that means the field-size information associated with the property itself should be used. (This is only needed for special cases such as type INTEGER, which is actually three different types depending on the size of the fields of the property.) An 8 means that the property is a sequence of bytes, and a 16 means that the property is a sequence of words. The difference between these two lies in the fact that the se- quence of words is byte-swapped, and the sequence of bytes is not byte-swapped when read by a machine of the opposite byte order of the machine that originally wrote the proper- ty. For more information about how properties are formatted and stored, consult the manual, Xlib - C Language Interface. After the size of the fields has been specified, it is necessary to specify the type of each field (such as in- teger, string, or atom). This is done using one format character per field. If there are more fields in the pro- perty than supplied format characters, the last character is repeated as many times as necessary for the extra fields. The format characters and their meaning are as follows: a The field holds an atom number. A field of this type should be of size 32. b The field is a Boolean. A 0 means FALSE while any- thing else means TRUE. c The field is an unsigned number, a cardinal. i The field is a signed integer. m The field is a set of bit flags, where 1 is TRUE. s This field and the next ones until either a 0 or the end of the property represent a sequence of bytes. This format character is only usable with a field size of 8 and is most often used to represent a November, 1990 3



xprop(1X) xprop(1X)
string. x The field is a hexadecimal number (such as c but displayed in hexadecimal) This is most useful for displaying window IDs and the like. An sample format is 32ica, which is the format for a proper- ty of three fields of 32 bits each, the first holding a signed integer, the second an unsigned integer, and the third an atom. The display format (dformat) is not as rigid as the actual format (format). The only limitation on a display format is that it cannot start with a letter or a dash. This is so that it can be distinguished from a property name or an op- tion. A display format is a text string containing special characters instructing that various fields be printed at various points in a manner similar to the formatting string used by printf(3S). For example, the display format is ( $0, $1 \)\n would render the point (3,-4), which has a format of 32ii, as is ( 3, -4 )\n Any character other than a $, ?, \, or a ( in a display for- mat prints as itself. To print one of $, ?, \, or a (, you must precede it by a backslash (\). For example, to print a $, use \$. Several special backslash sequences are provided as shortcuts. The sequence \n causes a newline character to be displayed, and \t causes a tab character to be displayed. The sequence \o, where o is an octal number, displays char- acter number o. A dollar sign ($) followed by a number n causes field number n to be displayed. The format of the displayed field depends on the formatting character used to describe it in the corresponding format. For example, if a cardinal is described by c, it is displayed in decimal, while if it is described by x, it is displayed in hexadecimal. If the field is not present in the property (this is possi- ble with some properties), <field not available> is displayed instead. A format of $n+ displays field number n, then a comma, then field number n+1, then another comma, and so on, until the last field defined. If field n is not de- fined, nothing is displayed. This is useful for a property that is a list of values. 4 November, 1990



xprop(1X) xprop(1X)
A question mark (?) is used to start a conditional expres- sion. The expression ?exp(text) displays text if and only if exp evaluates to nonzero. This is useful in two ways. First, it allows fields to be displayed if and only if a flag is set. And second, it allows a value such as a state number to be displayed as a name rather than as just a number. The expression exp may have any one of the follow- ing forms: term term=exp !exp where term may in turn have any of the following three forms: n $n mn The ! operator is a logical NOT, changing 0 to 1 and any nonzero value to 0. The = is an equality operator. Note that internally all expressions are evaluated as 32-bit numbers, so -1 is not equal to 65535. The equal sign (=) returns 1 if the two values are equal and 0 if not. The n represents the constant value n, and $n represents the value of field number n. The mn is 1 if flag number n in the first field having format character m in the corresponding format is 1, and 0 otherwise. For example, ?m3(count: $3\n) displays field 3 with a label of count if and only if flag number 3 (count starts at 0!) is set, and ?$2=0(True)?!$2=0(False) displays the inverted value of field 2 as a Boolean. In order to display a property, xprop needs both format and dformat. Before xprop uses its default values of a format of 32x and a dformat of = { $0+ }\n, it searches several places in an attempt to find more specific formats. First, a search is made using the name of the property. If this fails, a search is made using the type of the property. This allows type STRING to be defined with one set of for- mats while allowing property WM_NAME, which is of type STRING, to be defined with a different format. In this way, the formats for a given type can be overridden for specific properties. The locations are searched in this order: any format speci- fied with the property name (as in 8x WM_NAME), the formats defined by -f options in last to first order, the contents of the file specified by the -fs option if any, the contents November, 1990 5



xprop(1X) xprop(1X)
of the file specified by the environment variable XPROPFOR- MATS if any, and finally the built-in file of formats of xprop. The format of the files referred to by the -fs option and the XPROPFORMATS variable is one or more lines of the fol- lowing form: name format [dformat] where name is either the name of a property or the name of a type, format is the actual format to be used with name, and dformat is the display format to be used with name. If dformat is not present, = $0+\n is assumed. Environment variables The xprop command uses the following environment variables: DISPLAY Specifies the default host, display number, and screen. XPROPFORMATS Specifies the name of a file from which additional formats are to be obtained. EXAMPLES To display the name of the background window, use xprop -root WM_NAME To display the window manager hints for the clock, use xprop -name xclock WM_HINTS To display the start of the cut buffer, use xprop -root -len 100 CUT_BUFFER0 To display the point size of the fixed font, use xprop -font fixed POINT_SIZE To display all the properties of window number 0x200007, use xprop -id 0x200007 6 November, 1990



xprop(1X) xprop(1X)
NOTES Copyright 1988, Massachusetts Institute of Technology. See X(1X) for a full statement of rights and permissions. Author: Mark Lillibridge, MIT Project Athena SEE ALSO X(1X), xwininfo(1X) November, 1990 7

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026