From fb4befe3374159197c2b8196e77c470a4a0e6a7e Mon Sep 17 00:00:00 2001 From: Anders Engstrom Date: Sun, 15 Nov 2009 14:02:17 +0100 Subject: X.A.CycleWS cycle by tag group Ignore-this: 909da8c00b47a31d04f59bd3751c60bc Allow grouping of workspaces, so that a user can cycle through those in the same group. Grouping is done by using a special character in the tag. darcs-hash:20091115130217-8978f-b0d053d44faa9b3d165b5f0b8c4aab3d27caca37.gz --- XMonad/Actions/CycleWS.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/XMonad/Actions/CycleWS.hs b/XMonad/Actions/CycleWS.hs index 18be5d8..ee462d9 100644 --- a/XMonad/Actions/CycleWS.hs +++ b/XMonad/Actions/CycleWS.hs @@ -218,6 +218,10 @@ data WSType = EmptyWS -- ^ cycle through empty workspaces | HiddenWS -- ^ cycle through non-visible workspaces | HiddenNonEmptyWS -- ^ cycle through non-empty non-visible workspaces | AnyWS -- ^ cycle through all workspaces + | WSTagGroup Char + -- ^ cycle through workspaces in the same group, the + -- group name is all characters up to the first + -- separator character or the end of the tag | WSIs (X (WindowSpace -> Bool)) -- ^ cycle through workspaces satisfying -- an arbitrary predicate @@ -232,6 +236,9 @@ wsTypeToPred HiddenNonEmptyWS = do ne <- wsTypeToPred NonEmptyWS hi <- wsTypeToPred HiddenWS return (\w -> hi w && ne w) wsTypeToPred AnyWS = return (const True) +wsTypeToPred (WSTagGroup sep) = do cur <- (groupName.workspace.current) `fmap` gets windowset + return $ (cur ==).groupName + where groupName = takeWhile (/=sep).tag wsTypeToPred (WSIs p) = p -- | View the next workspace in the given direction that satisfies -- cgit v1.2.3