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

How do I change the layoutHook line to keep the existing configs, while also adding my three-column tile layout?


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.

  • Ah, I see. Looking at the default config, it is very simple. I've taken your advice, and it's working very well. Thanks! Sep 22 '12 at 5:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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