Forcing Placement with i3

So I’ve been using i3 for a few months, and I have been working on getting things exactly as I like, and that means more fun with the configuration. Today I decided that I don’t want my Pidgin windows opening just anywhere, that I am locking them into place on the first workspace.

The Configuration

This is probably the easiest thing I have ever configured with i3, all I had to do was figure out how all Pidgin windows are named, classed, and handled, and then update my i3 config to catch the windows I want and assign them to the right workspace.


The first thing you need to know is the naming and class of your window that will be drawn to your machine. To get that info you need xprop. On an Arch Linux system you simply use pacman to install xorg-xprop. Once installed run xprop and then click on the window you want to assign.

The output will be something wild, but ultimately you are looking for a line like this:

WM_CLASS(STRING) = "Pidgin", "Pidgin"

The second value is the class of the window. So we will attach on that.

i3 Config

In my i3 config ~/.config/i3/config we simply add:

assign [class="Pidgin"] 1

Here we see the assign keyword, then the name of the class we are attaching, and then finally the workspace (1) that we want to force the window into.

Restart i3

Now you can restart i3 by pressing ctrl+shift+r and then open a pidgin window and it will attach to the first workspace.