Xmonad shift window to another screen and focus on it with one keybinding

Viewed 434

how to make this key binding so that it also focuses on the moved window?

    [((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
        | (key, sc) <- zip [xK_h, xK_l] [0..]
        , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
1 Answers

Use shiftAndView i = W.view i . W.shift i instead of W.shift like this:

  [((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
    | (key, sc) <- zip [xK_h, xK_l] [0..]
    , let shiftAndView i = W.view i . W.shift i
    , (f, m) <- [(W.view, 0), (shiftAndView, shiftMask)]]
Related