[xmonad] how to redirect dynamicLogXinerama output to a FIFO/named pipe?

Lara Michaels laramichaels1978 at yahoo.com
Wed Jun 20 13:38:33 CEST 2012

Hi Brandon

thank you for this. I tried changing xmonad.hs to read
main =  do
    xmonad $ gnomeConfig { modMask = mod4Mask
                       , startupHook = hSetBuffering stdout LineBuffering
                       , manageHook = manageDocks <+> myManageHook <+> manageHook defaultConfig
                       , workspaces = myWorkspaces
                       , normalBorderColor  = "#cccccc"
                       , focusedBorderColor = "#cd8b00"
                       , borderWidth = 3
                       , layoutHook = showWName myLayout
                       , logHook =  dynamicLogXinerama
                       -- , logHook =  ewmhDesktopsLogHook <+> dynamicLogXinerama
                       , handleEventHook = ewmhDesktopsEventHook
                       } `additionalKeysP` myKeys

but now xmonad shows me an error message:

Couldn't match expected type 'X ()' with actual type 'IO ()'
In the return type of a call of 'hsetBuffering'
In the 'startupHook' field of a record
In the first argument of 'addditionalKeysP', [...]

Do you know why this is happening?

thank you for any help

 From: Brandon Allbery <allbery.b at gmail.com>
To: Lara Michaels <laramichaels1978 at yahoo.com> 
Cc: "xmonad at haskell.org" <xmonad at haskell.org> 
Sent: Wednesday, June 20, 2012 3:33 AM
Subject: Re: [xmonad] how to redirect dynamicLogXinerama output to a FIFO/named pipe?

On Tue, Jun 19, 2012 at 9:57 PM, Lara Michaels <laramichaels1978 at yahoo.com> wrote:

but to my surprise running 'tail -f /tmp/xmonad-fifo' shows no 
output, while if I simply start xmonad in a terminal I can see it 
printing information about the workspaces being used to the terminal:

At a guess, you've just demonstrated that nobody has been using dynamicLogXinerama.  It isn't flushing its output, and I can't find anywhere where xmonad sets its stdout to unbuffered or line buffered output.  Output to a terminal is automatically line buffered, so in that case it works as expected; block buffering means it'd only get flushed to the FIFO every 4Kbytes or so.

You could try importing System.IO and adding

    hSetBuffering stdout LineBuffering

to the startupHook.
brandon s allbery                                      allbery.b at gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20120620/999830fa/attachment.htm>

More information about the xmonad mailing list