<div dir="ltr"><div>Hi all,</div><div><br></div><div>I'm a big fan of <a href="https://github.com/junegunn/fzf">FZF</a> and I wanted to make an xmonad integration, to work like <a href="https://hackage.haskell.org/package/xmonad-contrib-0.13/docs/XMonad-Util-Dmenu.html">Util.Dmenu</a>. I'm quite new to Haskell and I got some problems to do it.</div><div><br></div><div>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?</div><div><br></div><div>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:</div><div><br></div><div><div><i>(filePath, handle) <- openTempFile "</i>path<i>" "fzf"</i></div></div><div><i>hClose handle</i><i><br></i></div><div><div><i>(_, _, _, procHandle) <- runInteractiveCommand ("xterm -e '</i>dataForFZF<i> | fzf >" ++ filePath ++"'")</i></div></div><div><i>-- Here I need to wait that my term close, I tried: waitForProcess procHandle</i></div><div><span style="line-height:1.5"><i>-- But it just freeze my Xmonad, and not sure a while loop on getProcessExitCode is better</i></span></div><div><div><i>str <- readFile filePath</i></div></div><div>doSomethingWith<i> str</i></div><div><div><i>removeFile filePath</i></div></div><div><br></div><div>Anyone has a hint to do this?</div><div><br></div><div>Thanks a lot, cheers.</div><div><br></div><div>Thomas Droxler</div><div><br></div><div><br></div><div><br></div></div>