LinuxCommandLibrary

xprop

TLDR

Click to select a window and display its properties

$ xprop
copy
Display properties of the root window
$ xprop -root
copy
Display properties of a window by ID
$ xprop -id [0x200007]
copy
Display properties of a window by name
$ xprop -name "[window_name]"
copy
Display a specific property
$ xprop -root WM_NAME
copy
Monitor property changes continuously
$ xprop -spy -id [window_id]
copy
Set a property on a window
$ xprop -root -set [PROPERTY_NAME] "[value]"
copy
Remove a property from a window
$ xprop -root -remove [PROPERTY_NAME]
copy

SYNOPSIS

xprop [-display display] [-id id] [-name name] [-root] [-frame] [-spy] [property ...]

DESCRIPTION

xprop displays properties of X Window System windows. Properties are arbitrary data that applications and window managers use to communicate, such as window titles (WMNAME), window classes (WMCLASS), and window states.
When invoked without -id, -name, or -root, xprop displays a crosshair cursor allowing interactive window selection by clicking. Specific properties can be listed as arguments to display only those.
Common properties include WMNAME (title), WMCLASS (application class), WMSTATE, NETWMPID, and various Extended Window Manager Hints (NETWM_*).

PARAMETERS

-display display

Connect to the specified X server.
-id id
Query window by numeric ID (decimal or hex with 0x prefix).
-name name
Query window by its WM_NAME property (title).
-root
Display properties of the root window (desktop).
-frame
Select the window manager frame instead of the client window.
-len n
Limit output to the first n bytes per property.
-notype
Don't print property types, only names and values.
-spy
Monitor for property change events continuously.
-set property value
Set a property on the window.
-remove property
Remove a property from the window.
-f atom format [dformat]
Specify format for interpreting a property.
-version
Print version and exit.

CAVEATS

xprop only works with X11 windows; Wayland applications may not expose properties the same way. Window IDs can be obtained from xwininfo or xdotool. Property names are case-sensitive.

HISTORY

xprop is part of the standard X.Org utility collection and has been included with X Window System distributions since the early X11 releases in the 1980s. It remains an essential debugging and scripting tool for X11 environments.

SEE ALSO

xwininfo(1), xdotool(1), wmctrl(1), xdpyinfo(1)

Copied to clipboard