Hi all,

I'm a big fan of FZF and I wanted to make an xmonad integration, to work like Util.Dmenu. I'm quite new to Haskell and I got some problems to do it.

The main problem I have is that fzf needs to run in a shell and when I run an external terminal, it sucessfully pops up, but then the rest of the code continue to be executed and I can't wait for the output of fzf. Moreover, fzf give an output in the terminal, but then how do I get the output in my haskell code?

I tried several think and the closest I got is to write the result of fzf in a file and read it back, but I cannot wait until my terminal shutdown to read my file, I have something like:

(filePath, handle) <- openTempFile "path" "fzf"
hClose handle
(_, _, _, procHandle) <- runInteractiveCommand ("xterm -e 'dataForFZF | fzf >" ++ filePath ++"'")
-- Here I need to wait that my term close, I tried: waitForProcess procHandle
-- But it just freeze my Xmonad, and not sure a while loop on getProcessExitCode is better
str <- readFile filePath
doSomethingWith str
removeFile filePath

Anyone has a hint to do this?

Thanks a lot, cheers.

Thomas Droxler