Fix Nvidia Settings unable to save X Server Configuration

Fix Nvidia Settings unable to save X Server Configuration

If you are using nvidia-settings and find yourself unable to Save to Configuration File due to the error Unable to open X config file '/etc/X11/xorg.conf' for writing, here is a tutorial on how to manually save the configuration.

1) Run sudo nvidia-xconfig to generate a new configuration file.
2) Run nvidia-settings and configure your X Server Display Configuration
3) Click Save to X Configuration File, and rather than pressing Save, select Show preview...
4) Manually copy the entire configuration
5) Open a new terminal, cd /etc/X11/, then use your refereed text editor to open the xorg.conf file. Delete everything in that file, and paste the configuration from step 4.
6) Restart your computer, open nvidia-settings, check whether the Display Configuration retains its configuration.