From b4ee8c9ffb34f9394ef8d84f7261e5239d7dcddc Mon Sep 17 00:00:00 2001 From: Devin Mullins Date: Mon, 12 May 2008 00:04:58 +0200 Subject: X.A.WindowNavigation: add withWindowNavigation, for easy setup This should be more flexible than it is -- I've got an idea, but am interested to hear others. darcs-hash:20080511220458-78224-1eb331e0c1a89118c39b0d014e6c5ec7356d4a6a.gz --- XMonad/Actions/WindowNavigation.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'XMonad/Actions/WindowNavigation.hs') diff --git a/XMonad/Actions/WindowNavigation.hs b/XMonad/Actions/WindowNavigation.hs index 17c3d56..410ac58 100644 --- a/XMonad/Actions/WindowNavigation.hs +++ b/XMonad/Actions/WindowNavigation.hs @@ -18,6 +18,7 @@ module XMonad.Actions.WindowNavigation ( -- * Usage -- $usage + withWindowNavigation, go, swap, Direction(..) ) where @@ -39,7 +40,6 @@ import Graphics.X11.Xlib -- Don't use it! What, are you crazy? -- TODO: --- - withWindowNavigation :: XConfig l -> XConfig l -- - cleanup -- - actually deal with multiple screens -- - documentation :) @@ -47,6 +47,15 @@ import Graphics.X11.Xlib -- - solve the 2+3, middle right to bottom left problem -- - manageHook to draw window decos? +withWindowNavigation :: (KeySym, KeySym, KeySym, KeySym) -> XConfig l -> IO (XConfig l) +withWindowNavigation (u,l,d,r) conf = do + posRef <- newIORef M.empty + return conf { keys = \cnf -> M.fromList [ + ((modMask cnf, u), go posRef U), + ((modMask cnf, l), go posRef L), + ((modMask cnf, d), go posRef D), + ((modMask cnf, r), go posRef R) + ] `M.union` (keys conf cnf) } type WNState = Map WorkspaceId Point -- cgit v1.2.3