Pages

04 June 2014

Screenshot of the week 11

Maybe the most awesome window manager I've ever used is i3 and believe me, I have tried many of them over the years. I must admit that I was not really fond of tiling window managers, but this one excels far beyond the other ones I know, such as awesome or spectrwm

Here is a screenshot of my dual head desktop machine:


Note: I have not prepared the window arrangement for the screenshot. I simply opened some of the windows I use on an everyday basis, such as weechat, cmus, htop, a web browser and some terminals. (On a regular desktop environment I would have also opened a file manager, such as pcmanfm). I launched scrot to perform a test screenshot. Much to my surprise, I liked it and I said to myself, well, this is as good as any other.

Almost every tiling window manager has its own long list of features. However...

There are several things that make i3 outstanding. The first one is that it supports multiple monitors out of the box. In my case, my main desktop is a dual head, so it is really great to take advantage of so much space to fill with windows. I just need to use xrandr as I usually do for example for xfce4:

 $ xrandr --output VGA-1 --left-of DVI-I-1

Secondly, the way i3 deals with workspaces is really nice. With one single monitor, there is only one initial workspace, but you can create as many workspaces as you want by simply changing into them. This is to say, if the workspace you change into does not exist it gets created at once. If you have two monitors, there will be two initial workspaces (one per monitor), but you will still be able to create new ones.

You can arrange windows in three different layouts: split, stacked or tabbed. I normally simply split them but the other two layouts are very handy to have your windows in fullscreen.

Another feature that makes i3 out of this world is that you can be productive with it from the very moment you install it. Yeah, sure there is an small learning curve until you learn all the keybindings, but you can also perform many operations with the mouse as if you were using a regular desktop environment. What is more, with just one stroke you can make the windows float and move them around with the mouse.

The fact that the window focus follows the mouse is a bit annoying, I'd rather do it with the keyboard because if you move your mouse involuntarily into a window, you might find yourself typing passwords on the irc channel. Such is life, I know... but still embarrassing :-p

But there is a configuration option for that (the config file can be found at either .i3/config or .config/i3/config)

#  focus_follows_mouse <yes|no>
focus_follows_mouse no

Want more? i3 is faster than fast. In my dual head desktop, an old P4 machine, i3 loads in just 3 seconds. Yeah i3 loads in 3s. Ain't that really impressive?

Another thing I like is that you can load any applications you want at startup. You only have to use the exec command in your config file like this:

exec chromium
exec i3-sensible-terminal
exec dropbox start
exec gmail-notify

The config file is the right place to create your own keybindings. The documentation gives an example of how to use a key combination to take a screenshot. Using the example as a reference I have added a shortcut for the sound mixer:

# Open sound mixer
bindsym --release $mod+m exec alsamixergui

Imagine that you would like to have the mixer in all the workspaces. That is easy to achieve. One of the nicest features of i3 is the scratchpad. It is a window that you can have in all the workspaces by simply pressing a key. From the documentation:

# Make the currently focused window a scratchpad
bindsym $mod+Shift+minus move scratchpad

# Show the first scratchpad window
bindsym $mod+minus scratchpad show

It could also be useful for your notes, your text editor, your irc program...

Then $mod+c reloads the config file. Or alternatively $mod+Shift+r restarts i3 inplace

I could certainly go on and on. I think I will continue adding some more info as I discover new tricks. By the way, just as a curiosity. I had installed i3 a while ago but I had never really got very much into it until now. However, I remember using wmii and enjoying it. I even wrote a blog post here

At this very moment I'm reading the i3 user's guide trying to find super "kewl" things to try. I have already learnt by heart most keybindings. I especially like the $mod+f to toggle fullscreen mode. One thing that I do not understand is why the heck (on my stable machines) $mod+h splits the window vertically and  $mod+v splits windows horizontally. Both the config file and the user's guide say that $mod+h should split horizontally and $mod+v should split vertically. However they work the other way round, unless I'm going out of my head and horizontal and vertical do not mean horizontal and vertical respectively ;)

Update: It seems to work correctly on my sid machine. It might have been a bug.

I have installed i3 on almost all my machines (even on my tiny eeepc 701) and of course I'm writing this post using it. I hope you like it   ;)