i3 – tiling window manager

In the last few days my attention was unfairly distributed between a whole lot of tasks.  The fragmentation and constant context switching affected my productivity, so I briefly revisited my toolbox setup, in hopes to find something that I didn’t know about, forgot about, or have greatly underutilized.

One of the things that came (again) on my radar was terminal multiplexer tmux.  I’ve blogged about it before.  I used it for a while, but at some point, it faded away from my daily routine.  The two most useful features of tmux are:

  1. Persistent sessions, where you can work on a remote machine, detach your terminal, disconnect from the machine entirely, and then, at some point later, connect again and continue from where you left off.  With simpler workloads and reliable Internet connection, this became less useful to me.  When I do need this functionality, I use screen, which is more often installed on the machines that I work with.
  2. Terminal multiplexer, where you can split your terminal screen into a number of panels and work with each one like it’s a separate terminal.  This is still useful, but can be done by a number of different tools these days.  I use Terminator, which supports both horizontal and vertical screen split.  Terminology is another option from a choice of many.

I thought, let me find something that people who used tmux have moved on to.  That search led me, among other things, to “ditching tmux” thread on HackerNews, where in the comments a few people were talking about i3 tiling window manager.

Window manager discussions tend to trigger a certain interest in me.  I started using Linux back in the 90’s, when GNOME didn’t exist yet, and KDE wasn’t as widely known as it is today.  I’ve been a long time user of AfterStep, which I loved dearly and miss to this day (even though it is still around, I don’t think it is as useful today as it was back then).

Looking at the screenshots and screecasts of i3 wm (this cast in particular), I thought it was worth a try.  Terminal multiplexers are fine, but my work involves GUI applications as well – most commonly a web browser.  i3 seems to offer what I need – keyboard navigation, efficient window management, and minimalistic, distruction free environment.

Getting it installed and launched on my Fedora 25 laptop wasn’t too difficult, but involved more than any one particular tutorial would mention.  Here’s what I had to do.

First, follow “Getting started with the i3 tiling window manager” tutorial to get i3 installed:

sudo dnf install i3 i3status dmenu i3lock xbacklight feh conky

Secondly, try to logout from your current session and see if you get a window manager switch option on the login screen.  If you do, then just pick it and you are in.  For me it wasn’t there.  Not just the i3 option, but the whole window manager choice wasn’t present.  After a bit of head scratching and searching, I found the solution – switch from lightdm to gdm as the login/greeter application.

sudo systemctl disable lightdm.service
sudo systemctl enable gdm.service

If the enable command above fails, then you also need to install the GDM itself:

sudo dnf install gdm

OK. Now for a logout and reboot.  GDM kicks in with the new login screen and the i3 window manager option is finally there, and we can return to the i3 tutorial.

How much of i3 settings you want to change and tweak is up to you.  For me, for now, the only necessary change was the switch of the terminal back to my beloved Terminator.  All I had to do for that is edit ~/.config/i3/config and change the following line:

# start a terminal
#bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Return exec terminator

Once the file is saved, Alt+Shift+r reloads the configuration and the next Alt+Enter starts the Terminator instead of the i3 sensible terminal.  All in all, pretty simple.

The next issue that I had to figure out immediately, was my network connection.  In MATE, my previous window manager, there was a little task bar icon for NetworkManager, which would allow me to connect to WiFi quickly and without any hassle.  In i3, there is no task bar and there is no icon.

Gladly, NetworkManager provides the command line interface – nmcli.  Here’s how to use it to connect to your WiFi:

nmcli device wifi connect My-WiFi password "my-password"

There’s also an option of text user interface, but for that you’d need to install an extra package:

sudo yum install NetworkManager-tui
nmtui

With all of that, I can continue with my work. Here’s how my desktop looks right now:

It’s just been a few minutes, but I’m already liking it quite a bit.  i3 allows me to utilize slightly more screen space, by not having panels or task bars.  It also has a very intuitive set of keyboard shortcuts and provides quick access to full screen toggle for the current window.  It really feels like the Terminator, where you can work with other applications, not just console.

I’m sure I’ll learn more about it in the coming days.  One thing that I want to see when I go back to the office on Monday is how well i3 works with multi-monitor setups.

If you haven’t tried i3 yet, I strongly recommend you do.  If you have already, feel free to throw any tips, tricks, and configuration snippets my way.  This is my day zero.

Update: Here are a few additional things that I did once I actually started using i3.

Disable focus following the mouse, aka click-to-focus

Add the following line to ~/.config/i3/config:

# Click to focus
focus_follows_mouse no

Setup keyboard layouts

I use English and Russian, with Right Alt as toggle key. Add the following line to ~/.config/i3/config (this page was useful, and also this one):

# US/RU keyboard layouts (switch with Right Alt)
exec --no-startup-id "setxkbmap -model pc105 -layout us,ru -option grp:toggle"

Look at other i3 tools

i3 comes with a few handy tools.

  • i3status, which is a small program that generates the i3 status bar.  You can completely disable it or customize it to your liking.  The easiest way to go about it is to copy /etc/i3status.conf to ~/.i3status.conf and play around with options.
  • i3lock, which is a small screen lock program that you can also customize.

2 thoughts on “i3 – tiling window manager”

Leave a Comment