xmonad

How to run two functions in succession with xmonad.hs's keymap


Expect

I tried to keymap the "Resize window after moving it" behavior.

My code :

`additionalKeysP`
 [ ("M-S-z", spawn "xscreensaver-command -lock")
 , ("M-C-s", unGrab *> spawn "scrot -s")
 ...
 , ("M-<Up>", withFocused (keysMoveWindowTo (0,10) (0,0)) >> withFocused (keysResizeWindow (5,5) (0,0)))
 ]

Actual

Pressed M-<Up>, and a target window was moved, but was not resized.

Ask

If I knew how to run two withFocused functions in succession, I could have done it.

How to run two functions in succession with xmonad.hs's keymap?

I'm still new and don't know the basics.


Solution

  • There was a simple oversight.

    It seems that they misunderstood that resizing failed because the resized size was small. The resize was actually successful.

    In other words, the code posted in the question can execute two functions in succession with the keymap in xmonad.hs.

    I'm going to close the question as a self-answer, but I won't delete it. I'm considering the possibility that someone with the same question will find it by googling.