
On Mon, Jul 23, 2007 at 10:49:11PM -0700, Stefan O'Rear wrote:
Actually, commands uses dmenu synchronously and parses the string in-process. While it would be nice to control xmonad using a socket model, ISTR sjanssen saying { -package X11 is nearly impossible to use with threads, and this is one of the main motivations for XHSB. }. You can kluge around it by adding a handler for root PropertyNotify events on XMONAD_COMMAND and dispatching accordingly, then use xprop to control it; thus embedding the control channel over X11. (Not a small task, but most of the details could be in a re-usable contrib module...)
I think the idea is cool, if I get it right. But I believe that it would require a small modification to Main.handle. by the way, attached you'll find just a proof of concept. SeverMode.hs must be used as a contrib module: - save it in XMonadContrib - import it from Config.hs and add something like: , ((modMask .|. controlMask, xK_s), startServer) in the keymap settings. be careful! when you start the server mode XMonad will be blocked and the only way you can unblock it is by sending a "restart-wm" command! then there's is the sendCommand utility: - compile it with ghc --make sendCommand.hs -o sendCommand To send a command, after you started the server mode, run: sendCommand "command" Remember to open an terminal with the focus before starting the server mode. As I said, this is just a joke to have some fun with. I don't know if this is what you had in mind. Let me know please. Ciao Andrea