Show applications in tiling or overlapping mode in i3

This blog collects some key but tricky configurations that used for i3 window manager. For more, one may refer to the official user’s guide.

Tiling/overlapping windows

There might be applications that you prefer to run in the overlapping mode, such as GoldenDict, or some popup dialogues like composing new emails in Thunderbird. To customize these behaviors, we need to first get their IDs and then configure them specifically in ~/.config/i3/config. For example,

1
2
3
4
5
6
7
for_window [class="GoldenDict"] floating enable resize set 800 550
for_window [class="Chromium"] border pixel 0
for_window [title="Save File" class="Chromium"] border pixel 3
for_window [instance="Msgcompose" class="Thunderbird"] floating enable
for_window [instance="Steam" class="Steam"] floating enable
for_window [instance="sun-awt-X11-XFramePeer" title="Figure*" class="MATLAB*"] floating enable
for_window [title="Remmina Remote Desktop Client" class="org.remmina.Remmina"] floating enable

Window identifiers

To retrieve the identifiers of these specific windows, you need to use a tool, xprop. Run xprop in terminal, then you move your mouse over the target window/dialogue and left click it. Go back to the terminal where you run xprop, you will see all the identifier information related to this window. Here is a list of terms in the xprop output:

  • WM_CLASS: mostly the first and the second strings are the same. The first string refers to instance in i3/config and the second refers to class.

  • WM_NAME: mostly we don’t need this identifier, which refers to title in i3/config. However, you need to specifies a particular dialogue of an app, you may not distinguish it from the other dialogues by only using WM_CLASS. For example, we prefer to show MATLAB figure plot windows in the overlapped mode.

For most settings, only class is required, and thus one may use xprop | grep CLASS to get a short output of xporp.

Configure tiling/overlapping rules

By default, every window is in the tilting mode. If you want an app or a window shown in the overlapped mode, you need to specify key words floating enable. For example,

1
for_window [instance="Steam" class="Steam"] floating enable

If you prefer a default window size, you may specify it by resize set HEIGHT WIDTH. You could append it after other specifications, for instance,

1
for_window [class="GoldenDict"] floating enable resize set 800 550

Default workspace to applications

You may prefer to always using one workspace to show a specific application. For example, I use workspace 1 for Thunderbird and workspace 2 for Chromium. We can use the following configurations:

1
2
assign [class="Thunderbird"] $ws1
assign [class="Chromium"] $ws2

Again, the class string can be retrieved by xprop.