      libTs <- mapM getModTime . Prelude.filter isSource =<< allFiles lib
      srcT <- getModTime src
      binT <- getModTime bin
-@@ -586,7 +588,7 @@ recompile force = io $ do
+@@ -643,7 +645,7 @@ recompile force = io $ do
          status <- bracket (openFile err WriteMode) hClose $ \errHandle ->
              waitForProcess =<< if useBuildscript
                                 then compileScript bin cfgdir buildscript errHandle

 import Graphics.X11.Xlib
 import Graphics.X11.Xlib.Extras (getWindowAttributes, WindowAttributes, Event)
 import Data.Typeable
@@ -571,6 +572,7 @@ recompile force = io $ do
         lib  = cfgdir </> "lib"
         buildscript = cfgdir </> "build"
 

 
         -- re-enable SIGCHLD:
         installSignalHandlers
@@ -653,6 +655,7 @@ recompile force = io $ do
             then trace "XMonad recompilation process exited with success!"
             else do
                 ghcErr <- readFile err
+                xmessage <- fromMaybe "xmessage" <$> liftIO (lookupEnv "XMONAD_XMESSAGE")
                 let msg = unlines $
                         ["Error detected while loading xmonad configuration file: " ++ src]
                         ++ lines (if null ghcErr then show status else ghcErr)
@@ -660,7 +663,7 @@ recompile force = io $ do
                 -- nb, the ordering of printing, then forking, is crucial due to
                 -- lazy evaluation
                 hPutStrLn stderr msg
-                forkProcess $ executeFile "xmessage" True ["-default", "okay", replaceUnicode msg] Nothing
+                forkProcess $ executeFile xmessage True ["-default", "okay", replaceUnicode msg] Nothing
                 return ()
         return (status == ExitSuccess)
       else return True
@@ -678,16 +681,16 @@ recompile force = io $ do
            '\8216' -> '`'  -- ‘
            '\8217' -> '`'  -- ’
            _ -> c
