aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Keys.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2023-12-13 16:48:10 -0700
committerJosh Rahm <rahm@google.com>2023-12-13 16:48:10 -0700
commit4c14fed7b852296af422a9d2f7166abced2c52b9 (patch)
tree849b2c85ed009eaca526b988ecc0778c2fd9a828 /src/Rahm/Desktop/Keys.hs
parent2604f0608d176d89a4e307c90a5f904b8d06921a (diff)
downloadrde-4c14fed7b852296af422a9d2f7166abced2c52b9.tar.gz
rde-4c14fed7b852296af422a9d2f7166abced2c52b9.tar.bz2
rde-4c14fed7b852296af422a9d2f7166abced2c52b9.zip
Added documentation ability for Dsl2 keys.
Diffstat (limited to 'src/Rahm/Desktop/Keys.hs')
-rw-r--r--src/Rahm/Desktop/Keys.hs53
1 files changed, 26 insertions, 27 deletions
diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs
index 412d8f5..8945201 100644
--- a/src/Rahm/Desktop/Keys.hs
+++ b/src/Rahm/Desktop/Keys.hs
@@ -306,33 +306,26 @@ bindings = do
doc "Move XMobar to another screen." $
spawnX "pkill -SIGUSR1 xmobar"
- -- bind xK_F1 $ do
- -- justMod $
- -- doc
- -- "Print this documentation"
- -- ( safeSpawn
- -- "gxmessage"
- -- [ "-fn",
- -- "Source Code Pro",
- -- "Key Bindings\n\n"
- -- ++ documentation (keymap config)
- -- ++ "\n\nButton Bindings\n\n"
- -- ++ buttonDocumentation (mouseMap config)
- -- ] ::
- -- X ()
- -- )
-
- -- bind xK_F7 $ do
- -- justMod $
- -- doc
- -- "Print this documentation to stdout (at LogLevel Info)"
- -- ( logs
- -- Info
- -- "KeyBindings\n\n%s\n\nButtonBindings\n\n%s"
- -- (documentation (keymap config))
- -- (buttonDocumentation (mouseMap config)) ::
- -- X ()
- -- )
+ let getDoc :: X String
+ getDoc = do
+ config <- asks config
+ return $
+ "Key and Mouse Bindings:\n\n"
+ ++ documentation config bindings
+
+ bind xK_F1 $ do
+ justMod
+ $ doc
+ "Print this documentation"
+ $ do
+ doc <- getDoc
+ safeSpawn "gxmessage" ["-fn", "Source Code Pro", doc]
+
+ bind xK_F7 $ do
+ justMod $
+ doc
+ "Print this documentation to stdout (at LogLevel Info)"
+ (logs Info "%s" =<< getDoc)
bind xK_F10 $ do
justMod playPauseDoc
@@ -846,6 +839,12 @@ bindings = do
noMod mediaNextDoc
rawMask shiftMask mediaSeekFDoc
+ bindOtherKeys $ \(_, _, s) ->
+ logs Info "Unhandled key pressed: %s" s
+
+ bindOtherButtons $ \(_, b) ->
+ logs Info "Unhandled button press: %s" (show b)
+
-- Centers the current focused window. i.e. toggles the Zoom layout
-- modifier.
shiftMod $