From 5ee5265afe43335c1bee5fe474dafdac843514ea Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Fri, 29 Mar 2024 19:50:44 +0530 Subject: fixed keybindings to change to other monitor --- .config/XMonad/lib/Keybindings.hs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to '.config/XMonad/lib/Keybindings.hs') diff --git a/.config/XMonad/lib/Keybindings.hs b/.config/XMonad/lib/Keybindings.hs index b0bffa6..b0f582f 100644 --- a/.config/XMonad/lib/Keybindings.hs +++ b/.config/XMonad/lib/Keybindings.hs @@ -27,6 +27,8 @@ import Defaults import TreeSelect import Scratchpads +myMonitorKeys = [xK_m, xK_b] + myMouseKeybindings :: [((ButtonMask, Button), Window -> X ())] myMouseKeybindings = [ ((myModMask, 4), \w -> prevWS) @@ -108,7 +110,7 @@ myKeybindings = [ , ((myModMask .|. myModShiftMask', xK_k), sendMessage $ ShrinkFrom U) ] ++ [ -- workspace switching - ((myModMask, key), windows $ W.greedyView ws) + ((myModMask, key), windows $ W.view ws) | (key,ws) <- myExtraWorkspaces ] ++ [ -- moving window to workspace @@ -116,19 +118,18 @@ myKeybindings = [ | (key,ws) <- myExtraWorkspaces ] ++ [ -- to swap workspace - -- TODO: try to change this into a key chord ((myModShiftMask', key), windows $ swapWithCurrent ws) | (key, ws) <- zip [xK_1, xK_2, xK_3, xK_4, xK_5, xK_6, xK_7, xK_8, xK_8, xK_0] myWorkspaces - -- ] ++ [ - -- -- copy - -- ((m .|. myModMask, key), windows $ f ws) | (key, ws) <- myWorkspaces, (f, m) <- [(copy, myModShiftMask')] - -- ] ++ [ - -- -- for not swapping tags while using multihead - -- ((m .|. myModMask, key), windows $ f ws) | (key, ws) <- myWorkspaces, (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_m, xK_w] [0..] - , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] + ] ++ [ + -- copy windows to other workspaces + ((myModShiftMask .|. controlMask, key), windows $ copy ws) + | (key, ws) <- zip [xK_1, xK_2, xK_3, xK_4, xK_5, xK_6, xK_7, xK_8, xK_8, xK_0] myWorkspaces + ] ++ [ -- focusing another monitor + ((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)) + | (key, sc) <- zip myMonitorKeys [0..] ] myKeybindingsP :: [(String, X())] -- cgit v1.2.3