Tuxtips - Linux HowTos

Linux HowTos live here

How to find application's window class in i3 window manager

09 Jul 2020

If you are an i3 user you sometimes want certain applications to behave in a specific way, e.g. you want the window to float or be assigned to a specific workspace. For that you need to create a rule and define it in i3's config file (usually ~/.config/i3/config). The line looks something like
click code to copy
for_window [class="Nitrogen"] floating enable sticky enable
OK, but how do you know what class it is? It's not always the same as the applications official name. You can figure it out by using xprop. Of course you have to install if if you haven't already.

Just open your application and the terminal on the same workspace and in the terminal run xprop. You will see your cursor change to crosshairs and now you can click anywhere inside your applications window. In the terminal display you will notice all sorts of information, but what you need is a line beginning with
You will be presented with two names, the latter being the name of the class you need to use in your i3 rule (e.g. "Nitrogen" in the example above). Save your config file, reload i3 (usually Mod+Shift+R) and your rule should work.
Comments Add your comment

Enter the digit "six" (spam protection):