[xmonad] Screen independent workspaces

Douglas K. Rand rand at meridian-enviro.com
Wed Dec 23 23:48:51 EST 2009


Doug> Is there a way to have workspaces on a per-screen basis?

Brent> Try the XMonad.Layout.IndependentScreens contrib module, which
Brent> IIUC provides the functionality you're looking for.

I just got that going, and after a bit of work on the key mappings it
is doing workspaces per screen, thanks bunches for the help.

Now (you just knew there was more, didn't you) I was wondering if
anybody could help me get Actions.CycleWS to work with
Layout.IndependentScreens?

I'm sure there is some magic to this, but I don't have it yet. Here
are my current keybindings:

keyBindings spawn conf = let m = modMask conf in fromList $ [
    ((m .|. shiftMask, xK_z), spawn "xscreensaver-command -lock"),
    ((m,               xK_Right), nextWS),
    ((m,               xK_Left),  prevWS),
    ((m .|. shiftMask, xK_Right), shiftToNext),
    ((m .|. shiftMask, xK_Left),  shiftToPrev),
    ((m .|. controlMask, xK_Right), nextScreen),
    ((m .|. controlMask, xK_Left),  prevScreen),
    ((m .|. shiftMask, xK_Up), shiftNextScreen),
    ((m .|. shiftMask, xK_Down),  shiftPrevScreen),
    ((m,               xK_z),     toggleWS)
    ] ++ [
    ((m .|. e .|. i    , key           ), windows (onCurrentScreen f workspace))
    | (key, workspace) <- zip [xK_1..xK_9] (workspaces' conf)
    , (e, f)           <- [(0, view), (shiftMask, viewShift)]
    , i                <- [0, controlMask, mod1Mask, controlMask .|. mod1Mask]
    ]

And mod-1 switches workspaces on a physical screen, but mod-Right
still re-shuffles the workspaces on different screens. Clearly I need
to make those nextWS and prevWS lines look like the xK_1 lines, but I
simply cribbed the last 6 lines of that function from somebody else's
config. 


More information about the xmonad mailing list