Customizing screen resolutions with xrandr
Screen Makeover
You can boost productivity on an old laptop using xrandr to quickly and easily gain some extra screen real estate.
If you are anything like me, you may have an old laptop from the mid-2010s lying around that still works well but has some obvious deficiencies. While the hardware is mostly fine, the 15.6-inch screen has bezels that encroach well into where we now expect to see uninterrupted screen space. With a few modifications, this old laptop is a perfect candidate for a backup Linux machine for when your main laptop inevitably fails (even if you do need to carry the charger with you at all times). After buying a pair of 4GB DDR3 sticks and the least expensive 120GB SSD you can find and installing Ubuntu, this old laptop runs great, but the screen still feels like something from the Windows ME days. All you need is a few simple terminal commands using xrandr
on Ubuntu [1] to bring the 1366x768-resolution screen up to something a bit more reasonable, greatly improving your overall experience.
There are a few caveats, however. One is that bumping up the resolution will likely cause text to appear fuzzy and less crisp. This is something that most users can become accustomed to in time. It won't look pretty, but at least you will be able to have more than one document or program window open at the same time. Another caveat is that you will likely experience, at the very least, some tearing when moving windows around – nothing that will affect performance in any meaningful way, as long as you don't need high graphic fidelity. Lastly, and obviously, you should probably avoid using this laptop for any video or image production because having an accurate representation on your screen is paramount for those kinds of tasks. With these caveats in mind, let's break down the process.
Custom Resolution
First you need to determine the base X Window System [2] configuration to which your custom resolution will be added. To do this, open a terminal window and run:
$ xrandr
For reference later, write down which display output is being used. This will be something like HDMI-#
, DP-#
, LVDS-#
, or VGA-#
(where the #
is typically a
or 1
). The first section indicates the connection technology, and the digit indicates the monitor number. This will be important to know later. For example, Figure 1 shows the output from xrandr
for the Dell E6430 14-inch laptop, circa 2012, that I used to write this article.
Next, determine your monitor's characteristics at your selected resolution. You will want to continue to use the same aspect ratio (width to height) when scaling to a higher resolution. For instance, a 1366x768 monitor that is 14 inches or larger can typically accommodate any 16:9 resolution up to 2560x1440 while still offering fairly legible text. To determine the characteristics needed, run the following command:
$ cvt <desired width in pixels> <desired length in pixels>
Running this cvt
command on my Dell for a desired resolution of 1920x1080 results in the information shown in Figure 2.
The modeline listed in the cvt
command's output shown in Figure 2 should also be noted because that, too, will be used later. At this point, use the xrandr --newmode
command to add the desired mode to the configuration. Copy and paste the modeline information after xrandr --newmode
so that the correct timings and resolution will be used (Figure 3).
Finally, use the xrandr --addmode
command followed by the desired resolution and frequency (Figure 4), which will then be accessible in the Gnome Display Settings panel in the Gnome Control Center (Figure 5).
Persistence
Now you can open the Gnome Control Center and choose the desired resolution. You can then see how good (or bad) the new resolution looks on your particular machine. However, there is one problem at this point: When you sign out or reboot, your custom resolution will no longer be in the Gnome Control Center, forcing you to re-enter these commands in the terminal to access the resolution each time you sign in.
There is a simple workaround for this problem: Add the newmode
and addmode
commands to the end of the .profile
file in your /home/user directory
(Figure 6). I prefer to simply open Home
, view hidden files by using Ctrl+H, open the .profile
file with gedit, copy and paste those two commands at the very bottom, and save. Pressing Ctrl+H again will hide the hidden files once more and resume the default view. Now the resolution change will survive reboots and logout/login for the user whose .profile
was amended. Purists may want to use Vim or nano, but to each his or her own. If you're feeling indecisive, you can always run
gedit /home/<user>/.profile
from the terminal and add the two needed lines that way.
Conclusion
With a few simple commands in the terminal, you can use xrandr
to customize the resolution on older machines, breathing new life into old hardware.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.
-
New KDE Slimbook Plasma Available for Preorder
Powered by an AMD Ryzen CPU, the latest KDE Slimbook laptop is powerful enough for local AI tasks.
-
Rhino Linux Announces Latest "Quick Update"
If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.