When I use i3 or Gnome, each monitor gets a workspace/desktop, but under XMonad my laptop screen and the external monitor get joined as one big screen (as show by xdpyinfo)

How can I configure X to use two screens and not one?

  • the correct term is extending the desktop across multiple monitors ...... do a google search on that .... there should be multiple tutorials about enabling the option and also disabling the option
    – jsotola
    Commented Jan 24, 2019 at 2:59
  • @blue-dino: Did you solve the issue? I have a similar issue here: unix.stackexchange.com/questions/639527/…
    – student
    Commented Mar 16, 2021 at 20:58

2 Answers 2


Seems like your XMonad was not compiled with Xinerama support. You can check following these instructions: https://wiki.haskell.org/Xmonad/Frequently_asked_questions#Multi_head_or_xinerama_troubles

To diagnose the problem, execute the following on the command line:

ghc -e Graphics.X11.Xinerama.compiledWithXinerama

If the output is True, skip to the getScreenInfo test below. If the output is False, your Haskell X11 library was not built against Xinerama.

  • Hello! It would be great if you could provide at least the instructions how to check that it is the problem (in case the URL changes). Commented Nov 14, 2020 at 4:03
  • For me I have compiled it with Xinamera support, but I have the same issue.
    – student
    Commented Mar 16, 2021 at 21:01
  • @RomanRiabenko I've updated with the instructions Commented Mar 25, 2021 at 17:08

Thank you for telling me about XMonad. It looks like an interesting window manager to try. As I've only just learned of when you posted yesterday, and I don't have a dual monitor configuration, I would not normally answer this, but it's been a day, so I figured I'd at least have something of an answer.

Consulting its documentation at https://wiki.haskell.org/Xmonad/Frequently_asked_questions, I found a link to https://hackage.haskell.org/package/xmonad-contrib-0.15/docs/XMonad-Layout-IndependentScreens.html which apparently tells you how to actually do what you want.

You need to add something like the following to your ~/.xmonad/xmonad.hs file:

import XMonad.Layout.IndependentScreens
myConfig = def { workspaces = withScreens 2 ["name1", "name2"] }

After that bit, that page further goes on to explain how to set up keybindings to refer to the individual workspaces. Apparently there's a line in the default config file for keybindings that says

    [((m .|. modm, k), windows $ f i)

and this will need to be changed to

    [((m .|. modm, k), windows $ onCurrentScreen f i)

That is as much as I can make out of that page without actually having used any of it.

  • This page is about having separate workspaces associated to each screen, the problem is about just avoiding the "extended desktop", and have each monitor showing one workspace, all from the same set. Commented Dec 16, 2019 at 8:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .