Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I understand, that I need to add something like:

composeOne [ isFullscreen -?> doFullFloat ]

to my ManageHook. At least according to this page.

But I'm not really sure where to add it in my xmonad config. My Haskell knowledge is relatively minor and because I'm using xmonad with KDE the config file does not have a very standard look.

My xmonad.hs looks like this:

import XMonad
import XMonad.Config.Kde
import qualified XMonad.StackSet as W -- to shift and float windows
import XMonad.Hooks.ManageHelpers

main = xmonad $ kdeConfig

 { modMask = mod4Mask -- use the Windows button as mod
 , manageHook = manageHook kdeConfig <+> myManageHook
   myManageHook = composeAll . concat $
     [ [ className   =? c --> doFloat           | c <- myFloats]
     , [ title       =? t --> doFloat           | t <- myOtherFloats]
     , [ className   =? c --> doF (W.shift "3") | c <- webApps]
     , [ className   =? c --> doF (W.shift "4") | c <- ircApps]
   myFloats      = ["MPlayer", "Gimp", "Skype", "Plasma-desktop", "VirtualBox"]
   myOtherFloats = ["alsamixer"]
   webApps       = ["Firefox-bin", "Opera"] -- open on desktop 3
   ircApps       = ["Ksirc"]                -- open on desktop 4

Where ever I try to put it, I just get cryptic error messages, of which Haskell is famous for.

share|improve this question
If you are getting an error from Haskell on code (in the .hs file), then this may well fit over on StackOverflow? (esp. if you include the error) – Michael Easter Feb 21 '10 at 4:41
I was thinking of it by myself, but I don't really want to cross-post. Especially now, that it has a bounty open. – Rene Saarsoo Feb 21 '10 at 12:25
up vote 1 down vote accepted

You can't plug it in directly because the types don't match:

ghci> :t isFullscreen -?> doFullFloat
isFullscreen -?> doFullFloat :: MaybeManageHook
ghci> :t composeAll
composeAll :: [ManageHook] -> ManageHook

Note, however

ghci> :t composeOne 
composeOne :: [MaybeManageHook] -> ManageHook

That takes a list of manage hooks that may or may not run and combines them into one action.

MaybeManageHook also fits nicely with

*Main> :t maybeToDefinite 
maybeToDefinite :: MaybeManageHook -> ManageHook

Add either

, [ maybeToDefinite (isFullscreen -?> doFullFloat) ]


, [ composeOne [ isFullscreen -?> doFullFloat ] ]

to the definition of myManageHook.

share|improve this answer
Thanks, I used the latter form. Seems to work well :) – Rene Saarsoo Feb 24 '10 at 13:25
You're welcome! Enjoy! – Greg Bacon Feb 24 '10 at 15:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .