LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   starting X from the command line in a specific resolution (https://www.linuxquestions.org/questions/linux-general-1/starting-x-from-the-command-line-in-a-specific-resolution-91043/)

jdaniel 09-09-2003 07:52 PM

starting X from the command line in a specific resolution
 
Is there a way to start an X server in a specific resolution from the command line without having to edit a config file before hand? Sometimes I would like to run the server in 1280x1024 and other times I would like to run in 1024x768. I am trying to write scripts to automate this process.

Thanks.

DrOzz 09-09-2003 09:07 PM

maybe create a file(s) in /etc/X11 one called 1024 and the other called 1280...so their paths will be respectivly::
/etc/X11/1024
/etc/X11/1280
and the contents of them will be identical as the XF86Config file but only put the mode for what you want....
for /etc/X11/1024::
Modes "1024x768"
for /etc/X11/1280::
Modes "1280x1024"
so then when you want to start up (and i'll give one example) you could type ::
xinit -- :0 -xf86config 1024
to fire up X at 1024x768...
i think that will work, won't hurt to try....although there may be something easier, this is all i can come up with....
and you can always throw that last command in a script just for you can type something simpler...

jdaniel 09-09-2003 10:37 PM

Hmmm.. this is a good idea. I will try this and see how it works out. Thanks.

jdaniel 09-10-2003 03:28 PM

Thanks Drozz, that worked like a charm.

kazuni 09-10-2003 08:27 PM

try man startx, it also has a command-line switch for it. i frogot what it is, but it's something along the lines like startx --resolution 1280 1024 or soemthing like that :|

DrOzz 09-10-2003 09:25 PM

sweet d00d, glad to help :D


All times are GMT -5. The time now is 08:43 PM.