First generate a "modeline" by using cvt
Syntax is: cvt width height refreshrate
cvt 1680 1050 60
this gives you:
# 1680x1050 59.95 Hz (CVT 1.76MA) hsync: 65.29 kHz; pclk: 146.25 MHz
Modeline "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
Now tell this to xrandr:
xrandr --newmode "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
Then you can now add it to the table of possible resolutions of an output of your choice:
xrandr --addmode VGA-0 1680x1050_60.00
The changes are lost after reboot, to set up the resolution persistently, create the file ~/.xprofile
with the content:
#!/bin/sh
xrandr --newmode "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
xrandr --addmode VGA-0 1680x1050_60.00
You need to replace VGA-0 with your monitor connection. Use xrandr --listmonitors.
VGA-0
. If you get the messagexrandr: cannot find output "VGA-0"
, try running the following command:xrandr | grep -e " connected [^(]" | sed -e "s/\([A-Z0-9]\+\) connected.*/\1/"
(source: xrandr on ArchWiki). The output of that command should be the correct device identifier. – thirdender Jul 09 '14 at 06:25Virtual1
instead of VGA-0. – CyberEd Mar 22 '16 at 22:37Ctrl+Alt+F1
I can restart Unity, but then the custom resolution disappears – Nitay Jun 08 '16 at 15:26xrandr --addmode "DVI-I-1" "1280x800_60.00"
gave me the same error "BadMatch", any idea? – Aquarius Power Jan 01 '17 at 21:00--verbose
to your command and see if there is any useful output. Also see Why do xrandr errors “BadMatch”, “BadName”, “Gamma Failed” happen? – thirdender Jan 02 '17 at 03:01arandr
to find the VGA number instead of default VGA-0 as in the answer – kittu May 07 '17 at 07:31xrandr --newmode
command - you can reconnect your display and it will automagically pick the newly added resolution ;) – jabu.hlong Feb 15 '18 at 21:24xrandr --listmonitors
. See How to fix error 'xrandr: cannot find output “VGA1”'? – Human Mar 07 '18 at 05:27xrandr --listactivemonitors
– Simon Baars Aug 22 '19 at 06:33grep -n Modeline /var/log/Xorg.0.log
I noticed that the newly added modeline was much different from the pre-existing ones. For example, my pre-existing modelines had+hsync -vsync
whereas output ofcvt
had-hsync +vsync
. So I had to change cvt output to match pre-existing modelines to make it work. – Nafiur Rahman Khadem Feb 21 '22 at 13:53cvt -r
to create a reduced blanking modeline for my 4K setup (3840x2160@60Hz). Without-r
it didn't work. – sebastian May 12 '22 at 12:35