Linux: Setting primary display (nvidia) from command line

I succeed to exactly do what you mean, maybe because I have the 2.3 version, on ubuntu 10.04 with nvidia-setting v 1.0


Following The Bug Fix:

this has been listed as a big once :

https://bugs.launchpad.net/disper/+bug/321288

by version 2.1 should work as you asked on 20010-04 and the 'bug fix' was confirmed on 2009-02-16

What I Had

by using:

disper -l

there I saw my devices were:

  • DFP-0: LGD (laptop display)
  • CRT-0: Samsung SyncMaster (external monitor)

(the external device doesn't show up by querying with xrandr)

What I Wanted and How

The laptop is on the right and the monitor is on the left, i wanted the laptop to be extended from the Samsung, thus, having the laptop physically top aligned, I wanted them to be also logically top aligned and have theyr own maxymum resolution:

disper -d CRT-0,DFP-0 -r auto -e -t right

this has to be read as: (-d) opertate first on SyncMaster then on laptop lcd, (-r) consider auto resolution, (-e) extend the second dysplay [second here is laptop because the -d set display ordering], (-t) extend the second display [laptop] to the right of the first.

Google Properly and Try First

Very Simple no nvidia-hacking needed. Hope it helps.


Cheers

Splinux