Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

haskell

xmonad

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)]]
like image 572
Andrius Solopovas Avatar asked Nov 19 '25 20:11

Andrius Solopovas


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)]]
like image 197
Hogeyama Avatar answered Nov 22 '25 12:11

Hogeyama



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!