Search code examples
haskellxmonad

XMonad: How to use manageHook?


I'm following the instructions Here to make a program (wicd-gtk) always run in a floating window.

Here are the relevant sections from my xmonad.hs:

myManageHook = composeAll
    [ className =? "wicd-gtk"       --> doFloat
    , className =? "stalonetray"    --> doIgnore
    , manageDocks  
    ]

main = do
    xmproc <- spawnPipe "~/.local/bin/xmobar ~/.xmobarrc"
    xmonad $ dynamicProjects projects $ docks def
        { layoutHook            = avoidStruts $ myLayoutHook
        , manageHook            = myManageHook <+> manageHook def
        , logHook               = dynamicLogWithPP xmobarPP
            { ppOutput  = hPutStrLn xmproc
            , ppLayout  = (\x -> drop 10 x)
            , ppTitle   = xmobarColor "green" "" . shorten 150
            }
        , modMask               = mod4Mask
        , keys                  = myKeys
        , workspaces            = myWorkspaces
        , normalBorderColor     = myNormalBorderColor
        , focusedBorderColor    = myFocusedBorderColor
        }

I don't get any errors when I recompile but wicd-gtk does not load as a floating window. I also previously tried using doShift to force firefox into a specific window but that did not work as well.

Any ideas what I am doing wrong?


Solution

  • If anyone else was stuck on this, it turns out manageHooks takes the xprop classname not the program name. You can read all about it here: https://wiki.haskell.org/Xmonad/Frequently_asked_questions#I_need_to_find_the_class_title_or_some_other_X_property_of_my_program