LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-24-2012, 01:33 PM   #1
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 229

Rep: Reputation: 30
NVidia / Ubuntu auto-detect / select external monitor


I have a laptop on a docking station and would like, when docked, for the laptop to recognize the external monitor and use just that monitor. When off the docking station, it should (obviously) use just the laptop screen.

If I set it up so that the laptop screen is disabled, it does auto-recognize the external monitor, but unsurprisingly, when disconnected from the dock, does not come back to the screen.

When I set it up as twinview or separate xview (problematic if it isn't connected), the laptop seems to think the external monitor is always there, and will allow programs to start up on that (disconnected) monitor.

Any way to set this automatically? I'm using Nvidia's X Server Settings gui and have installed the nvidia drivers, and I'm using Ubuntu 11.10.

Every thread I've seen is from 2009 or before and hasn't had a solution. Any thoughts?
 
Old 02-25-2012, 01:05 PM   #2
bmarx
Member
 
Registered: Dec 2004
Distribution: Slackware, Arch, FreeBSD
Posts: 202

Rep: Reputation: 34
You may want to have a look at xrandr:

http://www.thinkwiki.org/wiki/Xorg_RandR_1.2
 
Old 02-27-2012, 04:56 PM   #3
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 229

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by bmarx View Post
You may want to have a look at xrandr:

http://www.thinkwiki.org/wiki/Xorg_RandR_1.2
Looks like this might be the right track. Going to have to mess with it a while to figure it out (my first attempt made the machine unbootable ... whoops ... as in, hung on boot).
 
Old 02-27-2012, 05:43 PM   #4
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 229

Original Poster
Rep: Reputation: 30
Ok ... I'm trying to follow the above xrandr information, but not getting anywhere. Here's the output ... maybe someone can point me in the right direction:

The generated xorg.conf file from X -configure (which I replaced /etc/X11/xorg.conf with and then restarted):
Code:
Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	Screen      1  "Screen1" RightOf "Screen0"
	Screen      2  "Screen2" RightOf "Screen1"
	Screen      3  "Screen3" RightOf "Screen2"
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
	ModulePath   "/usr/lib/xorg/modules"
	FontPath     "/usr/share/fonts/X11/misc"
	FontPath     "/usr/share/fonts/X11/cyrillic"
	FontPath     "/usr/share/fonts/X11/100dpi/:unscaled"
	FontPath     "/usr/share/fonts/X11/75dpi/:unscaled"
	FontPath     "/usr/share/fonts/X11/Type1"
	FontPath     "/usr/share/fonts/X11/100dpi"
	FontPath     "/usr/share/fonts/X11/75dpi"
	FontPath     "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
	FontPath     "built-ins"
EndSection

Section "Module"
	Load  "record"
	Load  "dri2"
	Load  "extmod"
	Load  "dri"
	Load  "dbe"
	Load  "glx"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/input/mice"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Monitor"
	Identifier   "Monitor1"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Monitor"
	Identifier   "Monitor2"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Monitor"
	Identifier   "Monitor3"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "SWcursor"           	# [<bool>]
        #Option     "HWcursor"           	# [<bool>]
        #Option     "NoAccel"            	# [<bool>]
        #Option     "ShadowFB"           	# [<bool>]
        #Option     "VideoKey"           	# <i>
        #Option     "WrappedFB"          	# [<bool>]
        #Option     "GLXVBlank"          	# [<bool>]
        #Option     "ZaphodHeads"        	# <str>
        #Option     "PageFlip"           	# [<bool>]
	Identifier  "Card0"
	Driver      "nouveau"
	BusID       "PCI:1:0:0"
EndSection

Section "Device"
	Identifier  "Card1"
	Driver      "nvidia"
	BusID       "PCI:1:0:0"
   Option "monitor1" "Monitor1"
   Option "monitor2" "Monitor2"
   Option "monitor3" "Monitor3"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "ShadowFB"           	# [<bool>]
        #Option     "Rotate"             	# <str>
        #Option     "fbdev"              	# <str>
        #Option     "debug"              	# [<bool>]
	Identifier  "Card2"
	Driver      "fbdev"
	BusID       "PCI:1:0:0"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "ShadowFB"           	# [<bool>]
        #Option     "DefaultRefresh"     	# [<bool>]
        #Option     "ModeSetClearScreen" 	# [<bool>]
	Identifier  "Card3"
	Driver      "vesa"
	BusID       "PCI:1:0:0"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection

Section "Screen"
	Identifier "Screen1"
	Device     "Card1"
	Monitor    "Monitor1"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection

Section "Screen"
	Identifier "Screen2"
	Device     "Card2"
	Monitor    "Monitor2"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection

Section "Screen"
	Identifier "Screen3"
	Device     "Card3"
	Monitor    "Monitor3"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection
And the output of xrandr -q
Code:
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 320 x 175, current 1920 x 1080, maximum 1920 x 1080
default connected 1920x1080+0+0 0mm x 0mm
   1920x1080      50.0*    51.0     52.0     53.0  
   1680x1050      54.0  
   1600x1024      55.0  
   1440x900       56.0  
   1400x1050      57.0  
   1360x768       58.0     59.0  
   1280x1024      60.0     61.0  
   1280x960       62.0  
   1152x864       63.0     64.0     65.0     66.0     67.0     68.0  
   1024x768       69.0     70.0     71.0     72.0     73.0     74.0  
   960x720        75.0  
   960x600        76.0  
   960x540        77.0  
   928x696        78.0  
   896x672        79.0     80.0  
   840x525        81.0     82.0     83.0     84.0     85.0  
   832x624        86.0  
   800x600        87.0     88.0     89.0     90.0     91.0     92.0     93.0     94.0     95.0     96.0  
   800x512        97.0  
   720x450        98.0  
   720x400        99.0  
   700x525       100.0    101.0    102.0    103.0  
   680x384       104.0    105.0  
   640x512       106.0    107.0    108.0  
   640x480       109.0    110.0    111.0    112.0    113.0    114.0  
   640x400       115.0  
   640x350       116.0  
   576x432       117.0    118.0    119.0    120.0    121.0    122.0    123.0  
   512x384       124.0    125.0    126.0    127.0    128.0  
   416x312       129.0  
   400x300       130.0    131.0    132.0    133.0    134.0  
   360x200       135.0  
   320x240       136.0    137.0    138.0    139.0  
   320x200       140.0  
   320x175       141.0
I have two monitors plugged in. One via the laptop's VGA port and one via the dock that it's sitting in (there's actually two DVI ports there, but I'm only using one). Makes no difference to this output whether I'm in the dock or not. The other monitor, and the only one displaying anything is the laptop screen.

thoughts?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Too many launcher bars? How to auto-select external monitor vs laptop screen JohnLocke Linux - Newbie 1 02-24-2012 01:09 PM
Auto Setup External Monitor jededale Linux - Newbie 5 08-08-2011 06:42 PM
Toshiba Tecra M2S w/ NVIDIA GeForce FX Go5200 driving Dell external monitor in Ubuntu DavidEscher Linux - Newbie 4 03-29-2010 09:18 PM
How to detect external monitor connection on laptop xflow7 Linux - Mobile 6 08-12-2009 05:06 AM
Disable Xorg Monitor Auto Detect! wh33t Linux - Software 1 06-02-2005 07:02 AM


All times are GMT -5. The time now is 03:18 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration