
Brent Yorgey
1) the quickest solution is to use "xdotool" [http://www.semicomplete.com/projects/xdotool/], which can (among other nifty things), send a fake keypress to the currently focused window::
("C-z C-z", spawn "xdotool key ctrl+z")
Nifty! Would you mind adding this to the FAQ page on the wiki as a lightweight solution? Many people have asked for this.
Done.
With the following code, I have been able to send a Ctrl+Z to urxvt and "xev" windows directly from XMonad::
I could have sworn there was already a contrib module that does this, using code similar to what you wrote. But I can't find it. Perhaps it just got kicked around on the ML but never actually made it into the repo. Anyway, the xdotool is a nice solution regardless.
XMonad.Util.Paste (found by grepping the sources in the darcs repo). I have added a mention to it in the FAQ above. Will it be released in 0.9? Cheers, Riccardo