From 08db1e0f2ef400d22368168deeac24d77f37d516 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Fri, 26 Aug 2022 20:19:40 +0530 Subject: added keybindings to switch monitors in XMonad --- .config/XMonad/lib/Defaults.hs | 3 ++- .config/XMonad/lib/Hooks.hs | 1 + .config/XMonad/lib/Keybindings.hs | 8 ++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to '.config/XMonad/lib') diff --git a/.config/XMonad/lib/Defaults.hs b/.config/XMonad/lib/Defaults.hs index dd1f364..74fa96a 100644 --- a/.config/XMonad/lib/Defaults.hs +++ b/.config/XMonad/lib/Defaults.hs @@ -63,7 +63,8 @@ myWorkspaces = ["一", "二", "三", "四", "五", "六", "七", "八", " sGap = 3 wGap = 4 -myGap = spacingRaw True (Border sGap sGap sGap sGap) True (Border wGap wGap wGap wGap) True +-- myGap = spacingRaw True (Border sGap sGap sGap sGap) True (Border wGap wGap wGap wGap) True +myGap = spacingRaw False (Border sGap sGap sGap sGap) True (Border wGap wGap wGap wGap) True myTabTheme = def { fontName = myFont diff --git a/.config/XMonad/lib/Hooks.hs b/.config/XMonad/lib/Hooks.hs index 5e13225..66540e5 100644 --- a/.config/XMonad/lib/Hooks.hs +++ b/.config/XMonad/lib/Hooks.hs @@ -33,5 +33,6 @@ myLayoutHook = avoidStruts $ maximize $ windowNavigation $ smartBorders $ myGap myStartupHook = do setWMName "Anime Thighs" + spawnOnce "secondmonitor.sh" -- setWMName "LG3D" setDefaultCursor xC_left_ptr diff --git a/.config/XMonad/lib/Keybindings.hs b/.config/XMonad/lib/Keybindings.hs index 6738e3c..708ae90 100644 --- a/.config/XMonad/lib/Keybindings.hs +++ b/.config/XMonad/lib/Keybindings.hs @@ -90,8 +90,8 @@ myKeybindings = [ , ((myModShiftMask, xK_bracketright), shiftNextScreen >> nextScreen) -- swap different screens - , ((myModMask .|. controlMask, xK_bracketleft ), swapPrevScreen) - , ((myModMask .|. controlMask, xK_bracketright), swapNextScreen) + , ((myModMask .|. controlMask, xK_bracketleft ), swapPrevScreen >> prevScreen) + , ((myModMask .|. controlMask, xK_bracketright), swapNextScreen >> nextScreen) -- toggle maximize , ((myModMask, xK_f), withFocused (sendMessage . maximizeRestore)) @@ -140,6 +140,10 @@ myKeybindings = [ ((m .|. myModMask, k), windows $ f i) | (i, k) <- zip myWorkspaces [xK_1, xK_2, xK_3, xK_4, xK_5, xK_6, xK_7, xK_8, xK_9, xK_0] , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] + ] ++ [ -- directly focus monitors instead of cycling + ((m .|. myModMask, key), screenWorkspace sc >>= flip whenJust (windows . f)) + | (key, sc) <- zip [xK_e, xK_w] [0..] + , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] ] myKeybindingsP :: [(String, X())] -- cgit v1.2.3