MAN page from Fedora 18 xorg-x11-utils-7.5-7.fc18.x86_64.rpm


Section: User Commands (1)
Updated: xprop 1.2.1


xprop - property displayer for X 


xprop[-help] [-grammar] [-id id] [-root] [-name name][-frame][-font font][-display display][-len n] [-notype] [-fs file][-remove property-name][-set property-name value][-spy][-f atom format [dformat]]*[format [dformat] atom]* 


Thexproputility is for displaying window and font properties in an X server.One window or font is selected using the commandline arguments or possibly in the case of a window, by clicking on the desiredwindow. A list of properties is then given, possibly with formattinginformation. 


Print out a summary of command line options.

Print out a detailed grammar for all command line options.

-id id
This argument allows the user to select window id on thecommand line rather than using the pointer to select the target window.This is very useful in debugging X applications where the targetwindow is not mapped to the screen or where the use of the pointer mightbe impossible or interfere with the application.

-name name
This argument allows the user to specify that the window named nameis the target window on the command line rather than using the pointer toselect the target window.

-font font
This argument allows the user to specify that the properties of fontfont should be displayed.

This argument specifies that X's root window is the target window.This is useful in situations where the root window is completelyobscured.

-display display
This argument allows you to specify the server to connect to;see X(7).

-len n
Specifies that at most n bytes of any property should be read ordisplayed.

Specifies that the type of each property should not be displayed.

-fs file
Specifies that file file should be used as a source of more formatsfor properties.

Specifies that when selecting a window by hand (i.e. if none of -name,-root, or -id are given), look at the window manager frame (ifany) instead of looking for the client window.

-remove property-name
Specifies the name of a property to be removed from the indicated window.

-set property-name value
Specifies the name of a property and a property value, to be set on theindicated window.

Examine window properties forever, looking for property change events.

-f name format [dformat]
Specifies that the format for name should be format and thatthe dformat for name should be dformat. If dformatis missing, " = $0+\n" is assumed.


For each of these properties, its value on the selected windowor font is printed using the supplied formatting information if any. If noformatting information is supplied, internal defaults are used. If a propertyis not defined on the selected window or font, "not defined" is printed as thevalue for that property. If no property list is given, all the propertiespossessed by the selected window or font are printed.

A window may be selected in one of four ways. First, if the desired windowis the root window, the -root argument may be used.If the desired window is not the root window, it may be selectedin two ways on the command line, either by id number such as might be obtainedfrom xwininfo, or by name if the window possesses a name. The -idargument selects a window by id number in either decimal or hex (must startwith 0x) while the -name argument selects a window by name.

The last way to select a window does not involve the command line at all.If none of -font, -id, -name, and -root are specified, a crosshairs cursoris displayed and the user is allowed to choose any visible window by pressingany pointer button in the desired window. If it is desired to display propertiesof a font as opposed to a window, the -font argument must be used.

Other than the above four arguments and the -help argument for obtaining help,and the -grammar argument for listing the full grammar for the command line,all the other command line arguments are used in specifying both the formatof the properties to be displayed and how to display them. The -len nargument specifies that at most n bytes of any given property will beread and displayed. This is useful for example when displaying the cut bufferon the root window which could run to several pages if displayed in full.

Normally each property name is displayed by printing first the propertyname then its type (if it has one) in parentheses followed by its value.The -notype argument specifies that property types should not bedisplayed. The -fs argument is used to specify a file containing a list offormats for properties while the -f argument is used to specify the formatfor one property.

The formatting information for a property actually consists of two parts,a format and a dformat. The format specifies the actualformatting of the property (i.e., is it made up of words, bytes, or longs?,etc.) while the dformat specifies how the property should be displayed.

The following paragraphs describe how to construct formats anddformats. However, for the vast majority of users and uses, this shouldnot be necessary as the built in defaults contain the formats anddformats necessary to display all the standard properties. It shouldonly be necessary to specify formats and dformatsif a new property is being dealt with or the user dislikes the standard displayformat. New users especially are encouraged to skip this part.

A format consists of one of 0, 8, 16, or 32 followed by a sequence of oneor more format characters. The 0, 8, 16, or 32 specifies how many bits perfield there are in the property. Zero is a special case meaning use thefield size information associated with the property itself. (This is onlyneeded for special cases like type INTEGER which is actually three differenttypes depending on the size of the fields of the property.)

A value of 8 meansthat the property is a sequence of bytes while a value of 16 would mean thatthe property is a sequence of words. The difference between these two lies inthe fact that the sequence of words will be byte swapped while the sequence ofbytes will not be when read by a machine of the opposite byte order of themachine that originally wrote the property. For more information on howproperties are formatted and stored, consult the Xlib manual.

Once the size of the fields has been specified, it is necessary to specifythe type of each field (i.e., is it an integer, a string, an atom, or what?)This is done using one format character per field. If there are more fieldsin the property than format characters supplied, the last character will berepeated as many times as necessary for the extra fields. The formatcharacters and their meaning are as follows:

