XMonad.Actions.GroupNavigation seems to be a perfect fit. To let the module track your window history, make sure that logHook
invokes historyHook
. For example:
import XMonad.Actions.GroupNavigation
...
main = xmonad $ defaultConfig {
...
, logHook = myLogHook xmobars >> historyHook
}
Then create a key binding for the following expression, which will toggle between the current and most recent window.
("M-x", nextMatch History (return True))