{
    "mode": "man",
    "parameter": "xprop",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/xprop/1/json",
    "generated": "2026-05-30T06:06:48Z",
    "synopsis": "xprop  [-help]  [-grammar] [-id id] [-root] [-name name] [-frame] [-font font] [-display dis‐\nplay] [-len n] [-notype] [-fs file] [-remove property-name] [-set property-name value] [-spy]\n[-version] [-f atom format [dformat]]* [format [dformat] atom]*",
    "sections": {
        "NAME": {
            "content": "xprop - property displayer for X\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "xprop  [-help]  [-grammar] [-id id] [-root] [-name name] [-frame] [-font font] [-display dis‐\nplay] [-len n] [-notype] [-fs file] [-remove property-name] [-set property-name value] [-spy]\n[-version] [-f atom format [dformat]]* [format [dformat] atom]*\n",
            "subsections": []
        },
        "SUMMARY": {
            "content": "The xprop utility is for displaying window and font properties in an X server.  One window or\nfont is selected using the command line arguments or possibly in the case  of  a  window,  by\nclicking on the desired window.  A list of properties is then given, possibly with formatting\ninformation.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-help",
                    "content": ""
                },
                {
                    "name": "-grammar",
                    "content": "Print out a detailed grammar for all command line options.\n"
                },
                {
                    "name": "-id",
                    "content": "ing  the pointer to select the target window.  This is very useful in debugging X ap‐\nplications where the target window is not mapped to the screen or where  the  use  of\nthe pointer might be impossible or interfere with the application.\n"
                },
                {
                    "name": "-name",
                    "content": "This  argument  allows  the  user to specify that the window named name is the target\nwindow on the command line rather than using the pointer to select the target window.\n"
                },
                {
                    "name": "-font",
                    "content": "This argument allows the user to specify that the properties of font font  should  be\ndisplayed.\n"
                },
                {
                    "name": "-root",
                    "content": "situations where the root window is completely obscured.\n"
                },
                {
                    "name": "-display",
                    "content": "This argument allows you to specify the server to connect to; see X(7).\n"
                },
                {
                    "name": "-len",
                    "content": ""
                },
                {
                    "name": "-notype",
                    "content": ""
                },
                {
                    "name": "-fs",
                    "content": "Specifies that file file should be used as a source of more formats for properties.\n"
                },
                {
                    "name": "-frame -name -root -id",
                    "content": "are  given),  look  at  the  window manager frame (if any) instead of looking for the\nclient window.\n"
                },
                {
                    "name": "-remove",
                    "content": "Specifies the name of a property to be removed from the indicated window.\n"
                },
                {
                    "name": "-set",
                    "content": "Specifies the name of a property and a property value, to be  set  on  the  indicated\nwindow.\n"
                },
                {
                    "name": "-spy",
                    "content": ""
                },
                {
                    "name": "-version",
                    "content": "Print program version information and exit.\n"
                },
                {
                    "name": "-f",
                    "content": "Specifies  that  the  format  for name should be format and that the dformat for name\nshould be dformat.  If dformat is missing, \" = $0+\\n\" is assumed.\n",
                    "flag": "-f"
                }
            ]
        },
        "DESCRIPTION": {
            "content": "For each of these properties, its value on the selected window or font is printed  using  the\nsupplied  formatting  information if any.  If no formatting information is supplied, internal\ndefaults are used.  If a property is not defined on the selected window  or  font,  \"not  de‐\nfined\"  is  printed  as  the  value for that property.  If no property list is given, all the\nproperties possessed by the selected window or font are printed.\n\nA window may be selected in one of four ways.  First, if the desired window is the root  win‐\ndow, the -root argument may be used.  If the desired window is not the root window, it may be\nselected in two ways on the command line, either by id number such as might be obtained  from\nxwininfo, or by name if the window possesses a name.  The -id argument selects a window by id\nnumber in either decimal or hex (must start with 0x) while the -name argument selects a  win‐\ndow by name.\n\nThe  last way to select a window does not involve the command line at all.  If none of -font,\n-id, -name, and -root are specified, a crosshairs cursor is displayed and the user is allowed\nto  choose any visible window by pressing any pointer button in the desired window.  If it is\ndesired to display properties of a font as opposed to a window, the -font  argument  must  be\nused.\n\nOther than the above four arguments and the -help argument for obtaining help, and the -gram‐\nmar argument for listing the full grammar for the command line, all the  other  command  line\narguments are used in specifying both the format of the properties to be displayed and how to\ndisplay them.  The -len n argument specifies that at most n bytes of any given property  will\nbe read and displayed.  This is useful for example when displaying the cut buffer on the root\nwindow which could run to several pages if displayed in full.\n\nNormally each property name is displayed by printing first the property name  then  its  type\n(if  it  has  one) in parentheses followed by its value.  The -notype argument specifies that\nproperty types should not be displayed.  The -fs argument is used to specify a file  contain‐\ning  a list of formats for properties while the -f argument is used to specify the format for\none property.\n\nThe formatting information for a property actually consists of two  parts,  a  format  and  a\ndformat.   The format specifies the actual formatting of the property (i.e., is it made up of\nwords, bytes, or longs?, etc.) while the dformat specifies how the property  should  be  dis‐\nplayed.\n\nThe  following  paragraphs  describe how to construct formats and dformats.  However, for the\nvast majority of users and uses, this should not be necessary as the built in  defaults  con‐\ntain  the  formats  and dformats necessary to display all the standard properties.  It should\nonly be necessary to specify formats and dformats if a new property is being  dealt  with  or\nthe  user  dislikes the standard display format.  New users especially are encouraged to skip\nthis part.\n\nA format consists of one of 0, 8, 16, or 32 followed by a sequence  of  one  or  more  format\ncharacters.  The 0, 8, 16, or 32 specifies how many bits per field there are in the property.\nZero is a special case meaning use the field size information associated  with  the  property\nitself.   (This  is  only  needed for special cases like type INTEGER which is actually three\ndifferent types depending on the size of the fields of the property.)\n\nA value of 8 means that the property is a sequence of bytes while a value of  16  would  mean\nthat  the property is a sequence of words.  The difference between these two lies in the fact\nthat the sequence of words will be byte swapped while the sequence of bytes will not be  when\nread  by  a machine of the opposite byte order of the machine that originally wrote the prop‐\nerty.  For more information on how properties are formatted and stored, consult the Xlib man‐\nual.\n\nOnce  the  size of the fields has been specified, it is necessary to specify the type of each\nfield (i.e., is it an integer, a string, an atom, or what?)  This is done  using  one  format\ncharacter  per  field.   If there are more fields in the property than format characters sup‐\nplied, the last character will be repeated as many times as necessary for the  extra  fields.\nThe format characters and their meaning are as follows:\n\na      The field holds an atom number.  A field of this type should be of size 32.\n\nb      The field is an boolean.  A 0 means false while anything else means true.\n\nc      The field is an unsigned number, a cardinal.\n\ni      The field is a signed integer.\n\nm      The field is a set of bit flags, 1 meaning on.\n\no      The  field  is an array of icons, packed as a sequence of 32 bit numbers consisting of\nthe width, height and ARGB pixel values, as defined for the NETWMICON  property  in\nthe  Extended  Window  Manager  Hints specification.   A field of this type must be of\nsize 32.\n\ns      This field and the next ones until either a 0 or the end of the property  represent  a\nsequence of bytes.  This format character is only usable with a field size of 8 and is\nmost often used to represent a string.\n\nt      This field and the next ones until either a 0 or the end of the property represent  an\ninternationalized  text string. This format character is only usable with a field size\nof 8. The string is assumed to be in an ICCCM compliant encoding and is  converted  to\nthe current locale encoding before being output.\n\nu      This  field and the next ones until either a 0 or the end of the property represent an\nUTF-8 encoded unicode string. This format character is only usable with a  field  size\nof  8.  If the string is found to be an invalid character, the type of encoding viola‐\ntion is printed instead, followed by the string formatted using 's'. When in an  envi‐\nronment not capable of displaying UTF-8 encoded string, behaviour is identical to 's'.\n\nx      The  field is a hex number (like 'c' but displayed in hex - most useful for displaying\nwindow ids and the like)\n\nAn example format is 32ica which is the format for a property of  three  fields  of  32  bits\neach,  the  first  holding a signed integer, the second an unsigned integer, and the third an\natom.\n\nThe format of a dformat unlike that of a format is not so rigid.  The only limitations  on  a\ndformat is that one may not start with a letter or a dash.  This is so that it can be distin‐\nguished from a property name or an argument.  A dformat is a text string  containing  special\ncharacters  instructing  that various fields be printed at various points in a manner similar\nto the formatting string used by printf.  For example, the dformat \" is ( $0, $1 \\)\\n\"  would\nrender the POINT 3, -4 which has a format of 32ii as \" is ( 3, -4 )\\n\".\n\nAny  character  other than a $, ?, \\, or a ( in a dformat prints as itself.  To print out one\nof $, ?, \\, or ( precede it by a \\.  For example, to print out a $, use \\$.  Several  special\nbackslash sequences are provided as shortcuts.  \\n will cause a newline to be displayed while\n\\t will cause a tab to be displayed.  \\o where o is an octal number  will  display  character\nnumber o.\n\nA  $  followed  by  a number n causes field number n to be displayed.  The format of the dis‐\nplayed field depends on the formatting character used to describe  it  in  the  corresponding\nformat.   I.e., if a cardinal is described by 'c' it will print in decimal while if it is de‐\nscribed by a 'x' it is displayed in hex.\n\nIf the field is not present in the property (this is possible with some  properties),  <field\nnot available> is displayed instead.  $n+ will display field number n then a comma then field\nnumber n+1 then another comma then ... until the last field defined.  If field n is  not  de‐\nfined, nothing is displayed.  This is useful for a property that is a list of values.\n\nA  ? is used to start a conditional expression, a kind of if-then statement.  ?exp(text) will\ndisplay text if and only if exp evaluates to  non-zero.   This  is  useful  for  two  things.\nFirst,  it allows fields to be displayed if and only if a flag is set.  And second, it allows\na value such as a state number to be displayed as a name rather than as just a  number.   The\nsyntax of exp is as follows:\n\nexp    ::= term | term=exp | !exp\n\nterm   ::= n | $n | mn\n\nThe  !  operator  is a logical ``not'', changing 0 to 1 and any non-zero value to 0.  = is an\nequality operator.  Note that internally all expressions are evaluated as 32 bit  numbers  so\n-1  is  not  equal to 65535.  = returns 1 if the two values are equal and 0 if not.  n repre‐\nsents the constant value n while $n represents the value of field number n.  mn is 1 if  flag\nnumber  n  in the first field having format character 'm' in the corresponding format is 1, 0\notherwise.\n\nExamples: ?m3(count: $3\\n) displays field 3 with a label of count if and only if flag  number\n3  (count starts at 0!) is on.  ?$2=0(True)?!$2=0(False) displays the inverted value of field\n2 as a boolean.\n\nIn order to display a property, xprop needs both a format and a dformat.  Before  xprop  uses\nits  default  values  of a format of 32x and a dformat of \" = { $0+ }\\n\", it searches several\nplaces in an attempt to find more specific formats.  First, a search is made using  the  name\nof  the  property.  If this fails, a search is made using the type of the property.  This al‐\nlows type STRING to be defined with one set of formats while allowing property WMNAME  which\nis  of  type  STRING to be defined with a different format.  In this way, the display formats\nfor a given type can be overridden for specific properties.\n\nThe locations searched are in order: the format if any specified with the property  name  (as\nin 8x WMNAME), the formats defined by -f options in last to first order, the contents of the\nfile specified by the -fs option if any, the contents of the file specified by  the  environ‐\nmental variable XPROPFORMATS if any, and finally xprop's built in file of formats.\n\nThe  format of the files referred to by the -fs argument and the XPROPFORMATS variable is one\nor more lines of the following form:\n\nname format [dformat]\n\nWhere name is either the name of a property or the name of a type, format is the format to be\nused with name and dformat is the dformat to be used with name.  If dformat is not present, \"\n= $0+\\n\" is assumed.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "To display the name of the root window: xprop -root WMNAME\n\nTo display the window manager hints for the clock: xprop -name xclock WMHINTS\n\nTo display the start of the cut buffer: xprop -root -len 100 CUTBUFFER0\n\nTo display the point size of the fixed font: xprop -font fixed POINTSIZE\n\nTo display all the properties of window # 0x200007: xprop -id 0x200007\n\nTo set a simple string property:  xprop  -root  -format  MYATOMNAME  8s  -set  MYATOMNAME\n\"myvalue\"\n",
            "subsections": []
        },
        "ENVIRONMENT": {
            "content": "DISPLAY To get default display.\n\nXPROPFORMATS\nSpecifies the name of a file from which additional formats are to be obtained.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "X(7), xdpyinfo(1), xwininfo(1), xdriinfo(1), glxinfo(1), xvinfo(1)\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Mark Lillibridge, MIT Project Athena\n\n\n\nX Version 11                                 xprop 1.2.4                                    XPROP(1)",
            "subsections": []
        }
    },
    "summary": "xprop - property displayer for X",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Print out a detailed grammar for all command line options."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "ing the pointer to select the target window. This is very useful in debugging X ap‐ plications where the target window is not mapped to the screen or where the use of the pointer might be impossible or interfere with the application."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This argument allows the user to specify that the window named name is the target window on the command line rather than using the pointer to select the target window."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This argument allows the user to specify that the properties of font font should be displayed."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "situations where the root window is completely obscured."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This argument allows you to specify the server to connect to; see X(7)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Specifies that file file should be used as a source of more formats for properties."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "are given), look at the window manager frame (if any) instead of looking for the client window."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Specifies the name of a property to be removed from the indicated window."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Specifies the name of a property and a property value, to be set on the indicated window."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Print program version information and exit."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "Specifies that the format for name should be format and that the dformat for name should be dformat. If dformat is missing, \" = $0+\\n\" is assumed."
        }
    ],
    "examples": [
        "To display the name of the root window: xprop -root WMNAME",
        "To display the window manager hints for the clock: xprop -name xclock WMHINTS",
        "To display the start of the cut buffer: xprop -root -len 100 CUTBUFFER0",
        "To display the point size of the fixed font: xprop -font fixed POINTSIZE",
        "To display all the properties of window # 0x200007: xprop -id 0x200007",
        "To set a simple string property:  xprop  -root  -format  MYATOMNAME  8s  -set  MYATOMNAME",
        "\"myvalue\""
    ],
    "see_also": [
        {
            "name": "X",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/X/7/json"
        },
        {
            "name": "xdpyinfo",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/xdpyinfo/1/json"
        },
        {
            "name": "xwininfo",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/xwininfo/1/json"
        },
        {
            "name": "xdriinfo",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/xdriinfo/1/json"
        },
        {
            "name": "glxinfo",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/glxinfo/1/json"
        },
        {
            "name": "xvinfo",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/xvinfo/1/json"
        }
    ]
}