19

I have a system with a single monitor, I would like to test the an xmonad configuration that is designed for multiple monitors. Is there any way to emulate a system with 3 monitors using something like Xephyr to test my configuration?

lab_notes
  • 421

5 Answers5

13

I found the solution using Xephyr and Xdmx

First create the Xephyr displays

Xephyr -screen 1920x1080 -ac :1
Xephyr -screen 1920x1080 -ac :2
Xephyr -screen 1920x1080 -ac :3

This creates 3 windows 1920x1080, each of these will act as a monitor

Next add the xinerama layer onto these virtual displays

Xdmx +xinerama -xinput local -display :1 -display :2 -display :3 -ac :4

Next create a fresh terminal and start your window manager or application like so

DISPLAY=:4.0
xmonad

or if you just wanted to test an applications xinerama support instead of xmonad you could run xterm or thunar.

lab_notes
  • 421
9

You only need a single instance of Xephyr.

Xephyr +xinerama -screen 1920x1080 -screen 1920x1080 -screen 1920x1080 -ac :1

If you need RANDR extension, add +extension RANDR args.

Xephyr +extension RANDR +xinerama -screen 1920x1080 -screen 1920x1080 -screen 1920x1080 -ac :1

1

This works for me:

Xephyr +xinerama +extension RANDR -screen 800x600+0+0 -screen 800x600+800+0 -ac :1

Although DISPLAY=:1 xrandr still returns only one screen, my C application calling XineramaQueryScreens(dpy, &new_num_mons); gives me the right geometry.

Gauthier
  • 1,265
0

I don't know if this was possible back when the other answers were posted, but here's how you create a 2x2 grid with three virtual monitors occupying the top-left, top-right, and bottom-left quadrants, and a blank space in the bottom-right quadrant to mess with things that assume there's no dead space:

Xephyr +xinerama -screen 640x480 -origin 640,0 -screen 640x480 -origin 0,480 -screen 640x480 :1 &
ssokolow
  • 1,127
-1

While this answers the question it is not a full-blown solution. These solutions place the three screens in a horizontal row (well, at least according to xinerama (xdpyinfo -ext XINERAMA -display :1), the actual window placement will be taken care of by the window manager). If you want to have any other placement of the screens this will not help.

uli42
  • 170