aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Keys.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-04-20 00:56:29 -0600
committerJosh Rahm <joshuarahm@gmail.com>2022-10-09 12:19:46 -0600
commit4319bde78b32d42d20b43c1ebd79095409db399e (patch)
treec129e13ba41e497de67f87cc2fc27358d9cce5ae /src/Rahm/Desktop/Keys.hs
parentc2d0c6b0b699513ede65ecef40d7afaccff53ee4 (diff)
downloadrde-4319bde78b32d42d20b43c1ebd79095409db399e.tar.gz
rde-4319bde78b32d42d20b43c1ebd79095409db399e.tar.bz2
rde-4319bde78b32d42d20b43c1ebd79095409db399e.zip
Add macro support to WML.
Macros may be defined by using <M-d> <M-d>w begins defining a windowset macro <M-d>t begins defining a workspace macro The next character typed is the key chord to save the macro to. The next sequence of keys read up until the Return key is the macro value. This macro may then be used as WML objects. Macros are pretty primitive right now. I need to think about if it would be worthwhile to make these macros either take arguments or add some kind of state to WML a la sed to take a step to make the language Turing complete, and if such a development would actually be desirable. If anything it would be an academic exercise.
Diffstat (limited to 'src/Rahm/Desktop/Keys.hs')
-rw-r--r--src/Rahm/Desktop/Keys.hs19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs
index 9ae9c30..a453df1 100644
--- a/src/Rahm/Desktop/Keys.hs
+++ b/src/Rahm/Desktop/Keys.hs
@@ -187,13 +187,6 @@ keymap = runKeys $ do
doc "Print this documentation." $
logs (documentation (keymap config))
- bind xK_F8 $
-
- justMod $
- doc "Experimental" $ do
- (logs . printf "WS: %s" . show . fmap workspaceName) =<< workspaceForString ",^"
- (logs . printf "Wins: %s" . show) =<< locationSetForString "&s@,^"
-
bind xK_F10 $ do
justMod playPauseDoc
@@ -299,6 +292,18 @@ keymap = runKeys $ do
moveLocationToWorkspaceFn ws loc
gotoWorkspaceFn ws
+ bind xK_d $
+ justMod $
+ doc "Record (define) macros." $
+ subkeys $ do
+ bind xK_w $ noMod $
+ doc "Record a windowset macro" $
+ runMaybeT_ readWindowsetMacro
+
+ bind xK_t $ noMod $
+ doc "Record a workspace macro" $
+ runMaybeT_ readWorkspaceMacro
+
bind xK_h $ do
justMod $
doc "Focus on the next window down in the stack" $