How to get a X11 window class name

This article was last updated on Jun 27th, 2023

I sometimes need a window's X11 class name, for example when doing my i3 config. Here is how I get it on my linux system:

  1. Open a terminal
  2. xprop|grep WM_CLASS
  3. Click on the target window

The list of the window's class names is outputed in the terminal.