[xmonad] Move focus to the next window across multiple visible workspaces

Adam Vogt vogt.adam at gmail.com
Fri Oct 30 22:06:02 EDT 2009

* On Friday, October 30 2009, Ones Self wrote:

>I use a multi-head display with xmonad, and I'd like to cycle through
>all the windows on both visible workspaces.  I've tried using
>XMonad.Layout.WindowNavigation, but I can't seem to get it to work.
>It doesn't switch focus across workspaces, and the more positional
>L, R, U, D is really not what I'm looking for.  I'd like to have it simply
>cycle through all the windows in both workspaces, regardless of their
>position relative to each other.
>Thank you in advance,

Hello yourself,

XMonad.Layout.WindowNavigation doesn't work across screens.
XMonad.Actions.WindowNavigation is supposed to do this however.

Or you might want to run the stackset manipulation on all workspaces as follows:

> -- top of config
> import qualified XMonad.StackSet as W

> -- somewhere at top level
> onAllWS f = windows $ \ws at W.StackSet{ W.current = c, W.visible = vs } ->
>    let screenNext x = W.current . f $ ws { W.current = x }
>        c':vs' = map screenNext (c:vs)
>    in ws{ W.current = c', W.visible = vs' }


>  -- in keybindings: there are much more W.swap* W.focus* and W.shift* functions to use.
>  ,((modm, xK_f), onAllWS W.focusDown)
>  ,((modm, xK_d), onAllWS W.focusUp)
>  ,((modm, xK_g), onAllWS W.swapMaster)

Or, perhaps what you want can be found in this module:


More information about the xmonad mailing list