Display – How to Save New Resolution Setting with xrandr

displaydisplay-resolutionstartupxrandr

I found somewhere in a forum the solution to a problem where the only resolutions available were 800×600 and 1024×768. I managed to get 1440×900, which works very well. Every time I reboot, this mode disappears. I am forced to retype the commands, so how can I save this? I'm assuming it is a simple command, but I am the largest of noobs when it comes to Ubuntu. The commands are:

  • xrandr --newmode "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync
  • xrandr --addmode VGA1 1440x900_60.00
  • xrandr --output VGA1 --mode 1440x900_60.00

Best Answer

You have several choices but perhaps the easiest is to place your command exactly as you have given above in your $HOME/.xprofile file. From here it will be executed every time you login.

By default this file does not exist in Ubuntu and so may need to be created manually and then be made executable. The following commands will do this:

touch $HOME/.xprofile
chmod +x $HOME/.xprofile

Note the 2 small shortcomings of this method:

  1. .xprofile is accessed occurs fairly late in the startup process so you may see some initial screen resolution resizing
  2. This is a 'per user' setting and may need to be repeated for other users on your system

If you wish to delve deeper there are a few other choices available in the reference link below, but this is still the safest and easiest.

References:

Related Question