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.hs33
1 files changed, 26 insertions, 7 deletions
diff --git a/src/Rahm/Desktop/Keys/Wml.hs b/src/Rahm/Desktop/Keys/Wml.hs
index adb1d9f..647234c 100644
--- a/src/Rahm/Desktop/Keys/Wml.hs
+++ b/src/Rahm/Desktop/Keys/Wml.hs
@@ -267,18 +267,15 @@ readNextWorkspace =
(_, _, "@") -> do
loc <- readNextLocationSet
- MaybeT (return $ justWorkspace . locationWorkspace <$> head loc)
+ MaybeT $ fromX $ withWindowSet $ \ws -> return $ do
+ win <- locationWindow =<< head loc
+ winLocation <- W.findWindow ws win
+ (justWorkspace . W.tag) <$> W.getLocationWorkspace winLocation
(_, _, "~") ->
justWorkspace . accompaningWorkspace <$> readNextWorkspaceName
(_, _, " ") -> mt $
justWorkspace . accompaningWorkspace <$> getCurrentWorkspace
- (_, _, "~") -> do
- ws <- readNextWorkspace
- case workspaceName ws of
- Just [a] | isAlphaNum a ->
- return (justWorkspace $ accompaningWorkspace [a])
- _ -> MaybeT (return Nothing)
(_, _, "_") -> return blackHoleWorkspace
(_, _, "-") -> return alternateWorkspace
@@ -294,6 +291,28 @@ readNextWorkspace =
then ws3
else ws4
+ (_, _, "<") -> do
+ lift . fromX $
+ logs Trace "Doing thing"
+
+ l1 <- map locationWindow <$> readNextLocationSet
+
+ lift . fromX $
+ logs Trace "%s" (show l1)
+
+ l2 <- map locationWindow <$> readNextLocationSet
+
+ ws1 <- readNextWorkspace
+ ws2 <- readNextWorkspace
+
+ (lift . fromX) $ (logs Trace "%s < %s? %s" (show l1) (show l2) (show $ all (`elem`l2) l1) :: X ())
+ (lift . fromX) $ (logs Trace "%s %s" (show $ workspaceName ws1) (show $ workspaceName ws2))
+
+ return $
+ if all (`elem`l2) l1
+ then ws1
+ else ws2
+
(mask, keysym, _) -> do
macro <- (MaybeT . fromX) (Map.lookup (mask, keysym) . workspaceMacros <$> XS.get)
fromMaybeTX $ workspaceForKeysT macro