LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Easy xorg.conf changing with a script? (http://www.linuxquestions.org/questions/linux-general-1/easy-xorg-conf-changing-with-a-script-736530/)

Jeff91 06-29-2009 05:32 PM

Easy xorg.conf changing with a script?
 
I have two different xorg.conf setups that I use, one when I have my 32inch LCD connected and one when I do not, is there a way I can create a file that makes it a one click process to swap the configuration it uses? I often let my roomates use my laptop to watch videos and the nVidia configuration is not so user friendly for a computer nooby.

~Jeff

GrapefruiTgirl 06-29-2009 06:06 PM

Actually, the process of using multiple setups is not *that* simple, but it *is* simple, you just go about it another way:

One thing to remember is that when changing the configuration, X must be restarted (or a second session started) in order for the new configuration to be used.

The way to do it is with the --layout switch on the command-line that starts X. For example, a command-line like:

startx --layout=television -- :1

will start an X session on the first available tty, using the 'television' layout.

A 'layout' is defined inside the xorg.conf file; it is the 'ServerLayout" section. Most files have only one 'ServerLayout' section-- the default one. You can make a second (or more) different layouts by making new 'ServerLayout' sections each with their own 'Identifier', as long as the Device, Screen, Monitor etc. all exist elsewhere in the file (I mean, the different Layouts can share other components of the file). The 'Identifier' is the name you would use with the --layout switch.

This is way less confusing than trying to edit the config file with a script; that will get messy.

Sasha

PS - Making a button to make it a one-click process might work, but I have never tried it. The executable/command line of the button would likely be pretty much alike the commandline I gave above, with the --layout switch.

Jeff91 06-29-2009 09:02 PM

Alrighty, I understood most of what you said. One question though, how is my nVidia settings able to add my television to a "twin view" with out forcing an x-restart, is there a way I can do this with a script or a command do you know?

~Jeff

GrapefruiTgirl 06-29-2009 09:18 PM

There's not a way that _I_ know, but that doesn't mean there isn't a way.

I use nvidia-settings too, and every time it offers to do something for me without re-starting X, it fails, and I need to restart X anyway if I want to see the change. I use nvidia-settings more like an info source than as a tool for actually doing something to the server.

NOTE: in my first reply, the command I gave to start X in a second tty, does not kill the running session, it just starts a second one; so for example, if you're using the machine, and you want to lend it to your friend or whatever to watch TV, you can start a second session for the friend, while leaving your first session intact; when the friend is done, just log out of that session, and you will be returned to your own session (or you can switch back and forth any time with CTRL-ALT-[1-7])

Sorry I can't give any specifics about your exact question regarding nvidia-settings, but I hope this info has helped you in some way :)

Sasha

Jeff91 06-30-2009 07:58 AM

Yep, def helpful thank you much for the replies, I've actually been playing with a second X server for games. Any-who I've never had an issue with nvidia-settings not working for me (with or without a restart) so I will have to keep looking online I guess :)

~Jeff


All times are GMT -5. The time now is 09:33 AM.