diff options
Diffstat (limited to 'src/Rahm/Desktop/Keys.hs')
| -rw-r--r-- | src/Rahm/Desktop/Keys.hs | 53 |
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 $ |