[SOLVED] Mirroring only Two out of Three Displays on MATE

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
crizzyeyes

[SOLVED] Mirroring only Two out of Three Displays on MATE

Post by crizzyeyes »

Hi all,

I've recently switched to Linux Mint from Windows after wanting to get to know Linux better in general, and decided that now would be a good time to do so since I needed to reformat my hard drive anyway; I'd bought my computer second-hand from a close friend, and he didn't wipe his own install.

Now, historically I have run my computer with two monitors for my actual work and/or gaming, with my television also connected via HDMI so I can entertain myself or guests with movies/shows on my hard drive. In Windows, this was as easy as setting my Panasonic TV to duplicate my second Asus monitor and making the first Asus independent. I understand that the underlying window/display manager is called "X," and communicates with my NVIDIA driver (I am using the proprietary driver, by the way). However, in both MATE's display settings and in NVIDIA's X server settings, I can't find anything that would do the same thing, only duplicate one screen across ALL displays.

In short: Is there any way in MATE (or X, I suppose might be the more valid question) to duplicate a screen across only two out of three available monitors and have the last one be independent?
The displays work completely fine otherwise; I can clone one screen across all of my displays or keep them completely separate, but there's no in-between.
I am using an NVIDIA GeForce 660 GTX. All of my displays are being served from the same video card (two DVI ports, one HDMI).
I am running Mint 17, 64-bit with MATE.

I would definitely appreciate any help on this, I've only even seen two other people ask the same question for a Linux machine and both of their threads went nowhere. All guides/articles/technical information seems to assume that I only have a dual monitor setup or that I otherwise want to keep all of displays separate.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Mirroring only Two out of Three Displays on MATE

Post by roblm »

crizzyeyes wrote:Is there any way in MATE (or X, I suppose might be the more valid question) to duplicate a screen across only two out of three available monitors and have the last one be independent?
Yes but a custom xorg.conf file is needed. The example below is connecting 3 screens to a GeForce GT 730 card, using the DVI, VGA and HDMI connectors. There is initially
an extended desktop display that spans across all 3 screens:

Code: Select all

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Option         "Xinerama" "0"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    ModelName      "LG Electronics L1720P"
    HorizSync       30.0 - 75.0
    VertRefresh     56.0 - 85.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    BoardName      "GeForce GT 730"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "nvidiaXineramaInfoOrder" "DFP-0"
    Option         "metamodes" "VGA-0: nvidia-auto-select +3200+28, DVI-D-0: nvidia-auto-select +1920+28, HDMI-0: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
To clone the VGA and HDMI screens, change the Horizontal position value of the VGA screen, which is 3200, to the same value as the HDMI screen, which is 0:

Code: Select all

Option         "metamodes" "VGA-0: nvidia-auto-select +0+28, DVI-D-0: nvidia-auto-select +1920+28, HDMI-0: nvidia-auto-select +0+0"
Here's the procedure. If you have previously made any changes with the 3 monitors connected in Preferences > Monitors, then open /home/your-user-name/.config (a hidden folder).
Rename the monitors.xml file to monitors.xml.old, otherwise the settings will conflict.

With the 3 monitors connected, use this command in the Terminal to create an xorg.conf file, unless there already is one:

Code: Select all

sudo nvidia-xconfig
Then open the Nvidia Settings utility and arrange the screens in the window as you want them, and select the Primary screen. Click “Apply”, and then click
Save to X Configuration File”. In the window that appears next, the box next to “Merge with existing file” should be checked. Click “Save”.
Open the xorg.conf file using this command:

Code: Select all

gksudo pluma /etc/X11/xorg.conf
Edit the “metamodes” line so that the Horizontal position value of the 2 screens you want cloned is the same. Log out and back in to see the change.
crizzyeyes

Re: Mirroring only Two out of Three Displays on MATE

Post by crizzyeyes »

Thanks for the detailed reply. Your solution was very simple and it worked. I must admit I had a sneaking suspicion that something relating to the position of the monitors would work. Out of curiosity, would it also function correctly if I simply set the horizontal position to be the same in the NVIDIA settings utility, or do I have to edit the xorg.conf file to get it to work?

Also, someone should really add something like this to the NVIDIA documentation or something. This was such a simple solution but I couldn't find it anywhere with my Google-fu.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Mirroring only Two out of Three Displays on MATE

Post by roblm »

crizzyeyes wrote:Out of curiosity, would it also function correctly if I simply set the horizontal position to be the same in the NVIDIA settings utility, or do I have to edit the xorg.conf file to get it to work?
Yes, and I forgot you could with a little trick. Initially the Nvidia Settings utility is opened to the Display Configuration page and the Advanced button is clicked, to display
the ViewPortOut box. However, any changes you try to make to this setting won't be saved because the “Apply” button is “Grayed out”, so it's inactive. However, I forgot that
you can trick the utility by first changing the setting in the Resolution box from “Auto” to the actual resolution in the drop-down menu, and back again to “Auto” if you want. Then
the “Apply” button will become active. Now you can change the Horizontal position number in the ViewPortOut box, click “Apply” and then “Save to X Configuration File”.
An xorg.conf file will still be created so that the change is persistent after restarting.
Locked

Return to “Graphics Cards & Monitors”