Linux command
xwininfo 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Get window info by clicking
xwininfo
Get root window info
xwininfo -root
Get all info
xwininfo -all
Get by window ID
xwininfo -id [0x12345]
Get by window name
xwininfo -name "[Window Name]"
Show the full window tree
xwininfo -root -tree
Display window IDs as integers
xwininfo -int
Show window manager hints
xwininfo -wm -id [0x12345]
说明
xwininfo displays detailed information about X11 windows, including geometry (size and position), window ID, depth, visual class, and colormap. When run without arguments, it presents a crosshair cursor for interactive window selection by clicking. Specific windows can be targeted using -id for a window ID, -name for a window title, or -root for the root window. The -tree option displays the complete window hierarchy, showing how windows are nested within each other. If no information option is specified, -stats is assumed. The tool is commonly used for debugging window managers and scripting X11 window operations.
参数
- -root
- Select the root window as the target without using the cursor.
- -id _wid_
- Specify the target window by its X window ID.
- -name _wdname_
- Specify the target window by name.
- -int
- Display all X window IDs as integer values. Default is hexadecimal.
- -children
- Display the root, parent, and children windows' IDs and names.
- -tree
- Like -children, but display all children recursively.
- -stats
- Display location and appearance attributes including size, position, depth, and visual info. This is the default if no options are specified.
- -bits
- Display bit gravity, window gravity, backing-store, and save-under attributes.
- -events
- Display the selected window's event masks.
- -size
- Display sizing hints including minimum, maximum, and resize increment sizes.
- -wm
- Display window manager hints including input model, icon info, and initial state.
- -shape
- Display the window and border shape extents.
- -frame
- Consider window manager frames when manually selecting windows.
- -metric
- Display dimensions in millimeters as well as number of pixels.
- -english
- Display dimensions in inches as well as number of pixels.
- -all
- Show all available information.
- -display _host:dpy_
- Specify the X server to connect to.
- -version
- Print version information and exit.
FAQ
What is the xwininfo command used for?
xwininfo displays detailed information about X11 windows, including geometry (size and position), window ID, depth, visual class, and colormap. When run without arguments, it presents a crosshair cursor for interactive window selection by clicking. Specific windows can be targeted using -id for a window ID, -name for a window title, or -root for the root window. The -tree option displays the complete window hierarchy, showing how windows are nested within each other. If no information option is specified, -stats is assumed. The tool is commonly used for debugging window managers and scripting X11 window operations.
How do I run a basic xwininfo example?
Run `xwininfo` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -root do in xwininfo?
Select the root window as the target without using the cursor.