Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use xming / vcxsrv / xwin to setup two screens for i3wm [closed]

Tags:

x11

xrandr

xming

I'd like to use i3 on my Windows 10 Linux subsystem with two monitors.

With:

vcxsrv.exe :1 -nodecoration -wgl  -multimonitors -screen 0 3840x1160

I can create one large Window that spans over my two monitors. This configuration works with i3, however i3 recognizes it correctly as one single screen with the drawback that sometimes windows are cut in half when the span over both monitors.

I'd like to use i3 with two separate screens, like this:

vcxsrv.exe :1 -nodecoration -wgl -screen 0 @1 -screen 1 @2

However, I can run i3 either on screen 0 (export DISPLAY=:1) or on screen 1 (export DISPLAY=:1.1) but not on both on the same time.

Maybe it has something todo with xrandr since it does not recognize my configuration:

xrandr -q:

xrandr: Failed to get size of gamma for output default
Screen 1: minimum 0 x 0, current 1920 x 1160, maximum 32768 x 32768
default connected primary 1920x1160+0+0 0mm x 0mm
   1920x1160       0.0*

How can I use both separate screens with i3?

like image 270
Horst Lemke Avatar asked May 17 '17 09:05

Horst Lemke


1 Answers

I've been playing around with this a bit and, while I haven't found a solution for getting xrandr to recognize multiple monitors, I have found out that i3 has an undocumented config option that allows you to simulate multiple monitors on a single one. In my i3 config I've added the option:

fake-outputs 1920x1080+0+0,1366x768+1920+0

This makes i3 treat the massive display that VcXsrv provides as 2 logical displays, and by tuning the sizes/offsets to the monitor sizes, it places the displays perfectly on each monitor.

Also, this is the command I'm using to start VcXsrv:

vcxsrv.exe -screen 0 @2 -wgl -nodecoration +xinerama -screen 1 @1 -wgl -nodecoration +xinerama

The reason the screens are switched is because polybar was showing up on the larger screen with the smaller screens dimensions when using 0 @1 and 1 @2. This switch puts polybar on the large screen (on the left) with the correct dimensions. This may not be the case for everyone's setup.

like image 115
Aaron Levine Avatar answered Nov 10 '22 03:11

Aaron Levine