PDA

View Full Version : [all variants] Turn second monitor to clone or disabled



signull
February 14th, 2010, 06:59 AM
Hello, i am Running Ubuntu 9.10 i have a Nvidia Graphics card and Driver 185. i want to know the arguement to send to startx or how to make a simple shells script to go between having one monitor on or setting up dual monitor support. (i'd leave it at dual monitor support however my second monitor is actually my tv)

My Xorg.conf for a single monitor is

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 1.0 (buildd@crested) Sun Feb 1 20:25:37 UTC 2009

Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "Module"
Load "dbe"
Load "extmod"
Load "type1"
Load "freetype"
Load "glx"
EndSection

Section "ServerFlags"
Option "Xinerama" "0"
EndSection

Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Acer P223W"
HorizSync 31.0 - 84.0
VertRefresh 56.0 - 77.0
Option "DPMS"
EndSection

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce 7300 SE/7200 GS"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "TwinView" "0"
Option "TwinViewXineramaInfoOrder" "DFP-0"
Option "metamodes" "DFP: 1680x1050 +0+0"
SubSection "Display"
Depth 24
EndSubSection
EndSection
my Xorg.conf for dual monitor support where Twinview is on and the second monitor is a clone.

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 1.0 (buildd@crested) Sun Feb 1 20:25:37 UTC 2009

Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "Module"
Load "dbe"
Load "extmod"
Load "type1"
Load "freetype"
Load "glx"
EndSection

Section "ServerFlags"
Option "Xinerama" "0"
EndSection

Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor0"
VendorName "Unknown"
ModelName "BBY NS-L47Q09-10A"
HorizSync 30.0 - 76.0
VertRefresh 55.0 - 76.0
Option "DPMS"
EndSection

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce 7300 SE/7200 GS"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "TwinView" "1"
Option "TwinViewXineramaInfoOrder" "DFP-0"
Option "metamodes" "CRT: 1920x1080 +0+0, DFP: 1680x1050 +0+0; CRT: NULL, DFP: 1280x1024 +0+0"
SubSection "Display"
Depth 24
EndSubSection
EndSection
i've been trying to google for it and the closest ive come is maybe creating another Layout in the xorg.conf however all the threads ive read seem to be unsolved.

Satoru-san
February 14th, 2010, 07:03 AM
Multable moniters is basically windows expensive way to have multi desktops. In linux we have virtual desktops for this very reason! I couldn't live without mine, I used to use 3 moniters, but with linux I get 4 by default and can add as many as I want. chanses are you aren't able to look at all your moniters all at once or even the entire screen at once, so it is really very easy to ctl + alt + right or left arrow. When you add compiz to the mix you can even get a 3d cube ;)

Good luck.

studout
February 14th, 2010, 07:11 AM
Since you mention an argument to startx, I get the impression that you're willing to log out and back in again.

That being the case, I think this would be fairly easy.
You could create a shell script that would toggle the two xorg.conf files between xorg.conf and maybe xorg.conf__other_config, put a call to that script in a launcher button on the panel, click it, then logout, and back in, and you should have your other config.

This presumes that xorg reads the config exactly once; at startup/login.

Is this basically what you're after?
If not, I might have some other ideas.

Take Care,
studout