My Xmonad Config

Before doing everything, just install all the packages you need.
1. Xmonad
2. xmobar
3. dwm

The xmonad.hs config

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Layout.Spacing    
import System.IO

myWorkspaces = ["1:web","2:sublime","3:staging","4:SEO","5:work","6:sync","7","8","9"]

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

myManageHook = composeAll
    [ className =? "Gimp" --> doFloat
    ]
 
main = do
    xmproc < - spawnPipe "/usr/bin/xmobar /home/hans/.xmobarrc"
    xmonad $ defaultConfig
        { manageHook = manageDocks <+> myManageHook
        , layoutHook = avoidStruts $ myLayout
        , borderWidth = 2
        , normalBorderColor = "#6b4517"
        , focusedBorderColor = "#0db7e1"
        , logHook = dynamicLogWithPP xmobarPP
                        { ppOutput = hPutStrLn xmproc
                        , ppTitle = xmobarColor "green" "" . shorten 50
                        , ppLayout = const ""
                        }
        , modMask = mod4Mask
        , workspaces = myWorkspaces
        } <code>additionalKeys</code>
        [ ((mod4Mask .|. controlMask, xK_l), spawn &quot;xscreensaver-command -lock&quot;)
        , ((0, xK_Print), spawn &quot;sleep 0.2; scrot -s&quot;)
        ]

And never forget the xmobar Config .xmobarrc

Config { font = "xft:Bitstream Vera Sans Mono:size=9:bold:antialias=true"
       , bgColor = "black"
       , fgColor = "grey"
       , position = TopW R 100
       , lowerOnStart = True
       , commands = [ Run Network "wlan0" ["-L","0","-H","32","--normal","green","--high","red"] 10
                    , Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
                    , Run Memory ["-t","Mem: <usedratio>%"] 10
                    , Run Swap [ ] 10
                    , Run Date "%a %b %_d %Y %H:%M:%S" "date" 10
                    , Run StdinReader
                    ]
        , sepChar = "%"
        , alignSep = "}{"
        , template = "%StdinReader% }{ %cpu% | %memory% * %swap% | %wlan0% | <fc =#ee9a00>%date%</fc>"
}