aboutsummaryrefslogtreecommitdiff
path: root/src/Internal/Keys.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2021-11-23 12:32:00 -0700
committerJosh Rahm <rahm@google.com>2021-11-23 12:32:00 -0700
commite41358263a211bb651ebfdeedeef28c013494960 (patch)
treefa262f2344ef0567f4f9706dd20d006b336f2a12 /src/Internal/Keys.hs
parente1348d91338891be4dd3f7a8d335a5b0452db742 (diff)
downloadrde-e41358263a211bb651ebfdeedeef28c013494960.tar.gz
rde-e41358263a211bb651ebfdeedeef28c013494960.tar.bz2
rde-e41358263a211bb651ebfdeedeef28c013494960.zip
Added ability to submap based on the lookupString.
This changes how workspaces work. There are now as many workspaces as there are AlphaNumeric characters. I'm not really sure how I like it, but it's interesting. I'll keep it for a bit and see how I like it.
Diffstat (limited to 'src/Internal/Keys.hs')
-rw-r--r--src/Internal/Keys.hs42
1 files changed, 32 insertions, 10 deletions
diff --git a/src/Internal/Keys.hs b/src/Internal/Keys.hs
index 0dd8760..89e2cf1 100644
--- a/src/Internal/Keys.hs
+++ b/src/Internal/Keys.hs
@@ -25,7 +25,7 @@ import Internal.PromptConfig
import System.IO
import Text.Printf
import XMonad
-import XMonad.Actions.Submap
+import Internal.Submap
import XMonad.Actions.WindowNavigation
import XMonad.Prompt
import XMonad.Prompt.Input
@@ -85,7 +85,7 @@ keymap = runKeys $ do
rawMask shiftMask $ subkeys $ do
bind xK_F1 $ -- Make it harder to close so I don't accidentally git it.
- rawMask shiftMask $ click >> kill
+ rawMask shiftMask $ click >> CopyWindow.kill1
-- I Don't really use these, but they could be bound to something cool!
bind xK_F2 $
@@ -131,20 +131,25 @@ keymap = runKeys $ do
bind xK_c $ do
justMod runPassMenu
- shiftMod kill
+ shiftMod CopyWindow.kill1
bind xK_f $ do
justMod $ sendMessage FlipLayout
shiftMod $ sendMessage HFlipLayout
bind xK_g $ do
- justMod $ subkeys $ do
- mapNumbersAndAlpha 0 gotoWorkspace
- shiftMod $ subkeys $ do
- mapNumbersAndAlpha 0 shiftToWorkspace
- mapNumbersAndAlpha shiftMask (\i -> windows (CopyWindow.copy [i]))
- shiftAltMod $ subkeys $ do
- mapNumbersAndAlpha 0 swapWorkspace
+ justMod $ mapNextString $ \_ str ->
+ case str of
+ [ch] | isAlphaNum ch -> gotoWorkspace ch
+ _ -> return ()
+ shiftMod $ mapNextString $ \_ str ->
+ case str of
+ [ch] | isAlphaNum ch -> shiftToWorkspace ch
+ _ -> return ()
+ shiftAltMod $ mapNextString $ \_ str ->
+ case str of
+ [ch] | isAlphaNum ch -> swapWorkspace ch
+ _ -> return ()
bind xK_h $ do
justMod $ windows W.focusDown
@@ -207,7 +212,24 @@ keymap = runKeys $ do
justMod $ sendMessage ToggleStruts
bind xK_z $ do
+
justMod $ subkeys $ do
+
+ bind xK_g $ do
+ (justMod -|- noMod) $ mapNextString $ \_ s ->
+ case s of
+ [ch] | isAlphaNum ch -> windows (CopyWindow.copy s)
+ _ -> return ()
+
+ bind xK_p $ do
+ (justMod -|- noMod) $ mapNextString $ \_ str ->
+ spawn $ printf "gxmessage 'typed: \"%s\"\ncodes: \"%s\"\nunicode: รก\n'"
+ str
+ (show (map ord str))
+
+ bind xK_c $ do
+ shiftMod $ CopyWindow.killAllOtherCopies
+
-- Double-tap Z to toggle zoom.
bind xK_z $ do