aboutsummaryrefslogtreecommitdiff
path: root/.config/XMonad/lib/Keybindings.hs
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2024-03-31 16:00:14 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2024-03-31 16:00:14 +0530
commite1842e05f3cf1c0f1fed6beef4cc42080ab09d1e (patch)
treef9111ad6ed33338c10193521c1288d56b8bc4156 /.config/XMonad/lib/Keybindings.hs
parent5ee5265afe43335c1bee5fe474dafdac843514ea (diff)
added keybinding to swap screens
Diffstat (limited to '.config/XMonad/lib/Keybindings.hs')
-rw-r--r--.config/XMonad/lib/Keybindings.hs10
1 files changed, 9 insertions, 1 deletions
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..]
]