diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2024-03-29 00:14:06 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2024-03-29 00:14:06 +0530 |
commit | ac37d50d7922484ead476d6e40e7617e1420e9c9 (patch) | |
tree | fee4ec1f10540688651050ee1b5be8d8470a7c53 /.config/XMonad/lib/Keybindings.hs | |
parent | 499bb6a2d9f08c3fad40297a13d63c35c42ec260 (diff) |
added keybindings to manipulate floating windows
Diffstat (limited to '.config/XMonad/lib/Keybindings.hs')
-rw-r--r-- | .config/XMonad/lib/Keybindings.hs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/.config/XMonad/lib/Keybindings.hs b/.config/XMonad/lib/Keybindings.hs index 224139a..b0bffa6 100644 --- a/.config/XMonad/lib/Keybindings.hs +++ b/.config/XMonad/lib/Keybindings.hs @@ -9,6 +9,8 @@ import XMonad.Actions.WithAll import XMonad.Actions.CycleWS import XMonad.Actions.GridSelect import XMonad.Actions.SwapWorkspaces +import XMonad.Actions.FloatKeys +import qualified XMonad.Actions.FlexibleResize as Flex -- layout modifiers import XMonad.Layout.Spacing @@ -21,7 +23,6 @@ import XMonad.Layout.BinarySpacePartition as BSP -- hooks import XMonad.Hooks.ManageDocks -import Util import Defaults import TreeSelect import Scratchpads @@ -32,6 +33,7 @@ myMouseKeybindings = [ , ((myModMask, 5), \w -> nextWS) , ((myModShiftMask, 4), \w -> shiftToPrev >> prevWS) , ((myModShiftMask, 5), \w -> shiftToNext >> nextWS) + , ((myModMask, 3), \w -> focus w >> Flex.mouseResizeWindow w) ] myFnKeybindingsP :: [(String, X())] @@ -50,9 +52,10 @@ myFnKeybindingsP = [ , ("<XF86AudioPause>", spawn pausePlay) , ("<Pause>", spawn pausePlay) - , ("<XF86Calculator>", spawn myCalculator) - , ("<XF86Display>", spawn myDisplayMenu) , ("<XF86Mail>", spawn myEmailClient) + , ("<XF86HomePage>", spawn myWallpaperMenu) + , ("<XF86Explorer>", spawn myDisplayMenu) + , ("<XF86Calculator>", spawn myCalculator) ] myKeybindings :: [((KeyMask, KeySym), X ())] @@ -87,11 +90,13 @@ myKeybindings = [ , ((myModMask, xK_h), sendMessage $ Go L) , ((myModMask, xK_k), sendMessage $ Go U) , ((myModMask, xK_j), sendMessage $ Go D) + -- swap windows , ((myModShiftMask, xK_l), sendMessage $ WN.Swap R) , ((myModShiftMask, xK_h), sendMessage $ WN.Swap L) , ((myModShiftMask, xK_k), sendMessage $ WN.Swap U) , ((myModShiftMask, xK_j), sendMessage $ WN.Swap D) + -- resize , ((myModMask .|. myModMask', xK_h), sendMessage $ ExpandTowards R) , ((myModMask .|. myModMask', xK_l), sendMessage $ ExpandTowards L) @@ -127,4 +132,9 @@ myKeybindings = [ ] myKeybindingsP :: [(String, X())] -myKeybindingsP = [] +myKeybindingsP = [ + ] ++ [ -- move and resize floating windows + ("M-" <> m <> k, withFocused $ f i) + | (i, k) <- zip [U, D, R, L] ["<Up>", "<Down>", "<Right>", "<Left>"] + , (f, m) <- [(directionMoveWindow 10, ""), (directionResizeWindow 10, "S-")] + ] |