diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2022-04-20 00:56:29 -0600 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2022-04-20 00:56:29 -0600 |
| commit | 6bfec2037120cd5e3dbd46f7f911fbfb9b718daf (patch) | |
| tree | c129e13ba41e497de67f87cc2fc27358d9cce5ae /src/Rahm/Desktop/Keys.hs | |
| parent | cfa9b9fbefa247ce06ed1e985fdfacf162f781c8 (diff) | |
| download | rde-6bfec2037120cd5e3dbd46f7f911fbfb9b718daf.tar.gz rde-6bfec2037120cd5e3dbd46f7f911fbfb9b718daf.tar.bz2 rde-6bfec2037120cd5e3dbd46f7f911fbfb9b718daf.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.hs | 19 |
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" $ |