I find it a bit awkward in xmonad to switch back and forth between two windows. Is there an extension (or a part of core xmonad) which allows this?

For example, I want to switch between firefox and emacs often, and they might not be in the same workspace. I currently do this using gotoMenu by typing M-g firefox<cr> and M-g emacs<cr> but this is awkward, especially if there's more than one instance of either app. Ideally I'd like a single shortcut to perform an action like give-focus-to-most-recently-used-unfocussed-window, which I could just press over and over to switch back and forth.

有帮助吗?

解决方案

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))
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top