I have the following configuration on xmonad.hs, I really just want to add xmobar to the spawn pipe, but i dont know whats wrong. This is my config:

import XMonad

main = do
    xmproc <- spawnPipe "xmobar &"
    xmonad $ defaultConfig
        { modMask = mod4Mask -- Use Super instead of Alt
        , terminal = "xterm -fg white -bg black"
        -- more changes

And this is the error I get:

xmonad.hs:6:9: parse error on input `{'

There is a much simpler way to do this and you can see that in my xmonad config. Essentially the important lines are these ones:

-- put it all together
main = do
    nScreens <- countScreens    -- just in case you are on a laptop like me count the screens so that you can go
    xmonad =<< xmobar myBaseConfig
      { modMask = myModMask

That xmonad there is provided by this line here:

import XMonad.Hooks.DynamicLog (dynamicLogXinerama, xmobar)

You can see the documentation for the xmobar function here.

And using that you should be able to do this for yourself! Cheers. You may also be able to pick up some other tips from my XMonad config so I would suggest that you have a browse.

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.