I found the answer to my question.
First you must add your import:
import XMonad.Actions.SpawnOn
Then, under your main function, there is something like:
main = do xmonad $ defaultConfig { manageHook = myManageHooks <+> manageSpawn <+> manageDocks <+> manageHook defaultConfig , startupHook = myStartupHook , ETC.....
The key here was to add manageSpawn to the manageHook line.
Then replace spawn with spawnHere :
, ((modMask, xK_w), spawn "chromium")
becomes:
, ((modMask, xK_w), spawnHere "chromium")
Nick
source share