tl;dr
My laptop keeps forgetting the correct resolution of the external monitor attached to it. How can I make the configuration "stick"?
Details
I have a laptop running Linux Mint attached to an external ViewSonic monitor. I set it up to use the external monitor as a second screen (i.e. not mirrored). This worked fine for some weeks.
Suddenly, the laptop no longer recognized it as a ViewSonic, at which point it did not know its optimal resolution (1600 x 1200), only allowing a max of 1028 x 768.1 This did not work well at all with my laptop, which has 1920 x 1200 resolution.
After much frustration, I found this answer. It helped me to fix the problem, as follows (the output of the cvt command being the modeline which was used in the next command):
cvt 1600 1200
xrandr --newmode "1600x1200_60.00" 161.00 1600 1712 1880 2160 1200 1203 1207 1245 -hsync +vsync
xrandr --addmode VGA-1 1600x1200_60.00
This is exactly what I had been wishing I could do, but could not do through the GUI. (There are reasons why I still love the command-line...)
This once again worked well for a time. However, when I booted the computer today and signed in, I got a notification area popup with a string of errors about different attempted modes which weren't working, and the external monitor was switched off. I repeated the commands above, and it is working again.
I have an nVidia card. I tried installing the proprietary driver when things began to go awry, but at that point the external monitor was no longer recognized at all, so I am back to the open source driver. I do not have an Xorg.conf or an Xorg.conf.d, only an xorg.conf.failsafe.
I don't want to repeat these commands every time I boot the machine. Is there some way I can get this saved to my Xorg.conf or something? It's been a number of years since I've done much with X. Can anybody help me here?
1I have been unable to determine why this happened. My best guess is a problematic driver update.