aboutsummaryrefslogtreecommitdiff
path: root/src/Internal/Keys.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-03-25 15:32:06 -0600
committerJosh Rahm <rahm@google.com>2022-03-25 15:32:06 -0600
commite5f6b5109aab58b5d066ada7c542d0ecb991cafb (patch)
treedc4d37b9429708e5faf0f2a3b4bddc0591e4b4ce /src/Internal/Keys.hs
parent4e718217ada0367b220f0e2134dbf6cbdcb28977 (diff)
downloadrde-e5f6b5109aab58b5d066ada7c542d0ecb991cafb.tar.gz
rde-e5f6b5109aab58b5d066ada7c542d0ecb991cafb.tar.bz2
rde-e5f6b5109aab58b5d066ada7c542d0ecb991cafb.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.hs12
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