Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just switched from metacity to xmonad and I am very impressed by the tiling window manager concept. But I thing bothers me: In gnome a "workspace" was composed of all of my three monitors, but with xmonad every physical screen has it´s own workspace (e.g. when I press mod+1 only one screen changes his workspace).

Is there a tiling window manager which implements the gnome (metacity) workspace concept? Can xmonad link all physical screens into one workspace somehow?

share|improve this question
up vote 4 down vote accepted

XMonad cannot use all three screens as a single workspace but nor would you want it to. I think you just need to know how to navigate your screens better. I have a setup that I quite like and you can see the config file for that setup in the XMonad section of the Haskell Wiki. Everything I will show will come from stuff in my own config on my machine (though that is not necessarily what is on that page I linked to).

There are two xmonad-contrib libraries that make multi-head navigation not only bearable but a wonderful godsend and they are CycleWS and TagWindows.

CycleWS allows you to cycle through the workspaces on different physical screens (with prevScreen and nextScreen) and it also allows you to move windows between screens easily (with shiftPrevScreen and shiftNextScreen). That means that even though you have different workspaces on each screen that each one can share the windows between them. Unless you want one window to span across every screen that you have then you are fine. Here is how my xmonad.hs uses the CycleWS commands:

-- Alt + Ctrl Left / Right makes the view go left and right
, ((altMask .|. controlMask, xK_Left       ), prevScreen >> windowCenter)
, ((altMask .|. controlMask, xK_Right      ), nextScreen >> windowCenter)
, ((altMask .|. controlMask, xK_Down       ), shiftPrevScreen)
, ((altMask .|. controlMask, xK_Up         ), shiftNextScreen)
, ((altMask .|. controlMask .|. shiftMask, xK_Down       ), shiftPrevScreen >> prevScreen >> windowCenter)
, ((altMask .|. controlMask .|. shiftMask, xK_Up         ), shiftNextScreen >> nextScreen >> windowCenter)

[Note: windowCenter = warpToWindow (1 % 6) (1 % 6) ]

TagWindows is awesome, especially the viewOnScreen function which lets you call up any tagged program on any of your screens right to the front though I had to do a little hacking to get that working to my liking. Here are the keys that I use:

, ((myModMask,                 xK_g  ), tagPrompt defaultXPConfig (withFocused . addTag))
, ((myModMask .|. shiftMask,   xK_g  ), tagDelPrompt defaultXPConfig)
, ((altMask,                   xK_g  ), tagPrompt defaultXPConfig (`withTaggedGlobalP` gotoWindow))

And here is where the gotoWindow function is defined:

-- Warning: This gotoWindow function assumes you made your workspaces
-- with the 'withScreens' function from XMonad.Layout.IndependentScreens    
gotoWindow :: Window -> WindowSet -> WindowSet
gotoWindow window ws = case S.findTag window ws of
                           Just i -> viewOnScreen (screenIdFromTag i) i ws
                           Nothing -> ws
        screenIdFromTag :: WorkspaceId -> ScreenId
        screenIdFromTag = S . read . takeWhile (/= '_')

And that should allow you to nail multi-headed awesomeness in your XMonad config file. Feel free to ask me more questions in the comments if you have any. I hope this helps.

share|improve this answer
"XMonad cannot use all three screens as a single workspace but nor would you want it to. " That's pretty opinionated. :) Say you have 3 small monitors with resolution 1366×768, you fire up a shell on the leftmost and then print 100 500-character lines. They would wrap. In the interest of reading it easier, you might want to extend the shell across two or three monitors temporarily. You can float it, but then you lose a lot of tiling goodness. I think there's a lot of value of being able to do one workspace across all monitors. – steady rain Apr 17 '15 at 17:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.