Search code examples
xmonad

How can I split up my XMonad config into multiple files?


I'd assumed I'd need to add additional modules (files) to a cabal project file? But not too sure where I would find this?


Solution

  • The solution is burried somewhat in the FAQ: https://wiki.haskell.org/Xmonad/Config_archive#Modular_configs

    Create a lib directory, and place your modules there, you can them import them into xmonad.hs like so:

    import Path.To.Foo
    

    which would corresponde to the module located here: ~/.xmonad/lib/Path/To/Foo.hs


    When using GHCi you will need to add a .ghci file with the following: :set -i:lib