WARNING: This module will have the following issue if xmonad wasn't compiled with -threaded
(requires a modified xmonad-version): Expressions will only get evaluated when xmonad
receives an event, for example when the focus changes.
This module is highly experimental and might not work as expected or even cause deadlocks
when used with -threaded, due to the fact that xlib isn't reentrant.
This module lets you create a server that evaluates Haskell expressions in
the context of the currently running xmonad instance, which lets you control xmonad from
another process(e.g. a script).
To use this module add something like this to your xmonad.hs:
import XMonad.Hooks.EvalServer
main = do
evData <- initEVData
..
xmonad $ .. $ defaultConfig {
handleEventHook = evalEventHook defaultServerConfig evData
startupHook = defaultServer evData 4242
..
}
You can then send Haskell expressions that are to be evaluated over the socket.
Example using telnet:
telnet localhost 4242
windows $ W.view "1"
By default, xmonad is not built with -threaded, so commands will
only be executed after an event is received. xmonadcmd, which is
included in this package, is a workaround to this problem. After
sending the command, it also sends an event to the root window
to trigger the execution of the command.
For more information run 'xmonadcmd --help'
|