From ac37d50d7922484ead476d6e40e7617e1420e9c9 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Fri, 29 Mar 2024 00:14:06 +0530 Subject: added keybindings to manipulate floating windows --- .config/XMonad/lib/Keybindings.hs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to '.config/XMonad/lib/Keybindings.hs') 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 = [ , ("", spawn pausePlay) , ("", spawn pausePlay) - , ("", spawn myCalculator) - , ("", spawn myDisplayMenu) , ("", spawn myEmailClient) + , ("", spawn myWallpaperMenu) + , ("", spawn myDisplayMenu) + , ("", 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] ["", "", "", ""] + , (f, m) <- [(directionMoveWindow 10, ""), (directionResizeWindow 10, "S-")] + ] -- cgit v1.2.3