LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Two monitor setup when you temporarily only have one? (https://www.linuxquestions.org/questions/linux-hardware-18/two-monitor-setup-when-you-temporarily-only-have-one-469046/)

timread 07-30-2006 02:52 AM

Two monitor setup when you temporarily only have one?
 
I have a small portable (Sony Vaio TX2XP) and am running Kubuntu Dapper. I have set up X using Xinerama to work with an external 19 TFT monitors and it is great. The problem is that when I am on a trip and only use the portables built in monitor, X still thinks there are two monitors and some applications (windows) appear where the external monitor should be, and I cannot access them.

I know that I can copy over my old version of xorg.conf and restart X to get around the problem, but it is a real pain...

Is there some command I can run to let X know that I don't have the external monitor plugged in.

Thanks,

Tim

lurko 07-31-2006 11:58 PM

you could setup more than one serverlayout in your xorg.conf, one for your default setup and one for your sometimes-1-screen-only setup.

then use
Code:

startx -- -layout nameoflayout
to start X with just the one screen.

You should add
Code:

Option  "DefaultServerLayout" "nameoflayout"
to the ServerFlags section too in this case, adding the ServerFlags section if you don't have one. I'm not sure what criteria is used to decide which layout to use without the DefualtServerLayout option present, so this might not be absolutely necessary. If you have more than one layout though, it would seem logical to have the defualt layout option.

I don't know how this helps you though if you boot right into runlevel 5, sorry.

timread 08-01-2006 01:29 AM

[QUOTE=lurko]you could setup more than one serverlayout in your xorg.conf, one for your default setup and one for your sometimes-1-screen-only setup.

then use
Code:

startx -- -layout nameoflayout
to start X with just the one screen.


That is an excellant idea. The only problem is that I don't know how to specify more than one server layout in the xorg.conf file. I guess it doesn't matter I can define two xorg files:

xorg.conf1
xorg.conf2

And then write a shell script:

cp xorg.conf1 xorg.conf
startx


Thanks,

Tim

timread 08-01-2006 01:29 AM

Just one question, how do I stop X from starting automatically when I log in?

Thanks,

Tim

eccles42 08-02-2006 05:08 PM

couldn't you just use metamodes?

I do that for UT2004, got two monitors and UT likes the spot in the middle, GRR!
Sooo....
I've defined a two monitor set up, and added a metamode with null for one of the monitors, this should solve your problem.
I'm using gnome and just hit ctrl+alt++/- to cycle through the modes.
Here's the line in my xorg file:


Option "MetaModes" "1280x1024,1280x1024; 1280x1024,NULL"
(in the screen section)
computer starts up with two monitors, then I can hit ctrl+alt++ and it turns off the second monitor :)

Good luck

lurko 08-03-2006 06:30 PM

Quote:

Originally Posted by timread
The only problem is that I don't know how to specify more than one server layout in the xorg.conf file.

you just add another... if your default xorg.conf has device and screen sections for your laptop monitor and your two 19" monitors, then you just add a new Section "ServerLayout", with a different identifier, that uses just one screen, and leaving your multi-monitor layout alone.

Code:

Section "ServerLayout"
    Identifier        "roving"
    Screen            0 "laptop_screen" 0 0
    InputDevice    "Mouse1" "CorePointer"
    InputDevice    "Keyboard1" "CoreKeyboard"
EndSection

obviously you would point the layout to the correct screen and input devices for your laptop.

and then put in a ServerFlags section(or just the option if this section is already present) to specify which layout to use when nothing is specified with startx -- -layout
Code:

Section "ServerFlags"
      Option  "DefaultServerLayout" "default"
Endsection

so if your layout with the dual 19's (and the laptop screen?) had the identifier "default", just running startx would use that layout. and running startx -- -layout roving would startup the layout that only uses the screen "laptop_screen".



I believe you set the default runlevel in /etc/initab, but I have not yet done any fiddling with that so I can't comment any further. I also suppose it's possible that some distros do it differently... I bet there's something in the LQwiki


All times are GMT -5. The time now is 08:04 AM.