Add/Change/Set the custom resolution of your display using xrandr on Ubuntu 18.04 — {In a minute}
In case your monitor’s supported resolution is not properly detected or if you want a custom resolution to be used, follow the provided instructions:
Say you wish to have a resolution of 1920*1080 and a refresh rate of 60.
1. Open terminal via Ctrl+Alt+T or search for “Terminal”. Run following command in the terminal:
xrandr
As shown above, it outputs current and available screen resolutions. Note down the display device name, in my case, it’s ‘Virtual1’.
2. Run command to calculate CVT with desired resolution (supported):
cvt 1920 1080 60
Replace 1920 1080 60
(1920X1080 in my case) in the command to the desired screen resolution.
3. Copy the text starting from the double quotes till the end of the full output(words with underline), and run command to add new mode:
sudo xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1088 1120 -hsync +vsync
4. Now add the newly created mode for your display device:
sudo xrandr --addmode Virtual1 "1920x1080_60.00"
Note: Match Display Device name(shown above as bold) as seen in the first step.
5. Finally, apply the new resolution in the Display settings.
6. (Optional) To keep this screen resolution permanent, edit .profile
file.
Run the command:
gedit ~/.profile
Append commands in steps 3 and 4 to the file( see below screenshot).
ENJOY!
Source:
Follow Me: