[xmonad] workspace switching and Xinerama

Karl Hasselström kha-xmonad at hemma.treskal.com
Mon Jan 26 05:36:05 EST 2009

Two questions for those who've been using this nice WM longer than I
have ...

1. I have two monitors, one that's nice and big, and one that's
   attached to my laptop. How do I swap the workspaces on them? That
   is, if they currently show workspaces A and B, what action should I
   bind to a key to make them show B and A?

   I imagine this is just a matter of transforming StackSet the right
   way, but I haven't been able to figure out exactly how.

2. Currently, I've bound mod-Right/Left and ctrl-mod-Right/Left to
   switching to the next Xinerama screen and the next visible window
   in that direction:

     import qualified XMonad.Actions.CycleWS as CWS
     import qualified XMonad.Layout.WindowNavigation as WN

           , ((modMask x,                 xK_Right), CWS.nextScreen)
           , ((modMask x,                  xK_Left), CWS.prevScreen)
           , ((modMask x .|. controlMask, xK_Right), sendMessage $ WN.Go WN.R)
           , ((modMask x .|. controlMask, xK_Left ), sendMessage $ WN.Go WN.L)

   However, what I'd like to do is have just one binding for these two
   tasks, so that mod-Right would switch focus to the next window to
   the right until it reached the edge of the screen, and then the
   next press would switch focus to the leftmost window on the
   Xinerama screen to the right of the one where I just was.

Karl Hasselström, kha at treskal.com

More information about the xmonad mailing list