[xmonad] How to swap screen in a multihead environment?

Nils mail at n-sch.de
Sat Aug 29 08:01:04 EDT 2009


On Sat, Aug 29, 2009 at 12:37:27PM +0200, Felix Bou wrote:
> Does anybody know how to do this?

There is an extension called "X.A.CycleRecentWS" which is exactly what
you're looking for. I'm using this in my key configuration:


    -- Cycle recent (not visible) workspaces, tab is next, escape previous in history
    , let options w     = map (W.greedyView `flip` w)   (hiddenTags w)
      in ("M-<Tab>" , cycleWindowSets options [xK_Super_L] xK_Tab xK_Escape)

    -- Cycle through visible screens, a is next, s previous
    , let options w     = map (W.view `flip` w)         (visibleTags w)
      in ("M-a"     , cycleWindowSets options [xK_Super_L] xK_a xK_s)

    -- Swap visible workspaces on current screen, s is next, d previous
    , let options w     = map (W.greedyView `flip` w)   (visibleTags w)
      in ("M-s"     , cycleWindowSets options [xK_Super_L] xK_s xK_d)


The first one cycles through the hidden workspaces on the current
screen. The second one will change the focus on the screens and the last
one is finally what you're looking for: cycle through the visible
workspaces on the current screen.

I put them all in here since its basicly three times the same function
with different behaviour, and they're all nice to have. Just remember,
you have to release the xK_Super_L key (or w/e key you're going to use)
before running any other command again.



Nils / McManiaC


More information about the xmonad mailing list