How to get information about a window on your Linux desktop.

Posted: November 28, 2017. At: 8:05 AM. This was 2 weeks ago. Post ID: 11555
Page permalink.
WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters. These cookies expire two weeks after they are set.

Getting detailed information about a window on your Linux desktop is very easy. The Xwininfo command is very useful for getting this information.

Run the command and then click a window to get detailed information about a window.

[email protected]:~$ xwininfo
  Absolute upper-left X:  498
  Absolute upper-left Y:  47
  Relative upper-left X:  4
  Relative upper-left Y:  23
  Width: 1417
  Height: 994
  Depth: 24
  Visual: 0x2b
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x3800009 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +498+47  -5+47  -5-39  +498-39
  -geometry 175x62-1+24

To view the WM class of a window, use the xprop utility. Run this command, then click a window.

[email protected]:~$ xprop WM_CLASS
WM_CLASS(STRING) = "mate-terminal", "Mate-terminal"

Using the xprop command with no parameters, and then clicking a window will print a massive amount of information about the window. Even the icons in different sizes.

Example icon output.

	  ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒   
	 ▒░░░░░░░░░░░░░░░░░░░░░░░░░░░▒  
	 ▒                           ▒  
	 ▒ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▒  
	 ▒ ▓█▓▓▓▓▓▓▓▓▓▒▒▒▓▓▓▓▒▒▓▓▓▓▓ ▒  
	 ▒ ▓▓░▓▓▓▓▓▓▓▒▒▒▒▓▓▓▒▒▒▒▓▓▓▓ ▒  
	 ▒ ▓▓▓░▓▓▓▓▓▓▒▒▒▒▓▓▓▒▒▒▓▓▓▓▓ ▒  
	 ▒ ▓▓░▓▓▓▓▓▓▓▒▒▒▒▓▓▒▒▒▒▒▓▓▓▓ ▒  
	 ▒ ▓▓▓▓▓▓▓▓▓▓▒▒▒▓▓▓▒▒▒▒▓▓▓▓▓ ▒  
	 ▒ ▓▓▓▓░░░▓▓▒▒▒▒▓▓▒▒▒▒▒▒▓▓▓▓ ▒  
	 ▒ ▓▓▓▓▒▒▒▓▓▒▒▒▒▓▒▒▒▒▒▒▓▓▓▓▓ ▒  
	 ▒ ▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓ ▒  
	 ▒ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓ ▒  
	 ▒ ▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓ ▒  
	 ▒ ▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓ ▒  
	 ▒ ▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓ ▒  
	 ▒ ▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓ ▒  
	 ▒ ▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓ ▒  
	 ▒ ▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓ ▒  
	 ▒ ▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓ ▒  
	 ▒ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▒  
	 ▒                           ▒  
	 ▒▒░░░░░░░░░░░░░░░░░░░░░░░░░▒▒  
	 ▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒  
	 ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  
	  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░

Get more information about your window manager.

Install wmctrl.

[email protected]:~$ sudo apt install wmctrl

Then run it to get info about your desktop environment.

[email protected]:~$ wmctrl -m
Name: Metacity (Marco)
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: N/A

Use this command to change the title of a window. Run the command, then click a window to set the window title.

[email protected]:~$ wmctrl -r :SELECT: -T "Hi"

List all running applications on your Linux MATE desktop and the window ID`s.

[email protected]:~$ wmctrl -l
0x00c00003 -1 jason-desktop Top Panel
0x00c00017 -1 jason-desktop Bottom Panel
0x02c00010  0 jason-desktop Analytics - Mozilla Firefox
0x0380000a  0 jason-desktop Hi
0x02c001cf  0 jason-desktop VOY S05E06 Timeless - Google Drive - Mozilla Firefox

This is very useful to find a window to manipulate with another utility.

No comments have been made. Use this form to start the conversation :)

Leave a Reply