LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 09-14-2020, 01:49 PM   #1
lightstream
LQ Newbie
 
Registered: Jul 2008
Location: Berlin, DE
Distribution: Arch
Posts: 15

Rep: Reputation: 1
How to configure X for multi-head with two separate screens?


I would like to try out the old-school way of handling multiple monitors with X - where each screen is separate, with a different $DISPLAY value (the first screen is :0.0, the second is :0.1 and so on), and where windows cannot be moved from one screen to the other - as described here.

At the moment, I do not have any X config files for the displays, and I am getting a mirrorred desktop i.e. both screens show the same windows and my mouse. $DISPLAY is currently set to :0

What do I need to do to make X treat each monitor as a separate display?
 
Old 09-15-2020, 01:19 PM   #2
lightstream
LQ Newbie
 
Registered: Jul 2008
Location: Berlin, DE
Distribution: Arch
Posts: 15

Original Poster
Rep: Reputation: 1
I feel I may be getting close. I've now created the following file called /etc/X11/xorg.conf.d/10-monitor.conf:

Code:
Section "Monitor"
    Identifier  "eDP1"
    Option      "RightOf" "HDMI1"
EndSection

Section "Monitor"
    Identifier  "HDMI1"
    Option      "Primary" "true"
EndSection

Section "Device"
  Identifier	"Intel Graphics"
  Driver	"intel"
EndSection

Section "Screen"
  Identifier    "Screen0"
  Device        "Intel Graphics"
  Monitor       "HDMI1"
EndSection

Section "Screen"
  Identifier	"Screen1"
  Device	"Intel Graphics"
  Monitor	"eDP1"
EndSection
Now when I start X, I still have one stretched workspace, but now $DISPLAY is set to :0.0

Maybe I need to add two "Display" sections to my config.
 
Old 09-16-2020, 12:15 PM   #3
bgstack15
Member
 
Registered: Jul 2017
Distribution: korora
Posts: 90

Rep: Reputation: Disabled
Thank you for sharing your progress! I don't have this same need, but I look forward to learning this technical achievement of two separate X servers, one for each monitor. I too would have estimated that "Screen" would be enough. All these words, like monitor, screen, display, I expect can all be translated to the same word in other languages so the nuances are indeed tricky.
 
Old 09-17-2020, 06:49 AM   #4
CaptainFreeze
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Rep: Reputation: 1
try this

Try something like this as part of your login script
"xrandr --output eDP-1 --same-as HDMI-1"
or maybe
"xrandr --output eDP1 --same-as HDMI1"
 
Old 09-17-2020, 10:05 AM   #5
lightstream
LQ Newbie
 
Registered: Jul 2008
Location: Berlin, DE
Distribution: Arch
Posts: 15

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by CaptainFreeze View Post
Try something like this as part of your login script
"xrandr --output eDP-1 --same-as HDMI-1"
or maybe
"xrandr --output eDP1 --same-as HDMI1"
Thanks for the suggestion. Wouldn't this mirror the displays though?
 
Old 09-17-2020, 10:10 AM   #6
lightstream
LQ Newbie
 
Registered: Jul 2008
Location: Berlin, DE
Distribution: Arch
Posts: 15

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by bgstack15 View Post
technical achievement of two separate X servers, one for each monitor
That is apparently a possibility - it could be what is referred to as ZaphodDisplay, which as well as having two separate sets of workspaces on each monitor, also has separate keyboard and mouse for each. But maybe ZaphodDisplay is something else again!

Anyway, what I want to do is run a single X server, but configured to treat each monitor as a separate output rather than combining both into a single "stretched" display. (I don't mind not being able to drag windows from one screen to the other, but I do want shared keyboard, mouse and clipboard)

Quote:
Originally Posted by bgstack15 View Post
All these words, like monitor, screen, display, I expect can all be translated to the same word in other languages so the nuances are indeed tricky.
This certainly doesn't help!

Last edited by lightstream; 09-17-2020 at 10:12 AM.
 
Old 09-17-2020, 10:18 AM   #7
lightstream
LQ Newbie
 
Registered: Jul 2008
Location: Berlin, DE
Distribution: Arch
Posts: 15

Original Poster
Rep: Reputation: 1
I've tried a few things with my config but not been able to get any further - I still have the single stretched screen but with $DISPLAY set to :0.0

This is my config at the moment:

Code:
Section "Monitor"
    Identifier  "laptop"
EndSection

Section "Monitor"
    Identifier  "external"
EndSection

Section "Device"
  Identifier	"Intel Graphics"
  Driver	"intel"
  Option	"Monitor-eDP1" "laptop"
  Option	"Monitor-HDMI1" "external"
EndSection

Section "Screen"
  Identifier    "Screen0"
  Device        "Intel Graphics"
  Monitor       "external"
EndSection

Section "Screen"
  Identifier	"Screen1"
  Device	"Intel Graphics"
  Monitor	"laptop"
EndSection

Section "ServerLayout"
  Identifier	"Double Layout"
  Option	"Xinerama" "off"
  Screen	0 "Screen0"
  Screen	1 "Screen1" RightOf "Screen0"
EndSection
From what I see in the log, X is reading my config correctly:

Code:
.
.
[ 68314.227] (==) Log file: "/home/lightstream/.local/share/xorg/Xorg.0.log", Time: Thu Sep 17 17:21:14 2020
[ 68314.228] (==) Using config directory: "/etc/X11/xorg.conf.d"
[ 68314.229] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 68314.229] (==) ServerLayout "Double Layout"
[ 68314.229] (**) |-->Screen "Screen0" (0)
[ 68314.229] (**) |   |-->Monitor "external"
[ 68314.229] (**) |   |-->Device "Intel Graphics"
[ 68314.229] (**) |-->Screen "Screen1" (1)
[ 68314.229] (**) |   |-->Monitor "laptop"
[ 68314.229] (**) |   |-->Device "Intel Graphics"
[ 68314.229] (**) Option "Xinerama" "off"
.
.
.
[ 68314.257] (II) intel(0): Output eDP1 using monitor section laptop
[ 68314.258] (**) intel(0): Found backlight control interface intel_backlight (type 'raw') for output eDP1
[ 68314.258] (II) intel(0): Enabled output eDP1
[ 68314.258] (II) intel(0): Output HDMI1 using monitor section external
[ 68314.258] (II) intel(0): Enabled output HDMI1
[ 68314.258] (--) intel(0): Using a maximum size of 256x256 for hardware cursors
[ 68314.258] (II) intel(0): Output VIRTUAL1 has no monitor section
[ 68314.258] (II) intel(0): Enabled output VIRTUAL1
[ 68314.258] (--) intel(0): Output eDP1 using initial mode 1366x768 on pipe 0
[ 68314.258] (--) intel(0): Output HDMI1 using initial mode 1920x1080 on pipe 1
.
.

