diff options
| author | Josh Rahm <rahm@google.com> | 2022-03-25 15:32:06 -0600 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2022-10-09 12:19:45 -0600 |
| commit | 4b33192b56ea0f84f97d47e7656c186ec6ab7a68 (patch) | |
| tree | 5fff307b3788278a7308700ea8af8dfa1d95238f /src/Internal/Keys.hs | |
| parent | 176b02a6f6f89c446311cb8df0cf43cd8e0e38a1 (diff) | |
| download | rde-4b33192b56ea0f84f97d47e7656c186ec6ab7a68.tar.gz rde-4b33192b56ea0f84f97d47e7656c186ec6ab7a68.tar.bz2 rde-4b33192b56ea0f84f97d47e7656c186ec6ab7a68.zip | |
Added a way to do per-window bindings in XMonad.
This is particularly great for Chrome where one cannot remap
the built-in bindings and some built-in bindings are really dumb
(looking at you Ctrl+w!!).
Diffstat (limited to 'src/Internal/Keys.hs')
| -rw-r--r-- | src/Internal/Keys.hs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Internal/Keys.hs b/src/Internal/Keys.hs index 1118788..c40c346 100644 --- a/src/Internal/Keys.hs +++ b/src/Internal/Keys.hs @@ -1,6 +1,7 @@ {-# LANGUAGE RankNTypes #-} module Internal.Keys (applyKeys) where +import Internal.Intercept (setIntercept) import Control.Monad.Loops (iterateWhile) import Control.Monad.Fix (fix) import Graphics.X11.ExtraTypes.XF86; @@ -246,6 +247,12 @@ keymap = runKeys $ do then mediaPrev else mediaNext + bind xK_t $ + + (justMod -|- noMod) $ + setIntercept (modMask config, xK_i) $ + logs $ "Intercepted!" + bind xK_r $ do justMod runDMenu shiftMod $ sendMessage DoRotate @@ -470,4 +477,7 @@ click = do modifyWindowBorder :: Integer -> SpacingModifier modifyWindowBorder i = ModifyWindowBorder $ \(Border a b c d) -> - Border (a + i) (b + i) (c + i) (d + i) + Border (clip $ a + i) (clip $ b + i) (clip $ c + i) (clip $ d + i) + + where clip i | i < 0 = 0 + clip i | otherwise = i |