I am trying to set up XMonad so that multiple windows have gaps between them. The relevant part of my config file is as follows

import XMonad.Layout.Spacing

followed later by

myLayout = tiled ||| Mirror tiled ||| Full
    tiled = spacing 5 $ Tall nmaster delta ratio
    nmaster = 1
    ratio = 1/2
    delta = 3/100

The problem is that when one window occupied the whole screen there are gaps along the border. Is there a way to adjust my configuration so that these gaps do not appear when there is only one window?


Have a look at smartSpacing: (see Xmonad Spacing Docs)

Surrounds all windows with blank space, except when the window is the only visible window on the current workspace.

I.e., changing

tiled = spacing 5 $ Tall nmaster delta ratio


tiled = smartSpacing 5 $ Tall nmaster delta ratio

should to the trick.

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.