{"id":33682,"date":"2021-05-03T09:46:13","date_gmt":"2021-05-03T09:46:13","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=33682"},"modified":"2024-10-18T15:13:04","modified_gmt":"2024-10-18T15:13:04","slug":"custom-screen-resolution-ubuntu-wayland-xorg","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2021\/05\/custom-screen-resolution-ubuntu-wayland-xorg\/","title":{"rendered":"How to Set Custom Screen Resolution in Ubuntu Wayland &#038; Xorg"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-6706\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/display-icon245.jpg\" alt=\"\" width=\"245\" height=\"250\" \/><\/p>\n<p>This tutorial shows how to set custom screen resolution in current Ubuntu releases, including Ubuntu 20.04, Ubuntu 22.04, and Ubuntu 24.04, on either Wayland or Xorg session.<\/p>\n<p>So this tutorial is going to show you another way to add your favorite screen resolution if it&#8217;s not available in Display settings.<\/p>\n<p>In the case, I&#8217;ve the default 1920X1080 (16:9) resolution. However, I prefer 1600X900 (16:9) a little more which is not available in settings.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/resolu-before.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-33686\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/resolu-before-small.png\" alt=\"\" width=\"600\" height=\"406\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/resolu-before-small.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/resolu-before-small-300x203.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3>Before getting started:<\/h3>\n<p>In this tutorial I&#8217;m going to add video mode option as Kernel parameter. The <b>good<\/b> side is that it works on both Wayland and Xorg.<\/p>\n<p><b>Downsides<\/b> includes:<\/p>\n<ul>\n<li>You can&#8217;t set custom resolution higher than the maximum one in Display settings. In my case (<i>see the picture above<\/i>), X resolution must be less than 1920, and Y resolution have to less than 1080.<\/li>\n<li>If you have dual-boot or multi-boot systems, below steps may not work for &#8220;other Linux&#8221; in Grub boot menu. For instance, I&#8217;ve <b>Ubuntu 21.04<\/b> and <b>Ubuntu 20.04<\/b> dual-boot in my laptop, the startup boot menu is handled by Grub for Ubuntu 21.04. It lists Ubuntu 21.04 as the first menu entry, custom Kernel parameter does not work for Ubuntu 20.04 in my case.<\/li>\n<\/ul>\n<p>And after adding the parameter, the custom resolution should appear in Display settings, 1600&#215;900 for instance:<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/resolu-after-600x408.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-33691\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/resolu-after-small.png\" alt=\"\" width=\"600\" height=\"408\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/resolu-after-small.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/resolu-after-small-300x204.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3>How to Tell the Display Device Name in Ubuntu:<\/h3>\n<p>Firstly, you have to find out the current Display name. To do so, open terminal from the system application launcher:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9967\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/04\/terminal-focal.jpg\" alt=\"\" width=\"490\" height=\"256\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/04\/terminal-focal.jpg 490w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/04\/terminal-focal-450x235.jpg 450w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><\/p>\n<p>When terminal opens, run command:<\/p>\n<p><code>for p in \/sys\/class\/drm\/*\/status; do con=${p%\/status}; \\<br \/>\necho -n \"${con#*\/card?-}: \"; cat $p; done<\/code><\/p>\n<p><b>This is a single command separated into 2 lines.<\/b> It checks all the sub-folders under &#8216;<i>\/sys\/class\/drm<\/i>&#8216; directory. For the sub-folder includes &#8216;<b>status<\/b>&#8216; file with &#8216;<b>connected<\/b>&#8216; as content, the folder name exclude &#8216;<i>card?-<\/i>&#8216; part is the device name we need.<\/p>\n<p>As the picture shows, it&#8217;s <b>eDP-1<\/b> in my case.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/check-displayname.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-33687\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/check-displayname-600x245.jpg\" alt=\"\" width=\"600\" height=\"245\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/check-displayname-600x245.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/check-displayname-300x122.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/check-displayname-768x313.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/check-displayname.jpg 775w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<div id=\"attachment_37561\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/connected-displaydevice.webp\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-37561\" class=\"size-large wp-image-37561\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/connected-displaydevice-600x336.webp\" alt=\"\" width=\"600\" height=\"336\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/connected-displaydevice-600x336.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/connected-displaydevice-300x168.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/connected-displaydevice-768x430.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/connected-displaydevice.webp 1242w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-37561\" class=\"wp-caption-text\">DON&#8221;T edit the files<\/p><\/div>\n<h3>How to add video mode kernel parameter:<\/h3>\n<p><b>Option 1.) edit Grub configuration file.<\/b><\/p>\n<p><b>a.)<\/b> Open terminal from system app launcher. When it opens, run command to edit the config file:<\/p>\n<pre style=\"border: none;\">sudo gnome-text-editor \/etc\/default\/grub<\/pre>\n<p><i>Replace <code>gnome-text-editor<\/code> depends on your DE or Ubuntu edition, such as <code>gedit<\/code> for Ubuntu 22.04 and earlier, or <code>nano<\/code> command line text editor for most desktops.<\/i><\/p>\n<p>When it opens, add <b>video=eDP-1:1600&#215;900@60<\/b>, in my case, as value for &#8220;GRUB_CMDLINE_LINUX_DEFAULT&#8221;.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-custom-videores.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47386\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-custom-videores-700x365.webp\" alt=\"\" width=\"610\" height=\"318\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-custom-videores-700x365.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-custom-videores-300x156.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-custom-videores-768x401.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-custom-videores.webp 1022w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>IMPORTANT:<\/b> you have replace <b>video=eDP-1:1600&#215;900@60<\/b>:<\/p>\n<ul>\n<li><b>eDP-1<\/b> is the Display Device Name, you can find it in previous step.<\/li>\n<li><b>1600&#215;900<\/b> is the desired screen resolution. Replace it with yours.<\/li>\n<li><b>60<\/b> is the refresh rate. It&#8217;s OK to skip it, so it will be <b>video=eDP-1:1600&#215;900<\/b><\/li>\n<\/ul>\n<p>There are more flags for the video mode kernel parameter. <a href=\"https:\/\/www.kernel.org\/doc\/html\/latest\/fb\/modedb.html\" target=\"_blank\" rel=\"noopener\">See the documentation<\/a> for detail.<\/p>\n<p><b>b.)<\/b> After saving the changes (for nano, press Ctrl+S, then Ctrl+X.) Finally apply changes by running command:<\/p>\n<pre style=\"border: none;\">sudo update-grub<\/pre>\n<p>And reboot.<\/p>\n<p><b>Option 2.) use Grub Customizer:<\/b><\/p>\n<p>Grub-Customizer, the popular graphical tool offers an option to add the Kernel parameter.<\/p>\n<p>Install it from Ubuntu Software if you don&#8217;t have it. Then launch it and navigate to <b>General Settings<\/b> tab. Finally add the value and click on <b>Save<\/b> button.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grubcustomizer-kernelpara.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-33689\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grubcustomizer-kernelpara-600x393.jpg\" alt=\"\" width=\"600\" height=\"393\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grubcustomizer-kernelpara-600x393.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grubcustomizer-kernelpara-300x196.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grubcustomizer-kernelpara-768x503.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grubcustomizer-kernelpara.jpg 920w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3>Set Custom Resolution for Multiple Displays:<\/h3>\n<p>If you have multiple monitors connected to your Ubuntu machine. It&#8217;s OK to set one screen resolution for all displays, or use more &#8220;<i>video=<\/i>&#8221; parameter for each display.<\/p>\n<p><b>a.)<\/b> To set one screen resolution for all displays, just skip the device name. For instance:<\/p>\n<pre>video=1600x900@60<\/pre>\n<p>It will add 1600&#215;900 screen resolution with 60 Hz refresh rate for all the connected displays.<\/p>\n<p><b>b.)<\/b> To add more &#8220;<i>video=<\/i>&#8221; parameter. For instance, I have two displays: <b>eDP-1<\/b> and <b>DP-1<\/b> connected. And to add 1360&#215;700 for eDP-1 and 1600&#215;900 for DP-1, use:<\/p>\n<pre>video=eDP-1:1360x700@60 video=DP-1:1600x900@60<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-multivideomode.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-33692\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-multivideomode-600x405.jpg\" alt=\"\" width=\"600\" height=\"405\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-multivideomode-600x405.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-multivideomode-300x203.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-multivideomode-768x519.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-multivideomode.jpg 937w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>That&#8217;s all. Enjoy!<\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to set custom screen resolution in current Ubuntu releases, including Ubuntu 20.04, Ubuntu 22.04, and Ubuntu 24.04, on either Wayland or Xorg session. So this tutorial is going to show you another way to add your favorite screen resolution if it&#8217;s not available in Display settings. In the case, I&#8217;ve the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":33683,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1435],"class_list":["post-33682","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-custom-resolution"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/33682","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=33682"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/33682\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/33683"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=33682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=33682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=33682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}