Skip to content

Instantly share code, notes, and snippets.

@RishikeshDarandale
Last active July 4, 2016 04:40
Show Gist options
  • Save RishikeshDarandale/0f284663c41a32b7a3130aceae0896fe to your computer and use it in GitHub Desktop.
Save RishikeshDarandale/0f284663c41a32b7a3130aceae0896fe to your computer and use it in GitHub Desktop.
Adding a custom resolution to uBuntu
# create the mode using super user
$ sudo cvt 1366 768 60
[sudo] password for user:
# 1368x768 59.88 Hz (CVT) hsync: 47.79 kHz; pclk: 85.25 MHz
Modeline "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync
# add the new mode from above commands output
$ sudo xrandr --newmode "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync
# Verify the monitor name
$ sudo xrandr -q
Screen 0: minimum 64 x 64, current 1280 x 1024, maximum 32766 x 32766
VGA-0 connected primary 1280x1024+0+0 0mm x 0mm
800x600 60.00 + 60.00
2560x1600 60.00
2560x1440 60.00
2048x1536 60.00
1920x1600 60.00
1920x1080 60.00
1600x1200 60.00
1680x1050 60.00
1400x1050 60.00
1280x1024 60.00*
1024x768 60.00
640x480 60.00
1368x768_60.00 (0x296) 85.250MHz -HSync +VSync
h: width 1368 start 1440 end 1576 total 1784 skew 0 clock 47.79KHz
v: height 768 start 771 end 781 total 798 clock 59.88Hz
# set the new mode
$ sudo xrandr --addmode VGA-0 1368x768_60.00
#!/bin/bash
xrandr --newmode "1368x768_60.00" 85.86 1368 1440 1584 1800 768 769 772 795 -HSync +Vsync
xrandr --addmode VGA-0 1368x768_60.00
xrandr --output VGA-0 --mode 1368x768_60.00
## Above script should be added in startup application, so that screen resolution will be set automatically after startup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment