aboutsummaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-03-29 12:06:04 -0600
committerJosh Rahm <joshuarahm@gmail.com>2022-10-09 12:19:45 -0600
commit4df5a598a5ce83bee4669fd5cc3ab6a3ef60b2fe (patch)
treea1a31bb97c7f976e64f9d420b6a92f12440e51ec /src/Main.hs
parentc75c5f8254181242a96f3f6652a53cc70f40b13e (diff)
downloadrde-4df5a598a5ce83bee4669fd5cc3ab6a3ef60b2fe.tar.gz
rde-4df5a598a5ce83bee4669fd5cc3ab6a3ef60b2fe.tar.bz2
rde-4df5a598a5ce83bee4669fd5cc3ab6a3ef60b2fe.zip
Add a DSL for configuring Window-Specific bindings and move it into the Keys.hs file.
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs47
1 files changed, 4 insertions, 43 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 44fb358..a83f1c3 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -10,6 +10,7 @@ import XMonad.Hooks.ManageHelpers (isFullscreen, doFullFloat)
import XMonad.Layout.Fullscreen (fullscreenEventHook)
import System.Environment (setEnv)
import Data.Monoid
+import qualified Data.Map as Map
import Internal.Swallow
import Internal.Windows
@@ -19,6 +20,7 @@ import Internal.Layout
import Internal.Logger
import Internal.DMenu (menuCommandString)
import Internal.RebindKeys
+import Internal.KeysM
import qualified XMonad as X
import qualified XMonad.StackSet as W
@@ -35,49 +37,7 @@ main = do
xmobar <- spawnXMobar
(=<<) X.xmonad $
- applyKeys $ ewmh $ docks $ windowHooks (composeAll [
- let browsers = ["Google-chrome", "Brave-browser", "firefox-default"] in
-
- (flip elem browsers <$> className) --> composeAll [
- -- The geniuses that made chrome decided that Ctrl+W should kill
- -- the current tab! This makes it consistent with the rest of the
- -- world ... ctrl+w deletes the last word (ctrl+backspace).
- rebindKey (controlMask, xK_w) (controlMask, xK_BackSpace)
-
- -- Terminal Ctrl-H sends a backspace. (Technically not, but that's
- -- usually the semantics). Make it this way in Chrome.
- , rebindKey (controlMask, xK_h) (0, xK_BackSpace)
-
- -- Ctrl+u usually deletes the whole line. This is roughly
- -- ctrl+shift+backspace
- , rebindKey (controlMask, xK_u) (controlMask .|. shiftMask, xK_BackSpace)
-
- -- Make it to ctrl+d deletes the current tab instead of ctrl+w.
- , rebindKey (controlMask, xK_e) (controlMask, xK_w)
-
- -- Vim-ish keybindings to go back and forward.
- , rebindKey (controlMask, xK_b) (controlMask, xK_Left)
- , rebindKey (controlMask, xK_e) (controlMask, xK_Right)
- , rebindKey (controlMask .|. shiftMask, xK_b) (controlMask .|. shiftMask, xK_Left)
- , rebindKey (controlMask .|. shiftMask, xK_e) (controlMask .|. shiftMask, xK_Right)
-
- -- Baskic Vim-like motion with the alt key.
- , rebindKey (mod1Mask, xK_h) (0, xK_Left)
- , rebindKey (mod1Mask, xK_j) (0, xK_Down)
- , rebindKey (mod1Mask, xK_k) (0, xK_Up)
- , rebindKey (mod1Mask, xK_l) (0, xK_Right)
-
- , rebindKey (shiftMask .|. mod1Mask, xK_h) (shiftMask, xK_Left)
- , rebindKey (shiftMask .|. mod1Mask, xK_j) (shiftMask, xK_Down)
- , rebindKey (shiftMask .|. mod1Mask, xK_k) (shiftMask, xK_Up)
- , rebindKey (shiftMask .|. mod1Mask, xK_l) (shiftMask, xK_Right)
-
- , rebindKey (controlMask .|. mod1Mask, xK_h) (controlMask, xK_Left)
- , rebindKey (controlMask .|. mod1Mask, xK_j) (controlMask, xK_Down)
- , rebindKey (controlMask .|. mod1Mask, xK_k) (controlMask, xK_Up)
- , rebindKey (controlMask .|. mod1Mask, xK_l) (controlMask, xK_Right)
- ]
- ]) $ def
+ applyKeys $ ewmh $ docks $ def
{ terminal = "alacritty"
, modMask = mod3Mask
, borderWidth = 2
@@ -111,6 +71,7 @@ main = do
, logHook = xMobarLogHook xmobar
}
+
doCenterFloat :: ManageHook
doCenterFloat =
ask >>= \w -> doF . W.float w . centerRect . snd =<< liftX (floatLocation w)