Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
 }
 where
   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
add comment

1 Answer

up vote 1 down vote accepted
+100

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) ]

or

, [ 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.