diff options
| author | Josh Rahm <rahm@google.com> | 2020-02-05 10:47:33 -0700 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2020-02-05 10:47:33 -0700 |
| commit | c57a7f0db7dba41fd6851535845077adb08da18d (patch) | |
| tree | 766052a1ee7245043e32dd32dcc05867a354388d | |
| parent | 0fb570be284eb09403d29c796ded65642ced1e18 (diff) | |
| download | rde-c57a7f0db7dba41fd6851535845077adb08da18d.tar.gz rde-c57a7f0db7dba41fd6851535845077adb08da18d.tar.bz2 rde-c57a7f0db7dba41fd6851535845077adb08da18d.zip | |
Now any AlphaNumeric character can be a workspace
| -rw-r--r-- | src/Internal/Keys.hs | 14 | ||||
| -rw-r--r-- | src/Main.hs | 1 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/Internal/Keys.hs b/src/Internal/Keys.hs index 3d0df0c..5313c12 100644 --- a/src/Internal/Keys.hs +++ b/src/Internal/Keys.hs @@ -26,10 +26,12 @@ newKeys = Map.fromList $ zip ['1'..] (XMonad.workspaces config) - gotoWorkspace :: Char -> X () gotoWorkspace ch = do saveLastMark markContext - mapM_ (windows . W.greedyView) (Map.lookup ch workspacesByInt) + windows $ W.greedyView $ return ch + + shiftToWorkspace ch = do + windows $ W.shift $ return ch in @@ -50,7 +52,8 @@ newKeys = (modm, xK_apostrophe) (jumpToLast markContext) (mapAlpha modm (jumpToMark markContext)))) - , ((modm, xK_g), (submap $ mapNumbers 0 gotoWorkspace)) + , ((modm, xK_g), (submap $ mapNumbersAndAlpha 0 gotoWorkspace)) + , ((modm .|. shiftMask, xK_g), (submap $ mapNumbersAndAlpha 0 shiftToWorkspace)) , ((modm .|. shiftMask, xK_bracketleft), sendMessage (IncMasterN (-1))) , ((modm .|. shiftMask, xK_bracketright), sendMessage (IncMasterN 1)) @@ -62,6 +65,11 @@ newKeys = , ((modm, xK_q), spawn "xmonad --recompile && xmonad --restart") ] +mapNumbersAndAlpha :: KeyMask -> (Char -> X ()) -> Map (KeyMask, KeySym) (X ()) +mapNumbersAndAlpha km fn = + mapNumbers km fn + <> mapAlpha km fn + mapNumbers :: KeyMask -> (Char -> X ()) -> Map (KeyMask, KeySym) (X ()) mapNumbers km fn = Map.fromList [ diff --git a/src/Main.hs b/src/Main.hs index 533a7a1..11d9eab 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -44,6 +44,7 @@ main = do , className =? "mpv" --> doFloat , className =? "gnubby_ssh_prompt" --> doFloat ] + , workspaces = map return (['0'..'9'] ++ ['a'..'z']) , handleEventHook = fullscreenEventHook } |