Change Screen Resolution in Linux Ubuntu
Having resolution problems in Linux? Ubuntu not detecting your monitor and it’s native resolutions? Here’s a script I wrote for 1680x1050 resolution @ 59.9 frame rate. Download the file here.
http://temp-screen-resolution-fix.googlecode.com/files/resolution-script Once it’s downloaded, you need to make it executable.
Right click the file: Properties > Permissions > and then make sure the box is checked that allows executing of the file.
Finished. Simply click on the file and wait a few seconds and the resolution problem is defeated! The only problem is that every time you restart X or logout/restart, you need to run the script again. But, it’s only a matter of double clicking and waiting 5 seconds. No big deal, right? Right.
[Note: If you’re Google-Fu is up to standards, I’m sure you could find out how to run this file every time restart automatically. Good luck.]
Command-line access:
Get a local copy of the temp-screen-resolution-fix repository with this command:
hg clone https://temp-screen-resolution-fix.googlecode.com/hg/ temp-screen-resolution-fix
Here’s the source code for the script.
#! /bin/bash
xrandr | grep
maximum &
sleep 2
gtf 1680 1050 59.9 &
sleep 2
xrandr --newmode "1680x1050_59.90" 146.89 1680 1784 1968 2256 1050 1051 1054 1087 -HSync +Vsync &
sleep 2
xrandr --addmode VGA1 1680x1050_59.90 &
sleep 2
xrandr --output VGA1 --mode 1680x1050_59.90 &
exit 0
How did I do it? Here are the steps to manually edit your resolution and how to write a script from the information gathered:
* 1. Use xrandr to make sure that the new mode can fit within the maximum frame buffer size
Code: xrandr | grep maximum
* 2. Use gtf to create a mode line
Code: gtf 1680 1050 59.9
* 3. Add new mode using xrandr
Code: xrandr --newmode "1680x1050_59.90" 146.89 1680 1784 1968 2256 1050 1051 1054 1087 -HSync +Vsync
* 4. Add this newly added mode to the desired output (VGA/VGA1/LVDS etc)
Code: xrandr --addmode VGA1 1680x1050_59.90
* 5. Choose the new mode
Code: xrandr --output VGA1 --mode 1680x1050_59.90
When I used the & and sleep 2 commands, I’m simply telling the script to finish each individual command before moving onto the next with a 2 second buffer.




