Skip to content

Tiling window managers and awkward programs

I like tiling window managers for a number of reasons. I value simplicity and they don't waste resources and screen space with lots of icons and other stuff I don't need or want. As I say elsewhere, my current favourite is spectrwm.

But one problem with all the tiling WMs I've tried is that they tend to fall down with some programs, such as the gimp and xsane, which open several floating windows. Even worse, some, such as xaos, simply segfault. You can get round the difficulty to some exten by using floating mode but it isn't ideal. The problem has been frankly acknowledged on the spectrwm mailing list, where the developers say it will be worked on when there is time but it isn't a priority. On the i3 list the developer says that tiling WMs are not really suitable for floating windows.

(Note added 21.2.2016: spectrwm is currently working fine with tiling programs so I don't need to do what is written below, but I'm keeping it because it may be useful to someone.)


So what is the solution if, like me, you prefer tiling WMs but do sometimes need programs that open multiple windows?

One tiling WM, ratpoison, takes an intriguing way out, by making it possible to switch window managers on the fly. I don't know of any others that do this but it's easy to achieve the effect yourself. I have a script called wmswtich which runs the following command:

xinit .xxinitrc -- :1 &

The .xxinitrc file is a duplicate of .xinitrc except that it uses icewm instead of spectrwm. Running the script produces a second version of X. With spectrwm this is in F2 and the script takes me there automatically, with icewm running. To go back to spectrwm (in F1) I press Shift-Alt-F1 or else simply exit icewm if I've finished using it.

This should work for any tiling/stacking WM combination, of course; these are just the ones that I use.

Four tiling window managers: spectrwm, i3, dwm, xmonad

INTRODUCTION
For several months last year I was trying out various tiling window managers and here I offer my assessment of the ones I've used most. There's more about many of them, including configuration files, elsewhere in this blog (see the tags list). My final preferences:

(1)spectrwm => (2)dwm => (3)i3 => (4)xmonad

THE WINDOW MANAGERS IN MORE DETAIL

1. Spectrwm
This is currently my favourite. It used to be called scrotwm and this rather unfortunate and juvenile-sounding name put some people off. When I tried it some time ago it seemed a little buggy but that is much better now. Configuration by a plain text file is simple. I prefer the lack of window titles at the top and I find spectrwm more intuitive to use than i3. The default window layout is similar to those of dwm and xmonad; it is easy to change the arrangement. It is also easy to switch to a different workspace (desktop) with Mod+Arrow, which I particularly like. The bar at the bottom of the screen is toggled on and off with Mod+B, another good feature. I should say that spectrwm is the most flexible and intuitive WM that I've tried. Currently I'm using it as my default window manager. Download Spectrwm here (updated link).

Here are some screenshots. (Actually, I work fullscreen much of the time, with a browser on one workspace, mutt on another, and so on.)

A screen with three windows (left = master)
Screenshot 1


Change master window (Mod + Return)

Screenshot 2

Enlarge master window (Mod + L)
Screenshot 3


A horizontal display (Mod + Space)

Screenshot 4


Make a window fullscreen.(Mod + E)

Screenshot 5


Switch to Workspace 2 from Workspace 1 (Mod +2 or Mod + R. arrow)
Screenshot 6

Note: the xsane windows are floating (set via Quirk in ~/.spectrwm.conf).