The field holds an atom number. A field of this type should be of size 32.
The field is an boolean. A 0 means false while anything else means true.
The field is an unsigned number, a cardinal.
The field is a signed integer.
The field is a set of bit flags, 1 meaning on.
The field is an array of icons, packed as a sequence of 32 bit numbersconsisting of the width, height and ARGB pixel values, as defined forthe _NET_WM_ICON property in the Extended Window Manager Hintsspecification. A field of this type must be of size 32.
This field and the next ones until either a 0 or the end of the propertyrepresent a sequence of bytes. This format character is only usable witha field size of 8 and is most often used to represent a string.
This field and the next ones until either a 0 or the end of the propertyrepresent an internationalized text string. This format character is onlyusable with a field size of 8. The string is assumed to be in an ICCCMcompliant encoding and is converted to the current locale encoding beforebeing output.
This field and the next ones until either a 0 or the end of the propertyrepresent an UTF-8 encoded unicode string. This format character is onlyusable with a field size of 8. If the string is found to be an invalidcharacter, the type of encoding violation is printed instead, followed bythe string formatted using 's'. When in an environment not capable ofdisplaying UTF-8 encoded string, behaviour is identical to 's'.
The field is a hex number (like 'c' but displayed in hex - most usefulfor displaying window ids and the like)

An example format is 32ica which is the format for a property of threefields of 32 bits each, the first holding a signed integer, the second anunsigned integer, and the third an atom.

The format of a dformat unlike that of a format is not so rigid.The only limitations on a dformat is that one may not start with a letteror a dash. This is so that it can be distinguished from a property name oran argument. A dformat is a text string containing special charactersinstructing that various fields be printed at various points in a manner similarto the formatting string used by printf. For example, the dformat" is ( $0, $1 \)\n" would render the POINT 3, -4 which has a format of32ii as " is ( 3, -4 )\n".

Any character other than a $, ?, \, or a ( in a dformat prints asitself. To print out one of $, ?, \, or ( precede it by a \. For example,to print out a $, use \$. Several special backslash sequences are providedas shortcuts. \n will cause a newline to be displayed while \t willcause a tab to be displayed. \o where o is an octal numberwill display character number o.

A $ followed by a number n causes field number n to bedisplayed. The format of the displayed field depends on the formattingcharacter used to describe it in the corresponding format. I.e., ifa cardinal is described by 'c' it will print in decimal while if it isdescribed by a 'x' it is displayed in hex.

If the field is not present inthe property (this is possible with some properties), <field not available>is displayed instead. $n+ will display field number n then acomma then field number n+1 then another comma then ... until the lastfield defined. If field n is not defined, nothing is displayed.This is useful for a property that is a list of values.

A ? is used to start a conditional expression, a kind of if-then statement.?exp(text) will display text if and only if exp evaluates tonon-zero. This is useful for two things. First, it allows fields to bedisplayed if and only if a flag is set.And second, it allows a value such as a statenumber to be displayed as a name rather than as just a number. The syntax ofexp is as follows:

::= term | term=exp | !exp
::= n | $n | mn

The ! operator is a logical ``not'', changing 0 to 1 and any non-zero value to 0.= is an equality operator. Note that internally all expressions are evaluatedas 32 bit numbers so -1 is not equal to 65535. = returns 1 if the two valuesare equal and 0 if not.n represents the constant value n while $n represents thevalue of field number is 1 if flag number n in the first field having formatcharacter 'm' in the corresponding format is 1, 0 otherwise.

Examples: ?m3(count: $3\n) displays field 3 with a label of count if and only if flagnumber 3 (count starts at 0!) is on. ?$2=0(True)?!$2=0(False) displays theinverted value of field 2 as a boolean.

In order to display a property, xprop needs both a format and adformat. Before xprop uses its default values of a formatof 32x and a dformat of " = { $0+ }\n", it searches several placesin an attempt to find more specific formats.First, a search is made using the name of the property. If thisfails, a search is made using the type of the property. This allows typeSTRING to be defined with one set of formats while allowing property WM_NAMEwhich is of type STRING to be defined with a different format. In this way,the display formats for a given type can be overridden for specific properties.

The locations searched are in order: the format if any specified with theproperty name (as in 8x WM_NAME), the formats defined by -f options in last tofirst order, the contents of the file specified by the -fs option if any,the contents of the file specified by the environmental variable XPROPFORMATSif any, and finally xprop's built in file of formats.

The format of the files referred to by the -fs argument and the XPROPFORMATSvariable is one or more lines of the following form:

name format [dformat]

Where name is either the name of a property or the name of a type,format is the format to be used with name and dformatis the dformat to be used with name. If dformat is notpresent, " = $0+\n" is assumed. 


To display the name of the root window: xprop -root WM_NAME

To display the window manager hints for the clock: xprop -name xclockWM_HINTS

To display the start of the cut buffer: xprop -root -len 100 CUT_BUFFER0

To display the point size of the fixed font: xprop -font fixed POINT_SIZE

To display all the properties of window # 0x200007: xprop -id 0x200007

To set a simple string property: xprop -root -format MY_ATOM_NAME 8s -set MY_ATOM_NAME "my_value" 


To get default display.
Specifies the name of a file from which additional formats are to be obtained.



X(7), xdpyinfo(1), xwininfo(1),xdriinfo(1), glxinfo(1), xvinfo(1) 


Mark Lillibridge, MIT Project Athena




This document was created byman2html,using the manual pages.