Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm a Haskell and XMonad beginner. I'm trying to set up my tiling layout to allow three side by side columns (so that I can have three simultaneous tall and thin Vim instances for coding, per workspace).

In the docs, I've found a three-column layout function, and even managed to import it and define a custom layout, but I'm not sure how to add it to my layoutHook, which already has some stuff defined from a tutorial I read, to keep my xmobar safe from window covering.

The relevant lines of my xmonad.hs:

import XMonad.Layout.ThreeColumns
threeLayout = ThreeCol 1 (3/100) (1/2)
main = do
    xmonad $ defaultConfig
    { manageHook = manageDocks <+> manageHook defaultConfig
    , layoutHook = avoidStruts $ layoutHook defaultConfig

So this is basically a noob syntax question. How do I change the layoutHook line to keep the existing configs, while also adding my three-column tile layout?

share|improve this question
up vote 4 down vote accepted

I simply forget about default config and start defining things on my own. So going that route:

myLayoutHook = avoidStruts(smartBorders(ThreeColumns ||| Circle ||| Grid ||| ANY_OTHER_LAYOUT_YOU_USE)
main = do
    xmonad $ desktopConfig
        { layoutHook = myLayoutHook

This also has avoidStruts, which seems to be what you want when you say you want to keep the existing config. smartBorders is another nice thing that hides the border when not needed, for example when you have only one window on one screen.

share|improve this answer
Ah, I see. Looking at the default config, it is very simple. I've taken your advice, and it's working very well. Thanks! – ire_and_curses Sep 22 '12 at 5:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.