aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Creighton <jcreigh@gmail.com>2007-03-21 04:38:07 +0100
committerJason Creighton <jcreigh@gmail.com>2007-03-21 04:38:07 +0100
commitca4ed52d171a0f5637fee323f19ef0f618b49c6b (patch)
tree5de1d08bb17923780b23081dbe13c22173160e90
parentc31a1eacc9cc232bc8922dbfab3e7a3baceaf660 (diff)
downloadxmonad-ca4ed52d171a0f5637fee323f19ef0f618b49c6b.tar.gz
xmonad-ca4ed52d171a0f5637fee323f19ef0f618b49c6b.tar.xz
xmonad-ca4ed52d171a0f5637fee323f19ef0f618b49c6b.zip
add keybindings to change screens and tag windows to screens
darcs-hash:20070321033807-b9aa7-182a8a380ff559eb2ab3af0ec143712b38cdcb60.gz
-rw-r--r--Main.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Main.hs b/Main.hs
index 941067c..9e52c77 100644
--- a/Main.hs
+++ b/Main.hs
@@ -61,6 +61,12 @@ keys = M.fromList $
[((m .|. modMask, xK_0 + fromIntegral i), f i)
| i <- [1 .. workspaces]
, (f, m) <- [(view, 0), (tag, shiftMask)]]
+ -- generate keybindings to each screen:
+ ++
+ [((m .|. modMask, key), screenWS sc >>= f)
+ | (key, sc) <- zip [xK_w, xK_e, xK_r] [1..]
+ , (f, m) <- [(view, 0), (tag, shiftMask)]]
+
--
-- The mask for the numlock key. You may need to change this on some systems.
@@ -385,3 +391,12 @@ view o = do
-- | True if window is under management by us
isClient :: Window -> X Bool
isClient w = liftM (W.member w) (gets workspace)
+
+-- | screenWS. Returns the workspace currently visible on screen n
+screenWS :: Int -> X Int
+screenWS n = do
+ ws2sc <- gets wsOnScreen
+ -- FIXME: It's ugly to have to query this way. We need a different way to
+ -- keep track of screen <-> workspace mappings.
+ let ws = fmap fst $ find (\(_, scn) -> scn == (n-1)) (M.assocs ws2sc)
+ return $ (fromMaybe 0 ws) + 1