From b2d19888ec0b22d0e3745546c18187b5d73a3e4c Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Thu, 8 Mar 2007 02:04:24 +0100 Subject: Add Alt-Shift-[1..5], to move the current client to a new workspace darcs-hash:20070308010424-9c5c1-d7708952644de1729b86f2be691e86cfaa8fec44 --- Main.hs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 -- cgit v1.2.3