One of the most popular tiling window managers out there, i3 is written from scratch. The developers claim that it is targeted towards advanced users, but it is certainly easy to use and configure. More so than its suckless alternative. Primarily due to its beautiful and well maintained documentation (some of the best docs I have ever seen for window managers), as well as an advanced user community who regularly chip in to make sure things keep running smooth.
I3 is written from scratch
- Setting up
- Getting started
- Modes of operation
- I3 uses the tree data structure for storing window references.
- It has different modes of operation. Which we will see in the upcoming sections.
- I3 assigns each workspace to a virtual monitor, thus implementing multi-monitor functionality correctly.
- It can be configured during runtime. Which means that any customization made does not require the service to be restarted.
- It uses the asynchronous XCB library instead of the old, synchronous XLIB.
Check out the I3 guidelines on their official website
One thing to note is the following statement clearly mentioned on their official website:
The usual elitism amongst minimal window managers: Don’t be bloated, don’t be fancy (simple borders are the most decoration we want to have).
However, we do not enforce unnecessary limits such as a maximum amount of source lines of code. If it needs to be a bit bigger, it will be.
Now I don't know about you guys but I think this is targeted at dwm for enforcing a 2000 SLOC limit on their development. But it is for you guys to decide :)
I3 is available for the following distributions. In addition, you can download the debian release, or just the tarball as well.
The easiest way to get started (on debian based systems) is this:
sudo apt install i3
To run it, simple add the following line in your
Logout and log back in again, and boom! You are good to go.
The first time you run i3, since you will not have a configuration template at
~/.config/i3/config, i3 will run the i3-config-wizard. Which will prompt you to generate a configuration automatically:
Once you do that, you will be greeted by your wallpaper, with a thin status bat at the bottom. Yes, i3 status bar is at the bottom by default. But this can of course easily be configured.
The default modifier in i3 is
<Alt>. To spawn a terminal, press
<Alt> + <Enter>.
When we do that for the first time, the screen looks something like this:
In i3, the status bar shows the number of active workspaces. I3 gives you 10 workspaces that we can switch between. To do so, simply hit
<Alt> + [1-9] for the first 9 and additionally
<Alt> + 0 for the 10th workspace. For example
<Alt> + 6 will take you to the 6th workspace. Note that whatever was running on the previous workspace keeps on running there as usual.
i3 uses vim bindings for movement. The only difference is that instead of using
h|j|k|l for movement, it shifts the bindings one key to the right and instead uses
|Default key binding
<Alt> + v
|Split window vertically on the next spawn
<Alt> + h
|Split window horizontally on the next spawn
<Alt> + [j/k/l/;]
|Move left-right-up an down windows
<Alt> + e
|Toggle horizontal and vertical
<Alt> + d
<Alt> + <Shift> + q
|Quit the currently running window
<Alt> + <Shift> + r
<Alt> + <Shift> + [1-9]
|Re-locate the current window to another wprkspace
<Alt> + <Shift> + 0
|Re-locate the current window the tenth wprkspace
<Alt> + s
|Turn on stacking mode (explained in the next section)
<Alt> + w
|Turn on tabbed mode (explained in the next section)
As mentioned earlier, i3 uses the tree data structure for storing window references in workspaces. Traversing through these windows is just like tree traversal. Now you have different modes of operation, and each mode tweaks the layout, but all in all it is just a tree data structure underneath. For example, in the given window split pane, the tree will look like the following:
This mode is used for spawning windows which are vertically split. To activate this mode, simple press
<Alt> + v. After this mode being activated, when you spawn programs next, either using shortcuts or dmenu, they will be vertically split.
This mode is used for spawning windows which are horizontally split. To activate this mode, simple press
<Alt> + h. After this mode being activated, when you spawn programs next, either using shortcuts or dmenu, they will be horizontally split.
Note: You can switch between horizontally and vertically split panes using
<Alt> + e toggle
Stack mode will place each and every tab on top of each other like a stack. Note that it is not actually a stack internally, but only visually so. To activate stack mode press
<Alt> + s.
Tabbed mode is exactly like the stack mode, the only difference being that it visually places the windows as tabs (the kind you might see on a browser). To activate it, press
<Alt> + w.
The i3 configuration lies in
~/.config/i3/config file. It uses an easy to use syntax for defining parameters. All of which are well documented on i3's official user manual. In this blog, we will be configuring our status bar as well as changing some key bindings to get started. In the next section we will learn how to add gaps between windows in i3.
See the full configuration tutorial for i3 here.
In i3 configuration, keybindings are defined by the
bindsym keyword, and the modifier (
<Alt> by default) is defined by
Now I am a long time vim user, so I am used to the vim's usual movement keys (h|j|k|l). In i3 everything is shifted to the left. Now let us try to change that. Find the following lines in the configuration:
And change it to use h|j|k|l instead of j|k|l|;. For the configuration to take effect, save the file and hit
<Alt> + <Shift> +r for live reload. You will now see the following prompt on top:
Whoa whoa! This wasn't supposed to happen right? I3 throws an error in the form of a red status line whenever there is an error in the configuration. So you will always get to know where you went wrong. How convenient is that! Just a quick show at the error log will make you realize that you cannot bind
<Alt> + h for moving left since it is already bound (for splith mode). To get rid of this error, just change the binding for splith mode like the following, and you should be good to go! Hit
<Alt> + <Shift> + r after making the change, and voila.
The bar at the bottom of your screen is called the status bar, or simply i3bar. It supports very low as well as high level customization, including:
- Changing aesthetics (color, font, opacity).
- Adding custom configuration
- Adding custom commands to be executed and shown on the i3bar
A full set of supported variables and customization can be viewed here.
The following is my configuration, which I have added at the bottom of my
# CSS-like element selector
# For the default i3 status bar information
# The nproc command will be executed and the result will be
# shown on the right side of the i3bar. You can add custom shell
# scripts here (after exec)
status_command exec /usr/bin/nproc
# The next two lines are for the font that I am using
font pango:DejaVu Sans Mono 14
# I want by i3bar to be at the top rather than the bottom
# The next section is for the i3bar colors and transparency
# i3bar uses the RGBA format for color specification where the A
# is for the opacity (which is optional).
# The RGBA string will be hexadecimal; so #[__][__][__][__]
i3bar_command i3bar --transparency
# RGBA format
# The fourth option accounts for the opacity
After saving the configuration and refreshing i3, the bar looks like this:
I3-gaps is a fork of I3 which adds additional functionality such as configuring gaps between windows. The best part about i3-gaps is that it is always kept up to date with the upstream, so any new update in i3 will also be reflected in i3-gaps. Check out the official repository here:
What is i3-gaps?
i3-gaps is a fork of i3wm, a tiling window manager for X11. It is kept up to date with upstream, adding a few additional features such as gaps between windows (see below for a complete list).
How do I install i3-gaps?
Please refer to the wiki.
Where can I get help?
For support & all other kinds of questions, you can ask your question on GitHub Discussions.
Note: In order to use gaps you need to disable window titlebars. This can be done by adding the following line to your config.
# You can also use any non-zero value if you'd like to have a border
for_window [class=".*"] border pixel 0
Now i3 has PPAs for Ubuntu and AUR's for Arch. If you want to build it from source, for other distributions, this gist will get you started on it.
Once you install it, you are good to go. Add the following lines (in the same config file) for configuring gaps between your windows:
# only works if i3-gaps is installed
# a window selector should be there
for_window [class="^.*"] border pixel 2
# defining inner and outer window gaps
gaps inner 10
gaps outer 10
Save and reload, and you are good to go. I3-gaps also has a smart gaps feature, where gaps can be turned on and off in a particular workspace in certain scenarios. I recommend checking out the official repository for the same.
I3 is free of bloat, and is very easy to learn. Even though it might be more complex than simpler alternatives like herbstluftwm, but learning it is easier due to the excellent documentation which makes for a fun exploration. I recommend everyone to try out i3.
The developers at i3 took a rather radical approach, building this wm from scratch, using a tree data structure. But the more I read up about i3, the more I see how well they have utilized this idea. I3 is not the best wm by far, but it is certainly one of the better ones.
|Simplicity of use
|❤️ ❤️ ❤️ ❤️
|Simplicity of Configuration
|❤️ ❤️ ❤️ ❤️
|Learning curve (lesser is better)
|❤️ ❤️ ❤️ ❤️
|❤️ ❤️ ❤️