I have two multi-monitor setups One at work, and one at home. Every time I come home or go to work, I need to load the NVIDIA GUI and manually set up my multi-monitor configuration. The NVIDIA GUI allows you to save the xorg.conf. I therefore would like two bash scripts, one for each setup, that I could run when arriving at home, or at work - so that I wouldn't have to do this step manually each day. Any ideas how to do that?
You would have to reload lightdm after changing xorg.conf file, that means all open windows will close, so keep that in mind when running the script.
#!/bin/bash cp /your/xorg/file.conf /etc/X11/xorg.conf service lightdm restart
Save one version for each /your/xorg/file.conf location and run accordingly.
Edit: Don't forget to run as root!
You could use custom
xserver-command to start xserver. Default
xserver-command is available in
Create script that will execute xserver-command. For example create
/opt/my-xserver-command.sh with following content:
#!/bin/bash X -core
/usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf file to
/etc/lightdm/lightdm.conf.d/50-xserver-command.conf and change
xserver-command=X -core to
Now you can pass X your config file. For example:
#!/bin/bash X -core -config xorg.conf
You can name your config files watever you want. For example
home.conf. Now you just need to find something to use to decide what config to use. For example you could detect current time and choose config based on that.