Last edited by lightstream; 09-17-2020 at 10:26 AM.
 
Old 09-17-2020, 10:28 AM   #8
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Be aware that some Intel graphics chips have a shared frame buffer which prevents running the two monitors as independent displays. Check for 'EE' lines in /var/log/Xorg.*.log. It should always work for separate cards.

This thread has some useful info:
https://www.linuxquestions.org/quest...cs-4175563730/
 
Old 09-17-2020, 11:43 AM   #9
lightstream
LQ Newbie
 
Registered: Jul 2008
Location: Berlin, DE
Distribution: Arch
Posts: 15

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by smallpond View Post
Be aware that some Intel graphics chips have a shared frame buffer which prevents running the two monitors as independent displays. Check for 'EE' lines in /var/log/Xorg.*.log. It should always work for separate cards.
Checked that and nothing worrying popped up, thanks.

Quote:
Originally Posted by smallpond View Post
This chap is trying to do exactly what I want, I wonder if he succeeded?

Good news is that I appear to have done it - it turns out I was mistaken about the Zaphod Display: that is in fact what I want, the other configuration where each monitor has its own keyboard/mouse/clipboard is called MultiSeat.

So this is my working config:

Code:
Section "Device"
  Identifier	"Intel Graphics 0"
  Driver	"intel"
  Option        "ZaphodHeads" "HDMI1"
  Option	"AccelMethod" "sna"
  Screen	0	
EndSection

Section "Device"
  Identifier    "Intel Graphics 1"
  Driver        "intel"
  Option        "ZaphodHeads" "eDP1"
  Option	"AccelMethod" "sna"
  Screen	1
EndSection

Section "Screen"
  Identifier    "Screen0"
  Device        "Intel Graphics 0"
EndSection

Section "Screen"
  Identifier	"Screen1"
  Device	"Intel Graphics 1"
EndSection

Section "ServerLayout"
  Identifier	"Double Layout"
  Screen	"Screen0" 0 0
  Screen	"Screen1" RightOf "Screen0"
EndSection
This works - at least it does when I start plain X without any other window manager. I can start a terminal on each display, and launch programs that start on the same display as the terminal.

However some programs seem to ignore the $DISPLAY variable and always start on screen 0 - this happens for xfce4-terminal for example. I do recall reading somewhere that some window managers/DEs have recently have dropped support for ZaphodHeads so I will probably now have to spend some time finding one that works.

At the moment, I've started compiz from the plain X session and it seems to work, but without any wallpaper or panels.

Thanks all for your help!
 
Old 09-18-2020, 09:03 AM   #10
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Most X programs take a display argument, so can be started on your current display by playing around with xinit stuff and your DISPLAY environment variable.

I've never heard the two-head mode called "Zaphod" but it makes sense. Anyway, the answer must be 42.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Set up two separate screens instead of multi-monitor screen in xorg 10110111 Linux - Desktop 7 09-13-2009 12:49 PM
Dual Head, Twin view, separate X window - things you can do with multi displays MonsterMaxx Linux - Newbie 24 10-18-2008 01:04 AM
multi head with separate sessions? machs_fuel Linux - Desktop 1 10-15-2007 06:28 PM
Two screens on separate graphic-cards. Possible on linux? Ac1db0rN Linux - Software 2 03-13-2005 09:16 AM
Multi-monitor Issues on RH9, Geforce 4 Ti Dual Head + TNT2 Single Head the letter b Linux - Newbie 3 12-04-2004 11:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 12:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration