Command to load nVidia x-server dual monitor settings in Ubuntu Terminal?

I connected the AV receiver to the 760 GeForce video card with HDMI, and connected the av with a 2nd HDMI cable to the monitor (not necessary). I then connected a DVI cable from the video card to the monitor, since the HDMI did not support 1920x1200 (only 1920x1080) resolution.

The mirror display settings in Ubuntu System Setting crashes when I select it. But thankfully the x-server allowed me to mirror the av receiver with the monitor as primary. When I go back to Ubuntu display, mirror is already selected, due to adjusting it in x-server.
I have attached a picture of the configuration settings.

To export the settings, I had to execute the following in terminal; sudo nvidia-settings does not work.

sudo chmod u+x /usr/share/screen-resolution-extra/nvidia-polkit

Then click ‘Save to X configuration’ file, located in /etc/X11/xorg.conf.

Ubuntu supposedly looks for the file at, /usr/share/X11/xorg.conf.d/10-nvidia.conf.

I copied and pasted the contents (appended) to 10-nvdia, after the following contents:

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg"
EndSection

This is the paste-bin of the file
[New users aren’t allowed to post links], but I can paste the entire contents in a later post.

There’s another configuration that x-server can export when you go to ‘nvidia-settings Configuration’ > Save current configuration; I also selected and deselected ‘Include x display name in files’, and it made no difference in what I’m trying to achieve.

This exports a hidden file named ‘.nvidia-settings-rc’ to the /home directory. This is the paste bin:
[New users aren’t allowed to post links], but I can paste the entire contents in a later post.

The command ‘nvidia-settings -l’ did not load the desired ‘mirror’ settings upon system restart. This supposedly loads ‘.nvidia-settings-rc’.

I used the more explicit commands:
nvidia-settings --config=~/.nvidia-settings-rc --load-config-only
Mirror settings did not load

nvidia-settings --config=/usr/share/X11/xorg.conf.d/10-nvidia.conf --load-config-only
Got error message: ‘Section “ServerLayout”’ (Unrecognized attribute name).

Since Ubuntu is able to remember the settings upon restart, my main goal is to write a bash script that will load at start up, and execute the settings file.

I’ve also verified x-server is a ‘Start up’ program with the command, gnome-session-properties.

You can’t load Xorg config files on the fly after the server has started.
You should be able to use xrandr instead.

Thank you for the response

I encountered a StackExchange post saying to specify script file in the directory:
`‘~/.config/autostart/setup_monitor_display.desktop’

With their desired configuration of:

# Wait until GUI is ready
X-GNOME-Autostart-Delay=1
xrandr --output DP-0 --rotate left

I executed xrandr, and got the following the for HDMI-0, the ‘monitor’ I keep needing to adjust and mirror:

HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 708mm x 398mm panning 1920x1200+0+0
   1920x1080     60.05*+  59.94    50.00    60.00    50.04  
   2880x576      50.00  
   2880x480      59.94  
   1440x576      50.00  
   1440x480      59.94  
   1280x720      59.94    50.00  
   720x576       50.00  
   720x480       59.94  

My main question now is what command(s) would I send to xrandr to duplicate these settings, that were set with x-server GUI?

Please post the output of
xrandr --verbose

1 Like

This is the output of xrandr --verbose

Screen 0: minimum 8 x 8, current 1920 x 1200, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x27c
	Timestamp:  271538
	Subpixel:   unknown
	Clones:    
	CRTCs:      0 1 2 3
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: VGA 
		supported: VGA
	ConnectorType: DVI-I 
	ConnectorNumber: 0 
	_ConnectorLocation: 0 
	non-desktop: 0 
		supported: 0, 1
DVI-I-1 connected primary 1920x1200+0+0 (0x27e) normal (normal left inverted right x axis y axis) 519mm x 324mm
	Identifier: 0x27d
	Timestamp:  271538
	Subpixel:   unknown
	Gamma:      1.0:1.0:1.0
	Brightness: 1.0
	Clones:    
	CRTC:       0
	CRTCs:      0 1 2 3
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	_MUTTER_PRESENTATION_OUTPUT: 0 
	CTM: -512002428 0 210152598 0 218215461 0 56107070 -2147483648 293532144 1 166099966 -2147483648 30889904 0 15801716 0 
		-329035457 0 
	CscMatrix: 57723 3206 3329 0 -856 70014 -2534 0 471 241 60515 0 
	EDID: 
		00ffffffffffff0009d10a7845540000
		07120103803420782ec5c4a3574a9c23
		124f52a56b807100810095008180b300
		a940d1000101283c80a070b023403020
		360007442100001a000000ff004b3238
		3037323437534c300a20000000fd0032
		551f5e11000a202020202020000000fc
		0042656e51204732343030570a200004
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: TMDS 
		supported: TMDS
	ConnectorType: DVI-I 
	ConnectorNumber: 0 
	_ConnectorLocation: 0 
	non-desktop: 0 
		supported: 0, 1
  1920x1200 (0x27e) 154.000MHz +HSync -VSync *current +preferred
        h: width  1920 start 1968 end 2000 total 2080 skew    0 clock  74.04KHz
        v: height 1200 start 1203 end 1209 total 1235           clock  59.95Hz
  1920x1200 (0x27f) 193.250MHz -HSync +VSync
        h: width  1920 start 2056 end 2256 total 2592 skew    0 clock  74.56KHz
        v: height 1200 start 1203 end 1209 total 1245           clock  59.88Hz
  1680x1050 (0x280) 146.250MHz -HSync +VSync
        h: width  1680 start 1784 end 1960 total 2240 skew    0 clock  65.29KHz
        v: height 1050 start 1053 end 1059 total 1089           clock  59.95Hz
  1600x1200 (0x281) 162.000MHz +HSync +VSync
        h: width  1600 start 1664 end 1856 total 2160 skew    0 clock  75.00KHz
        v: height 1200 start 1201 end 1204 total 1250           clock  60.00Hz
  1440x900 (0x282) 106.500MHz -HSync +VSync
        h: width  1440 start 1520 end 1672 total 1904 skew    0 clock  55.93KHz
        v: height  900 start  903 end  909 total  934           clock  59.89Hz
  1280x1024 (0x283) 135.000MHz +HSync +VSync
        h: width  1280 start 1296 end 1440 total 1688 skew    0 clock  79.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  75.02Hz
  1280x1024 (0x284) 108.000MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock  63.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  60.02Hz
  1280x800 (0x285) 83.500MHz -HSync +VSync
        h: width  1280 start 1352 end 1480 total 1680 skew    0 clock  49.70KHz
        v: height  800 start  803 end  809 total  831           clock  59.81Hz
  1152x720 (0x286) 67.320MHz -HSync +VSync
        h: width  1152 start 1208 end 1328 total 1504 skew    0 clock  44.76KHz
        v: height  720 start  721 end  724 total  746           clock  60.00Hz
  1024x768 (0x287) 78.750MHz +HSync +VSync
        h: width  1024 start 1040 end 1136 total 1312 skew    0 clock  60.02KHz
        v: height  768 start  769 end  772 total  800           clock  75.03Hz
  1024x768 (0x288) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x289) 49.500MHz +HSync +VSync
        h: width   800 start  816 end  896 total 1056 skew    0 clock  46.88KHz
        v: height  600 start  601 end  604 total  625           clock  75.00Hz
  800x600 (0x28a) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  640x480 (0x28b) 31.500MHz -HSync -VSync
        h: width   640 start  656 end  720 total  840 skew    0 clock  37.50KHz
        v: height  480 start  481 end  484 total  500           clock  75.00Hz
  640x480 (0x28c) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz
HDMI-0 connected 1920x1080+0+6 (0x28e) normal (normal left inverted right x axis y axis) 708mm x 398mm panning 1920x1200+0+0
	Identifier: 0x28d
	Timestamp:  271538
	Subpixel:   unknown
	Gamma:      1.0:1.0:1.0
	Brightness: 1.0
	Clones:    
	CRTC:       1
	CRTCs:      0 1 2 3
	Panning:    1920x1200+0+0
	Tracking:   1920x1200+0+0
	Border:     0/0/0/0
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	_MUTTER_PRESENTATION_OUTPUT: 0 
	CTM: 434878549 1 382522311 0 58804353 -2147483648 98724944 -2147483648 123475046 1 72766510 -2147483648 3461663 -2147483648 102694674 -2147483648 
		-999132105 0 
	CscMatrix: 72171 5836 -897 0 -1506 67420 -1110 0 -52 -1566 50290 0 
	EDID: 
		00ffffffffffff0065a8713100000000
		00160103800000780a0dc9a057479827
		12484c00000001010101010101010101
		010101010101011d8018711c1620582c
		2500c48e2100009e011d80d0721c1620
		102c2580c48e2100009e000000fc0052
		582d563437330a2020202020000000fd
		0017790f5b0f000a2020202020200119
		020345745a850402030607100e0f0a0b
		23241413111215161f1d1e191a252638
		097f070f7f071507503e1fc04d020057
		06006754005f5401835f000068030c00
		11008021008c0ad08a20e02d10103e96
		00138e210000188c0ad090204031200c
		405500138e2100001800000000000000
		0000000000000000000000000000005f
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: TMDS 
		supported: TMDS
	ConnectorType: HDMI 
	ConnectorNumber: 2 
	_ConnectorLocation: 2 
	non-desktop: 0 
		supported: 0, 1
  1920x1080 (0x28e) 74.250MHz +HSync +VSync Interlace *current +preferred
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  33.75KHz
        v: height 1080 start 1084 end 1094 total 1124           clock  60.05Hz
  2880x576 (0x28f) 108.000MHz -HSync -VSync
        h: width  2880 start 2928 end 3184 total 3456 skew    0 clock  31.25KHz
        v: height  576 start  581 end  586 total  625           clock  50.00Hz
  2880x480 (0x290) 108.000MHz -HSync -VSync
        h: width  2880 start 2944 end 3192 total 3432 skew    0 clock  31.47KHz
        v: height  480 start  489 end  495 total  525           clock  59.94Hz
  1920x1080 (0x291) 148.350MHz +HSync +VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  67.43KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  59.94Hz
  1920x1080 (0x292) 148.500MHz +HSync +VSync
        h: width  1920 start 2448 end 2492 total 2640 skew    0 clock  56.25KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  50.00Hz
  1920x1080 (0x293) 74.180MHz +HSync +VSync Interlace
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  33.72KHz
        v: height 1080 start 1084 end 1094 total 1124           clock  60.00Hz
  1920x1080 (0x294) 74.250MHz +HSync +VSync Interlace
        h: width  1920 start 2448 end 2492 total 2640 skew    0 clock  28.12KHz
        v: height 1080 start 1084 end 1094 total 1124           clock  50.04Hz
  1440x576 (0x295) 54.000MHz -HSync +VSync
        h: width  1440 start 1464 end 1592 total 1728 skew    0 clock  31.25KHz
        v: height  576 start  581 end  586 total  625           clock  50.00Hz
  1440x480 (0x296) 54.000MHz -HSync -VSync
        h: width  1440 start 1472 end 1596 total 1716 skew    0 clock  31.47KHz
        v: height  480 start  489 end  495 total  525           clock  59.94Hz
  1280x720 (0x297) 74.180MHz +HSync +VSync
        h: width  1280 start 1390 end 1430 total 1650 skew    0 clock  44.96KHz
        v: height  720 start  725 end  730 total  750           clock  59.94Hz
  1280x720 (0x298) 74.250MHz +HSync +VSync
        h: width  1280 start 1720 end 1760 total 1980 skew    0 clock  37.50KHz
        v: height  720 start  725 end  730 total  750           clock  50.00Hz
  720x576 (0x299) 27.000MHz -HSync -VSync
        h: width   720 start  732 end  796 total  864 skew    0 clock  31.25KHz
        v: height  576 start  581 end  586 total  625           clock  50.00Hz
  720x480 (0x29a) 27.000MHz -HSync -VSync
        h: width   720 start  736 end  798 total  858 skew    0 clock  31.47KHz
        v: height  480 start  489 end  495 total  525           clock  59.94Hz
DP-0 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x29b
	Timestamp:  271538
	Subpixel:   unknown
	Clones:    
	CRTCs:      0 1 2 3
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: TMDS 
		supported: TMDS
	ConnectorType: DisplayPort 
	ConnectorNumber: 3 
	_ConnectorLocation: 3 
	non-desktop: 0 
		supported: 0, 1
DVI-D-0 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x29c
	Timestamp:  271538
	Subpixel:   unknown
	Clones:    
	CRTCs:      0 1 2 3
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: TMDS 
		supported: TMDS
	ConnectorType: DVI-D 
	ConnectorNumber: 1 
	_ConnectorLocation: 1 
	non-desktop: 0 
		supported: 0, 1
DP-1 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x29d
	Timestamp:  271538
	Subpixel:   unknown
	Clones:    
	CRTCs:      0 1 2 3
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: DisplayPort 
		supported: DisplayPort
	ConnectorType: DisplayPort 
	ConnectorNumber: 3 
	_ConnectorLocation: 3 
	non-desktop: 0 
		supported: 0, 1

Ok, seems you’re using panning on the lower resolution, please try this:
xrandr --fb 1920x1200 --output DVI-I-1 --pos 0x0 --output HDMI-0 --pos 0x0 --panning 1920x1200
You might also try scaling instead of panning
xrandr --fb 1920x1200 --output DVI-I-1 --pos 0x0 --output HDMI-0 --pos 0x0 --scale 1x1.11

1 Like

Thank you very much.

The following worked:

 xrandr --fb 1920x1200 --output DVI-I-1 --pos 0x0 --output HDMI-0 --pos 0x0 --panning 1920x1200

While the other, --scale 1x1.11, resulted in the ‘Wallpaper/Desktop background’ appearing before the list of applications when I click the 9 squares at the lower left hand corner of the screen, requiring me to do ‘Alt F2’, then R key, essentially nullifying the xrandr settings.

To persist the settings, I went to cd ~/.config/autostart/, and created a setup_monitor_display.txt, and made it executable with, sudo chmod +x setup_monitor_display.txt.

Then execute gnome-session-properties in terminal, click Add button on the GUI, Name it, then for command: sh -c '~/.config/autostart/setup_monitor_display.txt'. I also disabled/unchecked the ‘NVIDIA X-server Settings App’ which may not be necessary.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.