LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How to run xorg with different configuration files? (https://www.linuxquestions.org/questions/slackware-14/how-to-run-xorg-with-different-configuration-files-4175675903/)

slac 05-25-2020 11:58 PM

How to run xorg with different configuration files?
 
My computer has integrated graphics and a GPU. Using the integrated graphics since it just works out of the box. I had some problems configuring the GPU in the past but now, that is a job done.

The thing is that, I use PRIME to use the NVIDIA GPU, and I have to install the NVIDIA driver every time I upgrade the kernel (I do both of those actions, manually) and after installing the NVIDIA driver, I run the command:

Code:

nvidia-xconfig --prime
That command generates a file called: /etc/X11/xorg.conf

... And now, I only have to use some xrandr to set some configurations and that is it.

Let's say that I forgot to install the NVIDIA-driver after upgrading the kernel or I just want to use the integrated graphics for one xorg session so I can save battery; I can easily avoid using the xrandr configurations that I set when using the GPU (because they are in an script that startx/xinit runs) but I still need to delete the /etc/X11/xorg.conf in order to be able to use the integrated graphics. So, I wanted to know if there is a way to run xorg ignoring the xorg.conf file for one session? Or something like that.

P.S: I know of Bumblebee to switch graphics, but it does not work with my computer, I tried many times. Also, it is not important to me to switch graphics inside of the session.

TheRealGrogan 05-26-2020 01:17 PM

The startx command takes a -- -config parameter, with the location of the file relative to /etc/X11

So let's say I have /etc/X11/xorg2.conf

Code:

startx -- -config xorg2.conf
P.S. If what you're trying to do is have no config file, you can use a blank one. The things you put in an xorg.conf are just overrides now.

TheRealGrogan 05-26-2020 02:04 PM

If you're using no config file for your onboard video session, probably a better thing to do would be to put your nvidia xorg.conf in a subdirectory (again, relative to /etc/X11) rather than have two. It may look in all locations for configuration. I say that because it still parses files in /etc/X11/xorg.conf.d so it stands to reason.

Code:

startx -- -config somedir/xorg.conf
Where somedir is /etc/X11/somedir

slac 05-26-2020 02:38 PM

Yes, both of them work as I wanted. Thank you, very much.


All times are GMT -5. The time now is 07:05 AM.