From e1842e05f3cf1c0f1fed6beef4cc42080ab09d1e Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 31 Mar 2024 16:00:14 +0530 Subject: added keybinding to swap screens --- .config/XMonad/lib/Keybindings.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.config/XMonad/lib/Keybindings.hs b/.config/XMonad/lib/Keybindings.hs index b0f582f..6255626 100644 --- a/.config/XMonad/lib/Keybindings.hs +++ b/.config/XMonad/lib/Keybindings.hs @@ -108,6 +108,11 @@ myKeybindings = [ , ((myModMask .|. myModShiftMask', xK_l), sendMessage $ ShrinkFrom L) , ((myModMask .|. myModShiftMask', xK_j), sendMessage $ ShrinkFrom D) , ((myModMask .|. myModShiftMask', xK_k), sendMessage $ ShrinkFrom U) + + -- swapping screens + -- TODO: find a way to do this with screen id directly, not prev/next + , ((myModMask .|. controlMask, xK_m), swapPrevScreen) + , ((myModMask .|. controlMask, xK_b), swapPrevScreen) ] ++ [ -- workspace switching ((myModMask, key), windows $ W.view ws) @@ -128,7 +133,10 @@ myKeybindings = [ ((myModMask, key), screenWorkspace sc >>= flip whenJust (windows . W.view)) | (key, sc) <- zip myMonitorKeys [0..] ] ++ [ -- moving window to another monitor - ((myModMask .|. shiftMask, key), screenWorkspace sc >>= flip whenJust (windows . \x -> W.view x . W.shift x)) + ((myModShiftMask, key), screenWorkspace sc >>= flip whenJust (windows . \x -> W.view x . W.shift x)) + | (key, sc) <- zip myMonitorKeys [0..] + ] ++ [ -- swapping screens (doesn't do much in < 3 monitors) + ((myModMask .|. controlMask, key), screenWorkspace sc >>= flip whenJust (windows . \x -> W.greedyView x)) | (key, sc) <- zip myMonitorKeys [0..] ] -- cgit v1.2.3