aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Keys
diff options
context:
space:
mode:
Diffstat (limited to 'src/Rahm/Desktop/Keys')
-rw-r--r--src/Rahm/Desktop/Keys/Wml.hs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/Rahm/Desktop/Keys/Wml.hs b/src/Rahm/Desktop/Keys/Wml.hs
index 00c8139..e64c6e0 100644
--- a/src/Rahm/Desktop/Keys/Wml.hs
+++ b/src/Rahm/Desktop/Keys/Wml.hs
@@ -12,6 +12,8 @@
-- &z!~@,,^ // The window tagged with z and The last window on the screen third from the top (in reading order)
-- @@s // All the windows that share a workspace with the window tagged s
-- \%@s // All windows except those on workspace 's'
+-- }. // The next workspace in ordered list (top-to-bottom, left-to-right)
+-- {x // The previous workspace in ordered list (x cannot be hidden workspace *)
module Rahm.Desktop.Keys.Wml
( readWorkspaceMacro,
readWindowsetMacro,
@@ -45,7 +47,7 @@ module Rahm.Desktop.Keys.Wml
)
where
-import Control.Monad (forM_, join, void, when)
+import Control.Monad (forM_, join, void, when, (<=<))
-- getMostRecentLocationInHistory,
-- pastHistory,
@@ -556,6 +558,18 @@ readNextWorkspace =
ws <- readNextWorkspaceName
hoistMaybeT $ justWorkspace <$> getWorkspaceToTheLeft ws
+ -- Next workspace in ordered list (top-to-bottom, left-to-right)
+ (_, _, "}") -> do
+ ws <- readNextWorkspaceName
+ lift1 (return . justWorkspace <=< getNextWorkspaceInOrder) ws
+ -- Previous workspace in ordered list (top-to-bottom, left-to-right)
+ (_, _, "{") -> do
+ ws <- readNextWorkspaceName
+ -- If workspace is hidden (tagged with "*"), return Nothing
+ if ws == "*"
+ then feedFail
+ else lift1 (return . justWorkspace <=< getPrevWorkspaceInOrder) ws
+
-- The workspace with the searched for window.
(_, _, "/") ->
justWorkspace