Linux

Where Is the XMonad Config File?

Where XMonad looks for xmonad.hs on Linux, and how recompiling and the XDG paths work.

Last updated

XMonad configuration is a Haskell file that gets compiled into the window manager itself. The preferred home is ~/.config/xmonad/xmonad.hs, with the legacy ~/.xmonad/xmonad.hs still honored. Env vars can relocate all three dirs.

Pressing Mod+q recompiles and restarts in place. That tight loop is the whole workflow: edit, recompile, keep going. Keep a known-good copy aside, since a type error leaves you on the previous binary until it builds.

Where XMonad stores this, by platform

Linux
~/.config/xmonad/xmonad.hs

Haskell config compiled into XMonad. Rebuild with Mod+q or xmonad --recompile. Extra modules go in lib/ beside it. Legacy ~/.xmonad/xmonad.hs is still read.

Frequently asked questions

How do I create and apply an XMonad config?

Write ~/.config/xmonad/xmonad.hs (a minimal main = xmonad def works), then press Mod+q to recompile and restart. Run xmonad --recompile in a terminal to see build errors plainly. Legacy ~/.xmonad/xmonad.hs still works.

Can I move the config elsewhere?

Set XMONAD_CONFIG_DIR (plus XMONAD_DATA_DIR and XMONAD_CACHE_DIR) to relocate everything. Otherwise XMonad uses ~/.config/xmonad or the legacy ~/.xmonad, with the compiled binary cached under ~/.cache on XDG layouts.

Notice an outdated path? Let us know.