From ea990921e2562438b6f8d3dd61f4052f01418791 Mon Sep 17 00:00:00 2001 From: Yecine Megdiche Date: Sat, 12 Jun 2021 12:00:02 +0200 Subject: [PATCH] X.A.CycleWS: Added `ignoringWSs` `ignoringWSs` is useful in combination with `X.U.NamedScratchpad` to skip a list of tags --- CHANGES.md | 6 +++++- XMonad/Actions/CycleWS.hs | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 74d94e0f..a3199ea5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -116,7 +116,7 @@ - `XMonad.Actions.CycleWS` - Deprecated `EmptyWS`, `HiddenWS`, `NonEmptyWS`, `HiddenNonEmptyWS`, - `HiddenEmptyWS`, `AnyWS` and `WSTagGroup` + `HiddenEmptyWS`, `AnyWS` and `WSTagGroup`. ### New Modules @@ -643,6 +643,10 @@ - Added `hiddenWS`, `emptyWS` and `anyWS` to replace deprecated constructors. + - Added `ingoringWSs` as a `WSType` predicate to skip workspaces having a + tag in a given list. + + ## 0.16 ### Breaking Changes diff --git a/XMonad/Actions/CycleWS.hs b/XMonad/Actions/CycleWS.hs index 8eb4dfce..c42a2bb4 100644 --- a/XMonad/Actions/CycleWS.hs +++ b/XMonad/Actions/CycleWS.hs @@ -67,6 +67,7 @@ module XMonad.Actions.CycleWS ( , hiddenWS , anyWS , wsTagGroup + , ignoringWSs , shiftTo , moveTo @@ -297,6 +298,15 @@ hiddenWS = WSIs $ do anyWS :: WSType anyWS = WSIs . return $ const True +-- | Cycle through workspaces that are not in the given list. This could, for +-- example, be used for skipping the workspace reserved for +-- "XMonad.Util.NamedScratchpad": +-- +-- > moveTo Next $ hidden :&: Not empty :&: ignoringWSs [scratchpadWorkspaceTag] +-- +ignoringWSs :: [WorkspaceId] -> WSType +ignoringWSs ts = WSIs . return $ (`notElem` ts) . tag + -- | 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