aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Keys/Wml.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Rahm/Desktop/Keys/Wml.hs')
-rw-r--r--src/Rahm/Desktop/Keys/Wml.hs41
1 files changed, 14 insertions, 27 deletions
diff --git a/src/Rahm/Desktop/Keys/Wml.hs b/src/Rahm/Desktop/Keys/Wml.hs
index 19538fc..e5c45e7 100644
--- a/src/Rahm/Desktop/Keys/Wml.hs
+++ b/src/Rahm/Desktop/Keys/Wml.hs
@@ -480,11 +480,11 @@ readNextWorkspace =
case key of
(mask, keysym, _)
| (Just macro) <- Map.lookup (mask, keysym) macros -> do
- pushKeys macro
- readNextWorkspace
+ pushKeys macro
+ readNextWorkspace
(_, _, [ch])
| isAlphaNum ch || ch == '*' ->
- return $ justWorkspace [ch]
+ return $ justWorkspace [ch]
(_, _, "[") ->
justWorkspace
<$> ( lift1 (adjacentWorkspaceNotVisible prev)
@@ -538,36 +538,23 @@ readNextWorkspace =
floatWorkspace <$> readNextWorkspace
-- Workspace to the next screen to the right of the next workspace.
(_, _, ",") -> do
- ws <- readNextWorkspace
- screens <-
- liftXToFeed $
- map (W.tag . W.workspace . snd)
- <$> withWindowSet (return . getScreensOnSamePlane)
+ ws <- readNextWorkspaceName
+ liftXToFeed $ justWorkspace <$> getWorkspaceToTheRight ws
- let (_, rest) = break ((== workspaceName ws) . Just) (screens ++ screens)
-
- justWorkspace <$> hoistMaybe (head $ tail rest)
+ -- Workspace on the screen below the current workspace..
+ (_, _, "%") -> do
+ ws <- readNextWorkspaceName
+ liftXToFeed $ justWorkspace <$> getWorkspaceAbove ws
-- Workspace on the screen above the current workspace..
(_, _, "+") -> do
- screens <-
- liftXToFeed $
- map (W.tag . W.workspace . snd)
- <$> withWindowSet (return . getScreensOnDifferentPlane)
-
- justWorkspace <$> hoistMaybe (head screens)
+ ws <- readNextWorkspaceName
+ liftXToFeed $ justWorkspace <$> getWorkspaceAbove ws
-- Workspace to the next screen to the left of the next workspace.
(_, _, ";") -> do
- ws <- readNextWorkspace
- screens <-
- liftXToFeed $
- map (W.tag . W.workspace . snd)
- <$> withWindowSet (return . reverse . getHorizontallyOrderedScreens)
-
- let (_, rest) = break ((== workspaceName ws) . Just) (screens ++ screens)
-
- justWorkspace <$> hoistMaybe (head $ tail rest)
+ ws <- readNextWorkspaceName
+ liftXToFeed $ justWorkspace <$> getWorkspaceToTheLeft ws
-- The workspace with the searched for window.
(_, _, "/") ->
@@ -695,7 +682,7 @@ readNextLocationSet' =
-- Windows in a workspace
(_, _, s)
| s == "\t" || s == "@" || s == "\n" ->
- (liftXToFeed . workspaceWindows) =<< readNextWorkspace
+ (liftXToFeed . workspaceWindows) =<< readNextWorkspace
-- The first window in the next window set.
(_, _, "!") -> (: []) <$> absorbMaybe (head <$> readNextLocationSet)
-- The windows except the first in a window set.