diff options
Diffstat (limited to 'src/Internal/Keys.hs')
| -rw-r--r-- | src/Internal/Keys.hs | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/src/Internal/Keys.hs b/src/Internal/Keys.hs index c8387c6..748aae2 100644 --- a/src/Internal/Keys.hs +++ b/src/Internal/Keys.hs @@ -252,18 +252,43 @@ keymap = runKeys $ do bind xK_g $ do justMod $ - doc ("Go to a workspace. The next typed character is the workspace " ++ - "must be alpha-numeric.") $ - mapNextString $ \_ str -> - case str of - [ch] | isAlphaNum ch -> gotoWorkspace ch - [' '] -> gotoAccompaningWorkspace + doc ("Goto a workspace\n\n\t\ + + \If the second character typed is alpha-numberic, jump to that\n\t\ + \workspace. The workspace is created on-the-fly if such a workspace\n\t\ + \does not exist.\n\n\t\ + + \If the second character typed is:\n\t\t\ + \]: go to the next workspace\n\t\t\ + \[: go to the previous workspace\n\t\t\ + \}: cycle the workspaces on the screens to the right\n\t\t\ + \{: cycle the workspaces on the screens to the left\n\t\t\ + \<space>: Jump to the accompaning workspace.\n\t\t\ + \F1: display this help.\n") $ + mapNextStringWithKeysym $ \_ keysym str -> + case (keysym, str) of + (_, [ch]) | isAlphaNum ch -> gotoWorkspace ch + (_, "]") -> pushHistory $ withRelativeWorkspace next W.greedyView + (_, "[") -> pushHistory $ withRelativeWorkspace prev W.greedyView + (_, "}") -> windows screenRotateForward + (_, "{") -> windows screenRotateBackward + (_, " ") -> gotoAccompaningWorkspace + + -- Test binding. Tests that I can still submap keysyms alone (keys + -- where XLookupString won't return anything helpful.) + (f, _) | f == xK_F1 -> + (safeSpawn "gxmessage" [ + "-fn", "Source Code Pro", + documentation (keymap config)] :: X ()) + _ -> return () shiftMod $ doc "Move the currently focused window to another workspace" $ mapNextString $ \_ str -> case str of [ch] | isAlphaNum ch -> shiftToWorkspace ch + "]" -> withRelativeWorkspace next W.shift + "[" -> withRelativeWorkspace prev W.shift _ -> return () shiftAltMod $ doc "Swap this workspace with another workspace (rename)." $ @@ -336,12 +361,12 @@ keymap = runKeys $ do bind xK_n $ do justMod $ doc "Shift to the next workspace." $ - relativeWorkspaceShift next + withRelativeWorkspace next W.greedyView bind xK_p $ do justMod $ doc "Shift to the previous workspace." $ - relativeWorkspaceShift prev + withRelativeWorkspace prev W.greedyView bind xK_plus $ do justMod $ @@ -566,10 +591,10 @@ mouseMap = runButtons $ do justMod $ \w -> focus w >> mouseResizeWindow w >> windows W.shiftMaster bind button6 $ - justMod $ noWindow (relativeWorkspaceShift prev) + justMod $ noWindow (withRelativeWorkspace prev W.greedyView) bind button7 $ - justMod $ noWindow (relativeWorkspaceShift next) + justMod $ noWindow (withRelativeWorkspace next W.greedyView) bind button8 $ justMod $ noWindow mediaPrev @@ -628,8 +653,8 @@ mouseMap = runButtons $ do let workspaceButtons = [ (button2, swapMaster), - (button9, relativeWorkspaceShift next), - (button8, relativeWorkspaceShift prev), + (button9, withRelativeWorkspace next W.greedyView), + (button8, withRelativeWorkspace prev W.greedyView), (button4, windows W.focusUp), (button5, windows W.focusDown), |