diff options
Diffstat (limited to 'src/Internal')
| -rw-r--r-- | src/Internal/Keys.hs | 1 | ||||
| -rw-r--r-- | src/Internal/Lib.hs | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/Internal/Keys.hs b/src/Internal/Keys.hs index 89e2cf1..2905ba0 100644 --- a/src/Internal/Keys.hs +++ b/src/Internal/Keys.hs @@ -141,6 +141,7 @@ keymap = runKeys $ do justMod $ mapNextString $ \_ str -> case str of [ch] | isAlphaNum ch -> gotoWorkspace ch + [' '] -> gotoAccompaningWorkspace _ -> return () shiftMod $ mapNextString $ \_ str -> case str of diff --git a/src/Internal/Lib.hs b/src/Internal/Lib.hs index c3bdeb9..3beb640 100644 --- a/src/Internal/Lib.hs +++ b/src/Internal/Lib.hs @@ -64,6 +64,17 @@ getHorizontallyOrderedScreens windowSet = where screens = current windowSet : visible windowSet +getCurrentWorkspace :: X WorkspaceName +getCurrentWorkspace = withWindowSet $ + \(StackSet (Screen (Workspace t _ _) _ _) _ _ _) -> do + return (head t) + +gotoAccompaningWorkspace :: X () +gotoAccompaningWorkspace = do + cur <- getCurrentWorkspace + if isUpper cur + then gotoWorkspace (toLower cur) + else gotoWorkspace (toUpper cur) gotoWorkspace :: WorkspaceName -> X () gotoWorkspace ch = do |