summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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