How to swap screen in a multihead environment?

I have just started to use xmonad, and it seems to me a great software for multihead screens. At his moment, I am using two physical screens and I would like to use a key binding to do the following thing: "swap screens". By swap screens I mean moving from -the configuration [1 2] to the configuration [2 1] -the configuration [1 3] to the configuration [3 1] -the configuration [4 2] to the configuration [2 4] etc When I say configuration [1 2] I mean that workspace 1 is on left screen and workspace2 in on right screen; and the same idea for [2 1], [1 3], etc Does anybody know how to do this?

On Sat, Aug 29, 2009 at 8:37 PM, Felix Bou
I have just started to use xmonad, and it seems to me a great software for multihead screens.
At his moment, I am using two physical screens and I would like to use a key binding to do the following thing: "swap screens".
By swap screens I mean moving from -the configuration [1 2] to the configuration [2 1] -the configuration [1 3] to the configuration [3 1] -the configuration [4 2] to the configuration [2 4] etc When I say configuration [1 2] I mean that workspace 1 is on left screen and workspace2 in on right screen; and the same idea for [2 1], [1 3], etc
Does anybody know how to do this?
For me if I have [1 2] and use Mod-2 on screen 1 they swap. If I am on screen 2 then Mod-1 would swap them. Don't think I have done anything special for this to happen. Think it works that way out of the box. Mike

On Sat, Aug 29, 2009 at 12:37:27PM +0200, Felix Bou wrote:
At his moment, I am using two physical screens and I would like to use a key binding to do the following thing: "swap screens".
By swap screens I mean moving from -the configuration [1 2] to the configuration [2 1] -the configuration [1 3] to the configuration [3 1] -the configuration [4 2] to the configuration [2 4] etc When I say configuration [1 2] I mean that workspace 1 is on left screen and workspace2 in on right screen; and the same idea for [2 1], [1 3], etc
This should work: import Data.Maybe .. swapScreens = do screen <- gets (listToMaybe . W.visible . windowset) whenJust screen $ windows . W.greedyView . W.tag . W.workspace

On Sat, Aug 29, 2009 at 01:48:52PM +0200, Daniel Schoepe wrote:
On Sat, Aug 29, 2009 at 12:37:27PM +0200, Felix Bou wrote:
At his moment, I am using two physical screens and I would like to use a key binding to do the following thing: "swap screens".
By swap screens I mean moving from -the configuration [1 2] to the configuration [2 1] -the configuration [1 3] to the configuration [3 1] -the configuration [4 2] to the configuration [2 4] etc When I say configuration [1 2] I mean that workspace 1 is on left screen and workspace2 in on right screen; and the same idea for [2 1], [1 3], etc
This should work:
import Data.Maybe
.. swapScreens = do screen <- gets (listToMaybe . W.visible . windowset) whenJust screen $ windows . W.greedyView . W.tag . W.workspace
Let's not reinvent the wheel now! There is already a utility to do exactly this, 'swapNextScreen' from XMonad.Actions.CycleWS. Just bind that to a key and off you go. -Brent
participants (4)
-
Brent Yorgey
-
Daniel Schoepe
-
Felix Bou
-
Mike Sampson