[patch] XMonad.Hooks.InsertPosition per workspace

Hi, a small patch that might be useful for others. It adds insertPositionPerWorkspace to XMonad.Hooks.InsertPosition and allows to define insertPosition for a particular workspace. Example: -- manageHook = insertPositionPerWorkspace [("5:www",(Below,Older))] Below Newer <+> myManageHook -- "5:www" is my tabbed workspace for uzbl-browser. A new window opens in "background" and the focus remains on the old window, whereas in every other workspace the new window is focused. Kind regards, Frank

Hi Frank, Thanks for the patch. Your example can be written using XMonad.Hooks.ManageHelpers and the existing XMonad.Hooks.InsertPosition: manageHook = composeOne [currentWs =? "5:www" -?> insertPosition Below Older return True -?> insertPosition Below Newer] <+> myManageHook Considering the above, I think you can implement insertPositionPerWorkspace without having to add to the already confusing functions in insertPosition: -- insertPositionPerWorkspace :: [(WorkspaceId, (Position, Focus))] -- -> Position -> Focus -> ManageHook insertPositionPerWorkspace wss p1 f1 = do ws <- currentWs uncurry insertPosition $ fromMaybe (p1,f1) (lookup ws wss) Let me know if this insertPositionPerWorkspace above can be added instead of your patch. Cheers, Adam * On Monday, September 05 2011, Frank Busse wrote:
Hi,
a small patch that might be useful for others. It adds insertPositionPerWorkspace to XMonad.Hooks.InsertPosition and allows to define insertPosition for a particular workspace.
Example: -- manageHook = insertPositionPerWorkspace [("5:www",(Below,Older))] Below Newer <+> myManageHook --
"5:www" is my tabbed workspace for uzbl-browser. A new window opens in "background" and the focus remains on the old window, whereas in every other workspace the new window is focused.
Kind regards,
Frank
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

Hi Adam, On Thu, 8 Sep 2011 12:24:15 -0400 Adam Vogt wrote:
Thanks for the patch. Your example can be written using XMonad.Hooks.ManageHelpers and the existing XMonad.Hooks.InsertPosition:
manageHook = composeOne [currentWs =? "5:www" -?> insertPosition Below Older return True -?> insertPosition Below Newer] <+> myManageHook sorry, I wasn't aware of currentWs. It's neither in my 0.9.2 version nor in the online API documentation. But thanks, works well and is much nicer. (Patch was applied 2009, 0.9.2 was released Dec. 2010?!)
Let me know if this insertPositionPerWorkspace above can be added instead of your patch. I wouldn't apply the patch at all if we already can achieve this functionality, maybe cleanup insertPosition.
Kind regards, Frank
participants (2)
-
Adam Vogt
-
Frank Busse