Nvidia‘s Linux drivers are quite nice but they’re missing one very handy feature.
You can setup your configuration every time you boot the machine with a handy gui tool or you can store the config to the xorg.conf file and boot to the same configuration every time.
This is fine for desktops but it fails for laptops. Especially if you are using different configurations of external displays at home and at the office. In that case you’d probably like to have multiple configurations that would load automatically depending on the devices that are connected to the machine.
And I finally found the tool that enables me to do that(with a bit of bash scripting on the side). It’s called disper.
Disper enables you to set display configuration in the command line which is very handy for writing scripts.
So I wrote a script that allows you to save and load configuration very easily. Once you setup the displays in nvidia-settings you can simply run the script with the command “set_display save” and it will save the current configuration for you current display setup. You can also run ”set_display save home” and it will save the configuration as “home”.
When you’ll boot the machine next time, you’ll be able to run “set_display load” and it will load the appropriate configuration for you current setup(if it exists) or you can run “set_display load home” and it will load the configuration you saved as “home”. Handy, right?
Step by step setup:
- Download and install disper
- Download and extract my set display script
- Link the set_display.sh script to your path (to /usr/bin for example)
- Setup the displays using nvidia-settings
- run “set_display save”
- reboot and run “set_display load”
- Add “set_display load” to autorun