summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-03-08 02:04:24 +0100
committerDon Stewart <dons@cse.unsw.edu.au>2007-03-08 02:04:24 +0100
commitb2d19888ec0b22d0e3745546c18187b5d73a3e4c (patch)
tree4fe8122ff87da461129f2c4076461151b9150dfc
parent21723d9668cfd287286ed830b52af74de6829e6f (diff)
downloadmetatile-b2d19888ec0b22d0e3745546c18187b5d73a3e4c.tar
metatile-b2d19888ec0b22d0e3745546c18187b5d73a3e4c.zip
Add Alt-Shift-[1..5], to move the current client to a new workspace
darcs-hash:20070308010424-9c5c1-d7708952644de1729b86f2be691e86cfaa8fec44
-rw-r--r--Main.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/Main.hs b/Main.hs
index 65bf851..e66ee69 100644
--- a/Main.hs
+++ b/Main.hs
@@ -50,6 +50,12 @@ keys = M.fromList
, ((mod1Mask, xK_4 ), view 4)
, ((mod1Mask, xK_5 ), view 5)
+ , ((mod1Mask .|. shiftMask, xK_1 ), tag 1)
+ , ((mod1Mask .|. shiftMask, xK_2 ), tag 2)
+ , ((mod1Mask .|. shiftMask, xK_3 ), tag 3)
+ , ((mod1Mask .|. shiftMask, xK_4 ), tag 4)
+ , ((mod1Mask .|. shiftMask, xK_5 ), tag 5)
+
]
--
@@ -188,6 +194,22 @@ kill = do
io $ killClient dpy w -- ignoring result
return ()
+-- | tag. associate a window with a new workspace
+tag :: Int -> W ()
+tag n = do
+ let new = n-1
+ (old,wks) <- gets workspace
+ when (new /= old && new >= 0 && new < S.length wks) $ do
+ let this = wks `S.index` old
+ if null this
+ then return () -- no client to retag
+ else do let (t:_) = this
+ modifyWorkspaces $ \(i,w) ->
+ let w' = S.adjust tail old w
+ w'' = S.adjust (t:) new w' in (i,w'')
+ hideWindows [t]
+ refresh
+
-- | Change the current workspace to workspce at offset 'n-1'.
view :: Int -> W ()
view n = do