3 minute read

Creating a new modeline

create a new modeline according to your monitor resolution.

 sudo cvt 1920 1080

the output to this will be something like: Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync

copy everthing after Modeline from the output to add new mode to xrandr.

sudo xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync`

type xrandr or xrandr -q to see all the available outputs including the one that is connected. for example VGA1 or DP-1.

$ xrandr
Screen 0: minimum 320 x 200, current 1280 x 800, maximum 4096 x 4096
VGA1 disconnected (normal left inverted right x axis y axis)
LVDS1 connected 1280x800+0+0 inverted X and Y axis (normal left inverted right x axis y axis) 261mm x 163mm
   1280x800       59.8*+
   1024x768       60.0
   800x600        60.3     56.2
   640x480        59.9
DVI1 disconnected (normal left inverted right x axis y axis)
TV1 disconnected (normal left inverted right x axis y axis)

after that type the command:

sudo xrandr --addmode LVDS1 "1920x1080_60.00"

change the LVSD1 with your connected device name that you found using xrandr command and the mode name with the text that appear after Modeline in the output of cvt command. this should change the resolution of the screen.

Make the fix permanent

if you leave it here, the resolution’s gonna switch back to whatever it was before after a reboot. TO make this fix permanent we need to add these configuration in xorg.conf file so they will excecute at each start up

for that open up xorg.conf file located at /etc/X11/xorg.conf with a text editor like vim

sudo vim /etc/X11/xorg.conf

this command will make a new xorg.conf file if it wasn’t there already. and copy these line into the file

Section "Monitor"
Identifier  "LVSD1"
Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
EndSection

where the Modeline configurations should be replaced with the output of cvt.

the xorg.conf file is excecuted rather later on after startup so once you log in with your user account the resolution will be changed according to the configurations added. you might see the initial low resolution at the login page.

Comments