From bb0180c3413383b8a9c01168981c2d11a682942d Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 15 Nov 2020 20:04:29 +0530 Subject: added some keybindings --- xmonad.hs | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 56 insertions(+), 6 deletions(-) (limited to 'xmonad.hs') diff --git a/xmonad.hs b/xmonad.hs index 943cbcb8..5738bd2a 100644 --- a/xmonad.hs +++ b/xmonad.hs @@ -3,7 +3,9 @@ import qualified XMonad.StackSet as W -- actions import XMonad.Actions.CycleWS (moveTo, shiftTo, WSType(..), nextScreen, prevScreen) -import XMonad.Actions.CopyWindow (kill1, killAllOtherCopies) +import XMonad.Actions.CopyWindow (kill1) +import XMonad.Actions.CycleWS +import XMonad.Actions.Navigation2D -- layouts modifiers import XMonad.Layout.Spacing @@ -11,8 +13,17 @@ import XMonad.Layout.LayoutModifier -- import XMonad.Layout.Gaps -- import XMonad.Layout.ShowWName +-- Layouts +import XMonad.Layout.GridVariants (Grid(Grid)) +import XMonad.Layout.SimplestFloat +import XMonad.Layout.Spiral +import XMonad.Layout.ResizableTile +import XMonad.Layout.Tabbed +import XMonad.Layout.ThreeColumns + -- utilities import XMonad.Util.SpawnOnce +import XMonad.Util.EZConfig (additionalKeys) myStartupHook :: X () @@ -74,9 +85,49 @@ mySpacing i j = spacingRaw False (Border i i i i) True (Border j j j j) True $ -- keybindings - -myKeys = [("modMask-", spawn (myTerminal))] - +notMyKeys = [ -- removed keybindings + (mod4Mask, xK_Return) + ] + + +myKeys = [ + ((mod4Mask, xK_Return), spawn myTerminal), + ((mod1Mask, xK_w), kill1), + ((mod1Mask .|. shiftMask, xK_k), kill1), + + -- view prev/next workspaces + ((mod1Mask, xK_h), prevWS), + ((mod1Mask, xK_l), nextWS), + + -- move to prev/next workspaces + ((mod1Mask .|. shiftMask, xK_h), shiftToPrev >> prevWS), + ((mod1Mask .|. shiftMask, xK_l), shiftToNext >> nextWS), + + -- modify gaps on runtime + ((mod1Mask, xK_equal), incWindowSpacing 1), + ((mod1Mask, xK_minus), decWindowSpacing 1), + ((mod1Mask .|. shiftMask, xK_equal), incScreenSpacing 1), + ((mod1Mask .|. shiftMask, xK_minus), decScreenSpacing 1), + + ((mod4Mask .|. shiftMask, xK_Return), windows W.swapMaster), -- Swap the focused window and the master window + + -- Directional navigation of windows + ((mod4Mask, xK_l), windowGo R False), + ((mod4Mask, xK_h), windowGo L False), + ((mod4Mask, xK_k), windowGo U False), + ((mod4Mask, xK_j), windowGo D False), + + -- Swap adjacent windows + ((mod4Mask .|. shiftMask, xK_l), windowSwap R False), + ((mod4Mask .|. shiftMask, xK_h), windowSwap L False), + ((mod4Mask .|. shiftMask, xK_k), windowSwap U False), + ((mod4Mask .|. shiftMask, xK_j), windowSwap D False), + + -- cycle through windows + ((mod1Mask, xK_j), windows W.focusDown), + ((mod1Mask, xK_k), windows W.focusUp) + + ] -- ~keybindings~ @@ -90,7 +141,6 @@ main = do workspaces = myWorkspaces, normalBorderColor = nBorder, focusedBorderColor = fBorder, - keys = myKeys, -- mouseBindings = myMouseBindings, -- hooks, layouts @@ -99,5 +149,5 @@ main = do --handleEventHook = myEventHook, --logHook = myLogHook, startupHook = myStartupHook -} +} `additionalKeys` myKeys -- cgit v1.2.3