
On Wed, Jan 26, 2011 at 07:43:27PM +1000, Владимир Байраковский wrote:
I have manageHook like this:
myManageHook = composeAll [ className =? "Firefox" --> doF(W.shift "web"), className =? "Gajim.py" --> doF(W.shift "chat"), className =? "Deadbeef" --> doF(W.shift "music"), title =? "Gajim" --> doFloat, className =? "MPlayer" --> doCenterFloat, ]
so, if some workspace does not exist by some reason, the new window will appear on current workspace. How to chek if workspace exists and create it before "W.shift" action? I think addWorkspace from XMonad.Actions.DynamicWorkspaces can do this, but I don't know haskell well to write some function that can be used with doF.
Something along these lines should work: shiftAndcreateIfMissing x = withWindowSet $ \w -> do when(x `notElem` (map show $ map W.tag $ W.workspaces)) $ addHiddenWorkspace x W.shift x and then just do something like doF(shiftAndcreateIfMissing "web") for your managehook. (code is untested though...) You need to import some function from X.A.DynamicWorkspaces and Data.List. Best regards, Jan -- Jan-David Quesel Carl von Ossietzky Universität Oldenburg Department of Computing Science Correct System Design D-26111 Oldenburg, Germany Phone: +49 (0)441 798-2376 Fax: +49 (0)441 798-2965