From 0b56ef1973acb421c2230819bea811453addba2e Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Wed, 3 Aug 2022 15:27:34 -0600 Subject: Actually, change the workspace conditional operator. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was ?&s@.'@s This reads as, if (?) the intersection between the Spotify window and the windows on the current workspace (&s@.) is not empty (if spotify is on the current window), go to the last workspace ('), otherwise go to the workspace Spotify is on (@s). --- src/Rahm/Desktop/Keys/Wml.hs | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'src/Rahm') diff --git a/src/Rahm/Desktop/Keys/Wml.hs b/src/Rahm/Desktop/Keys/Wml.hs index 647234c..9074b66 100644 --- a/src/Rahm/Desktop/Keys/Wml.hs +++ b/src/Rahm/Desktop/Keys/Wml.hs @@ -291,27 +291,18 @@ readNextWorkspace = then ws3 else ws4 - (_, _, "<") -> do - lift . fromX $ - logs Trace "Doing thing" + -- ?&s@.'@s - l1 <- map locationWindow <$> readNextLocationSet - - lift . fromX $ - logs Trace "%s" (show l1) - - l2 <- map locationWindow <$> readNextLocationSet + (_, _, "?") -> do + l1 <- 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 + if null l1 + then ws2 + else ws1 (mask, keysym, _) -> do macro <- (MaybeT . fromX) (Map.lookup (mask, keysym) . workspaceMacros <$> XS.get) -- cgit