Here are the steps to add a custom resolution to your primary display on Ubuntu 22.04:
- First, you need to generate the timings for your desired resolution and refresh rate. You can use the cvt command to generate the timings. For example, if you want to add a resolution of 1920x1080 at 60Hz, you can run the following command:
cvt 1920 1080 60
This will output the timings you need to add the resolution.
-
Next, you need to create a new mode using the timings you generated in the previous step. You can use the xrandr command to create a new mode. For example, if the timings you generated are:
Modeline
"1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
You can create a new mode with the following command:
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
- Once you have created the new mode, you need to add it to your primary display. You can use the xrandr command to add the new mode to your primary display. For example, if your primary display is named VGA-1, you can add the new mode with the following command:
xrandr | grep " connected primary"
xrandr --addmode VGA-1 "1920x1080_60.00"
- Finally, you can set the new resolution on your primary display using the xrandr command. For example, if you want to set the resolution to 1920x1080 at 60Hz, you can run the following command:
xrandr --output VGA-1 --mode "1920x1080_60.00"
This will set the new resolution on your primary display.