2. Dwm
Dwm is the forerunner from which many other tiling WMs forked. There is still a lot going for it: it's simple and functional and easy to learn. Configuration is via C, but don't be put off; it's easier than it looks even if you don't know C (I don't). If you are not willing to embark on learning Haskell, dwm would be an attractive alternative.


3. I3
I liked i3 quite a lot and used it for a time. Configuration is simple since it is done in plain text. The default tiled layout has the windows arranged in columns across the screen which I don't much care for. But I mostly work in stacked mode, and i3 does well like this. The only problem is that if you have a number of windows open their titles list takes up a lot of space at the top of the screen in stacked mode. Admittedly you can fix this by going into full-screen mode, although you must exit that to switch to a different window. But while I liked i3, I found that everything I wanted to do with it could also be done in spectrwm and usually more easily and intuitively.


4. Xmonad
T
his has a large user base and a helpful mailing list. It has many of the features I want but is let down by its being written in Haskell, which makes any configuration beyond the most basic a major undertaking requiring hours of research on the internet. There is also a large overhead in terms of disk space required to house the libraries needed for said configuration. For these reasons Xmonad loses out to its competitors, at least for me.

Three tiling window managers compared - xmonad, dwm, and i3

Update: This post is a bit out of date. My current favourite is none of those discussed here, it's spectrwm. For more about this, please see Four tiling window managers. Download Spectrwm here.

Introduction
As you may know if you have followed some of the previous posts here, I used icewm as my window manager for a good many years, because I liked its simplicity and unobtrusiveness. As its documentation says, it does its work and gets out of your way. Just what I like.

As time went by I found I was working more with windows in fullscreen mode rather than stacked, swapping between them as needed. Icewm has a menu that allows you to do this, so you know what you have open. But it then occurred to me that I was using icewm as if it were a tiling WM. So why not look into the world of real tiling WMs to see if there was something that would suit me even better than icewm?

I first tried xmonad, which I liked a lot. But, being written in Haskell, it was pretty difficult to configure. So I next looked at dwm, which is visually and functionally similar to xmonad, with quite similar default key bindings. It was simpler to configure than xmonad, being written in C. I don't know C but I found it considerably easier to guess how the configuration file worked than was the case with xmonad, with its Haskell code.

One minor disadvantage of dwm was that to test a new configuration involved restarting the thing, but since I didn't keep making changes that wasn't too serious. What I found more annoying was the lack of anything like a menu to show what other windows were open. In other words, if I was viewing the browser and wanted to switch to, say, mutt, I ended up cycling blindly through the windows until I arrived where I wanted to be - and it was easy to overshoot. Of course, I could also go to tiled layout and choose the correct window there, followed by a return to fullscreen, but it was not very intuitive..

I3
I then had a look at i3. I hadn't done so previously because the docs said it was primarily for developers, but I liked it quite a lot. I used it for a time but I have now switched to spectrwm, as indicated at the head of this post. I find that spectrwm offers the same features as i3 and is more intuitive to use. If you like i3 please do look at spectrwm as well.

Here is the default tiled layout, with several windows open. The browser is the selected window in this case. I can easily add another window with Mod+Enter, or I can start a new application using dmenu (Mod+d).



Now I press Mod+w to get the tabbed layout, which shows the selected window (my home page in my browser). Although this occupies the whole screen apart from the upper and lower bars, it is not actually fullscreen. I can change to any of the other windows by shifting to a different tab, either with the keyboard or with the mouse.




If I want true fullscreen (seldom needed), I press Mod+f. Now the bar disappears. In this mode I can't switch to a different window; I must toggle fullscreen with Mod+f again to return to tabbed layout. To shift to a different window I must first press Mod+f again to get back to the tabbed layout.



There is also an alternative layout to tabbed - the stacked layout (Mod+s). which is what I use most of the time.



I emphasise that this by no means exhausts all the options that i3 offers. For example, you can have the windows tiled in a grid, e.g. 4x4, and you can have different workspaces as you do in other WMs. These are called tags in dwm, but they work in the same way. I can see why they would be useful if you had a lot of applications open, but seldom have more than 3 or 4 windows open and using more workspaces would be confusing. (See the official i3 web page for details of all this.)

The main exception is xsane, used for manipulating my flatbed scanner. This opens several drop-down windows, and these work best if you change to floating mode (shift + mod + space). I find it's best to do this in a separate workspace, otherwise it becomes confusing.

Configuring i3 is very easy*; you just edit the config file (~/.i3/config). This is a plain text file. Here is my config, with comments. Note that i3 has a strange idea of the keys to use for moving around: instead of h,j,k.l it shifts everything to the right and uses j,k,l,semicolon. As I'm used to h.j,k,l in vim I changed the default arrangement in i3. If you do this you must also change Mod+h (which by defajult gives a horizontal arrangement of windows), otherwise you will get an error message because you have Mod+h mapped to two different commands.

*These remarks apply to the current version of i3 -4.1. Previous versions were a bit more complicated to configure.

Note: If you ever find that i3 seems to have locked up, so that you can't change to a different tab, check first that you are not fullscreen. If that is not the problem, do Mod+Shift+R to reload, which should make things work again.



Which tiling wm - dwm or xmonad?

Update: My current favourite WM is spectrwm. Please see Four tiling window managers: spectrwm, i3, dwm, xomonad.

I used xmonad for several weeks and liked it a lot, but I decided to have a closer look at dwm. This is the tiling window manager from which xmonad forked a few years ago and the two are still quite similar in terms of appearance and function. You can change from one to the other almost seamlessly.

So if they are so similar, why think of making a move? Mainly, easy of configuration. Xmonad is written in Haskell, and although I did manage to get my configuration file working more or less as I liked it was quite hard work and there were still some problems. For example, if I wished to have new key bindings the process of doing, this seemed impossibly complex and non-intuitive. Even when I did get things working, I had little idea of why it worked and no real understanding of the code.

But would dwm be any better? It is written in C, which I don't know - in fact, I'm not a programmer. That put me off even looking into dwm originally, but when I did so this time I found that I could work out what most of the lines in config.h (the file you have to edit to customise dwm) were doing. Simply by writing lines that were similar to those in the default config.h I was able to achieve what I wanted, including adding or modifying key bindings. The suckless.org site, which produces dwm, has examples of configuration to help you out if you get stuck.

Are there any disadvantages in using dwm instead of xmonad? Not really. Both are excellent window managers and, as I say, there is nothing to choose between them in terms of basic functionality. Xmonad has a lot of third-party modifications available but I don't need them (and usually find them difficult to get working when I do try them out). Xmonad seems to have a large and helpful user community (though dwm also has a user community and, to judge from its mailing list, quite an active one too).

So, to conclude: dwm and xmonad would both be good choices for a tiling window manager. If you know C it would be natural to choose dwm. Even if you don't, I think you would find dwm easier to configure than xmonad; at any rate, I do. For me this gives dwm a slight advantage over xmonad.

There are details of my experience of setting up dwm on my linux page.

Xmonad configuration (Spiral layout)

I'm currently using the Spiral layout for Xmonad. I like its appearance and it eliminates the horizontal option provided by the standard layout, which I don't much like.

The analogue clock in the lower left-hand corner is provided by the program buici-clock, which integrates well with Xmonad.

Here is my xmonad.hs:

------------------------------------------------
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
import XMonad.Layout.Spiral

myManageHook = composeAll
[ resource =? "gimp" --> doFloat
, resource =? "xpaint" --> doFloat
, resource =? "display" --> doFloat
, resource =? "mplayer" --> doFloat
]

myLayout = spiral (6/7) ||| Full
main = xmonad defaultConfig { layoutHook = myLayout }

{ modMask = mod4Mask
, terminal = "xterm"
, borderWidth = 2
}
--------------------------------------------------

Switching to Xmonad

Note added 14 December 2013
I'm keeping this post for historical reasons but I now use spectrwm not xmonad. For my reasons, please see Four tiling window managers.


A week ago I posted a piece about using Icewm to imitate, more or less, the function of a tiling window manager like Ratpoison. This worked pretty well but I still felt an attraction to the idea of a pure tiling WM. I don't want 'eye candy' such as window decorations or background images, nor do I find a need for icons or docks. I use only a small range of programs with any frequency (Iceweasel/Firefox, Mutt, and Vim/Gvim), and I don't need a lot of windows open - in fact, they would be a distraction. These days I increasingly feel drawn to bare simplicity, with no frills or fripperies.

So I went back to looking at tiling WMs again, and after some experiments decided that Xmonad was pretty close to what I was looking for. It can be driven almost entirely via the keyboard, but, unlike Ratpoison, you can use the mouse as well if you want to. There is an option to have floating windows, which means that the Gimp, for example, is usable. (I don't need it much but just occsionally I do.)

When Xmonad starts you see a blank black screen, which is about as basic as you can get! If you press the Mod key (Alt by default) plus Shift and Return a text terminal appears. Pressing the same keys again produces a new window, with the screen split vertically in two. Further presses give more windows in a vertical column on the right side of the screen. With Mod+Space you can change the display to show the windows tiled horizontally or you can have just one window occupying the whole screen.

Other simple key combinations allow you to move the focus from one window to another, change the size of the 'Master' window, and so on. You can use different workspaces, as you do in Icewm, and you can move any window to a different workspace, again as you do in Icewm.

Currently I'm using Xmonad on all my computers and am likely to stick with it. This is the first time in years that I've been tempted away from Icewm. Why am I making the change?

I wouldn't say Xmonad offers any clear advantage over Icewm. The functionality in both is much the same. As much as anything, I suppose, my current preference for Xmonad is aesthetic and conceptual - I like its uncompromising simplicity. But perhaps I will switch back in the future - who knows? (Perhaps I'll even end up with something like Compiz, though I doubt it.)

Actually, if you really want to tart Xmonad up you can do so with the help of a large number of bolt-on modules provided by external contributors. See the extensive documentation for details. For example, you can arrange the windows in a circle or even in a Fibonacci spiral!

Any disadvantage in using Xmonad? Yes, one obvious one: instead of configuration being done in text files, as it is in Icewm, you have to use the Haskell programming language and recompile. But this can be done without restarting Xmonad and at least there is only one file to edit. Still, I have to admit that it was this dependence on Haskell that put me off trying Xmonad for a long time and instead caused me to look at Ratpoison, which uses a text file. But, in practice, the Haskell business is not as bad as I'd feared it would be.

Most of the defaults in Xmonad were fine for me. I did need to use a different Mod key, because my Alt key is doing a lot of things in Vim. Also, I wanted wider and more obvious window margins (they change colour when the window receives focus). But I quite easily found sample configuration files on the Internet which I could adapt to my needs without the need to learn Haskell. Perhaps I will do so in the future, to try out some more ambitious things, but for the moment it's fine.

I certainly realise that Xmonad, or any other tiling WM, is never going to suit the majority of people, especially not those who expect something vaguely Windows-like. But it does appeal to some, as a quick trawl through Google will show. For anyone thinking of trying it out who still feels a bit apprehensive, I've given more details about my experience to date on my Linux page Using Xmonad.

Tiling window managers for X - Icewm and Ratpoison

Update: This discussion is out of date. I now use tiling WMs exclusively and my favourite is Spectrwm. Please see the tags for more details.


I'm a committed Linux user. I don't like desktop managers such as KDE, Gnome, or XFCE. I've no use for eye candy, background images, icons, and the rest, so I use the plainest window manager (WM) I can find that does the job, I've tried a lot of different ones in the past but have always come back to Icewm in the end. But lately I'm using it in a different way, to make it more similar tol Ratpoison.

Why Ratpoison? Most of the WMs I tried merely added stuff I didn't want. The one exception to this was the tiling WM family, like Ratpoison, dwm. or Lunchbox - there are quite a few. I like the idea of their simplicity and functionality. I did try some of them but most, apart from Ratpoison, were difficult to configure, and anyway, I decided that the tiling business wasn't much of an improvement on the stacking offered by Icewm.

Recently, while googling, I noticed that quite a lot of Ratpoison enthusiasts didn't tile at all but always worked fullscreen. That, I thought, would suit my style of working well, since I seldom need to see more than one application at a time. I do have Mutt and Iceweasel running but they were parked in workspaces of their own. Anyway, I installed Ratpoison again and ran it fullscreen, without tiling. I quickly realised that this was exactly what I wanted.

But things weren't perfect. Graphical programs such as the Gimp were said not to work very well in Ratpoison because of their floating windows. The solution suggested for this was to replace Ratpoison temporarily with another WM - Ratpoison has a command for this. That worked; I could swap back to Icewm for the moment. But then it occurred to me that if I ran my favourite Icewm fullscreen I would get almost the same effect as Ratpoison while preserving all the things I like about Icewm. So that's what I'm doing now.

Ratpoison, as the name implies, doesn't use the mouse at all. Icewm does allow the mouse but it is entirely usable without it; there are keyboard commands for everything. This suits me perfectly; I prefer to avoid the mouse whenever possible but there are times when it is useful to have it. So now I see only one application at a time, filling the whole screen; I can swap back and forth to any others that are open, mostly just using Alt-Tab. I hardly ever need to have more than one application visible, but occasionally it is useful to do so, for example when looking at a cheat sheet to remember keys or for copying stuff from one application to another (mouse needed here). For that purpose I have a second workspace available.

Previously I used to have seven workspaces, which was sometimes annoying if I couldn't remember where I'd opened something. Now I work in the same work space all the time but if, rarely, I want a second application to be visible, I swap across briefly to the other workspace (I've named them Main and Temp )

I realise that this setup wouldn't suit everyone but so far it does suit me, so I thought I'd share it.