Page: | 1 | 2 | 3 |
Home |
a | The field holds an atom number. A field of this type should be of size 32. |
b | The field is an boolean. A 0 means false while anything 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, 1 meaning on. |
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 string. |
x | The field is a hex number (like 'c' but displayed in hex - most useful for displaying window ids and the like) |
Home |
An example formal is 32ica which is the format for a property of three fields
of 32 bits each the first holding a signed integer the second an unsigned 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 letter or a dash. This is
so that it can be distinguished from a property name or an argument. A dformat 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. For example
the dformat " is ( $0 $1 )n" would render the POINT 3 -4 which has
format of 32ii as " is ( 3 -4 )n".
Any character other than a $, ?, , or a ( in a
dformat prints as itself. To print out one of $, ?, , or ( precede it by a For
example, to print out a $, use $. Several
special backslash sequences are provided as shortcuts. n will cause a newline to be displayed while t will cause a tab to be displayed. o where o is an octal number will display character number o.
A $ 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. I.e. if a cardinal is described by 'c' it will print in
decimal while if it is described by a 'x' it is displayed in hex.
If the field is not present in the property (this is possible with some properties), <
field not available> is displayed instead. $n+ will display field number n then
a comma then field number n+ 1 then another comma then ... until the last field
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 to non-zero. This is
useful for two things. 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 syntax of exp. is as follows:
exp | ::= term | term = exp. | !exp |
term | ::= 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 evaluated as 32 bit
numbers so -I is not equal to 65535. = returns I if the two values are equal and 0 if not.
n represents the constant value n while in represents the value of
field number n. mn is 1 if flag number n in the first field having format character
'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 flag
number 3 (count starts at 0!) is on. ?$2= 0(True)?!52= 0(False) displays the inverted
value of field 2 as a boolean.
In order to display a property, xprop needs both a format and a Format.
Before xprop uses its default values of a format of 32x and a doormat
of " = ( $0+ J\ni', 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 formats while allowing property WM_NAME which 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 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 of the file specified by the
environmental variable XPROPFORMATS if any, and finally xprop's built in file of
formats.
Home |
The format of the files referred to by the -fs argument and the XPROPFORMATS variable
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 Format is the Format to
be used with name. If Format is not present, " = $0+\n" is
assumed.
To display the window manager hints for the clock: xprop -name xclock WM_HINTS
To display the start of the cut buffer: xprop - root -fen 100 CUT_BUFFER0
To display the point size of the fixed font: xprop -font fixed POINT_SIZE
To display all the properties of window # Ox200007: xprop -id Ox200007
To get default display.
Specifies the name of a file from which additional formats arc to be obtained.
Home |
---|
Contents | Previous Chapter | Chapter 1 Cont. | Next Chapter |