aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Keys
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2026-03-01 15:50:03 -0700
committerJosh Rahm <joshuarahm@gmail.com>2026-03-01 15:50:03 -0700
commit9839efd016f43c892e935c7d4063e30c23b81e1f (patch)
tree0431ff646b7a273f6a40e04ebe40931faafdcbd1 /src/Rahm/Desktop/Keys
parent2bcd8842dab3a8e62b5ad7cba6cbfbe3fc648f0d (diff)
downloadrde-9839efd016f43c892e935c7d4063e30c23b81e1f.tar.gz
rde-9839efd016f43c892e935c7d4063e30c23b81e1f.tar.bz2
rde-9839efd016f43c892e935c7d4063e30c23b81e1f.zip
[feat] change <M-a> behaivor. Add {} motions.
<M-a> now iterates through the screens as they're ordered. (top-bottom, left-right). } - new workspace motion to go through visibly ordered workspaces { - reverse of }
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