diff options
author | Devin Mullins <me@twifkak.com> | 2008-05-12 00:04:58 +0200 |
---|---|---|
committer | Devin Mullins <me@twifkak.com> | 2008-05-12 00:04:58 +0200 |
commit | b4ee8c9ffb34f9394ef8d84f7261e5239d7dcddc (patch) | |
tree | 0b5b1ff250c2f4504953317dc1766ace6390faa5 /XMonad/Actions | |
parent | f61523e62c6d86e230cf628a14933596aaa45cd2 (diff) | |
download | XMonadContrib-b4ee8c9ffb34f9394ef8d84f7261e5239d7dcddc.tar.gz XMonadContrib-b4ee8c9ffb34f9394ef8d84f7261e5239d7dcddc.tar.xz XMonadContrib-b4ee8c9ffb34f9394ef8d84f7261e5239d7dcddc.zip |
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
Diffstat (limited to 'XMonad/Actions')
-rw-r--r-- | XMonad/Actions/WindowNavigation.hs | 11 |
1 files changed, 10 insertions, 1 deletions
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 |