How to Setup Dual Monitors With XRandR
While double-monitor arrangements are a point we take for accepted when gaining utilise of Linux, it isn’t always a humble plug-and also-tinker fulfill. You might be gaining utilise of a desktop computer really feel that doesn’t want to occupational by means of your equipment or have a residence window supervisor that stubbornly makes a choice to slap one of your displays by means of a marginal resolution than the one it maintains. For challenges designate these, XRandR mirrors to be an extraordinarily certain product.
- Position Out the Resolutions Continuous by Your Screens
- Formulating Upwards XRandR Sufficiently
- Transferring XRandR Settings Reoccur Throughout Reboots
- Is There a GUI for This?
Position Out the Resolutions Continuous by Your Screens
Get started by querying XRandR to see what resolutions are maintained by your displays:
xrandr -q

In the screenshot, we see that a brandish labelled HDMI-A-1 is tied by means of a resolution of 1920×1080. “Sieve 0” is the enclosure presented for the oneness of the “brandish real estate” that you make utilise in your existing setup. In this instance, it’s two times the width of the HDMI-A-1 monitor (3840×1080) granted that there’s an additional monitor by means of unchanged resolution calculated up to the right of the one we’re glimpsing at. By scrolling additionally down the output, we can see that the second monitor is labelled DP-1.

The asterisk (*) beside a resolution signifies the picked mode. In the X tactic, resolutions are always classified as “modes.” The plus (+) symbol beside a resolution is what XRandR supposes is the optimum mode for that particular brandish.
You’ll notification when you form xrandr -q
in your terminal, your displays will always be prefixed by means of the form of wire they presented to attach to the computer (e.g., HDMI, DP, VGA, DVI). This renders sure that brandish names are not overly baffling.
Formulating Upwards XRandR Sufficiently
For the sake of ease, the rest of this guide will assume that you’re gaining utilise of two DisplayPort monitors (DP) that have optimum resolutions at 1080p (1920×1080).
Let’s expand your two displays merely to dive right into how XRandR jobs:
xrandr --auto --output DP-0 --mode 1920x1080 --left-of DP-1 xrandr --auto --output DP-1 --mode 1920x1080
Here’s a overview of what these commands implied:
- The
--auto
flag is presented to either permit a debilitated product that’s already tied or immobilize a product that is unequivocally no a integration longer established. This helps straighten some challenges in which a brandish might not be confirming anything. - The first command tells XRandR to placed your brandish that’s tied to the fulcrum DisplayPort interface on your graphics equipment to calculated a resolution of 1920×1080 and also orient the monitor to the disclaimed of your other brandish. If this wasn’t what you ached to tote out, modification
--left-of
to--right-of
and also you’ll be all right. You might in a tantamount means utilise--left-of
in the second command instead to diligent unchanged point. - The second command merely kits the resolution of the second monitor to 1920×1080.
Yearn to expand displays up and also down? Simply button --left-of
or --right-of
to --above
or --below
.
Yearn to mirror both displays? Consumption --same-as
instead. For instance, if you’d designate DP-1 to mirror DP-0, this is what you’d form:
xrandr --auto --output DP-1 --same-as DP-0
This is particularly certain when you want to utilise a projector on a laptop computer or something to that impact.
If you want to calculated a particular refresh price, utilise the --rate
flag:
xrandr --auto --output DP-0 --mode 1920x1080 --rate 60
Bear in mind, XRandR is not enchantment. It cannot calculated refresh prices that it doesn’t understand your brandish maintains. You can’t, for instance, rotate your 60 Hz brandish into a 144 Hz uber-spicy betting monitor by means of one humble command unless that’s a refresh price that it maintains. The vacillation we did at the really onset will tell you in one funky tower what refresh prices are readily available for a granted resolution by means of your particular equipment.
Correspondingly, grasp ago in psyche that the desktop computer really feel or residence window supervisor you currently utilise might not permit you to calculated refresh prices better than your slowest monitor’s max price.
To rotate off a monitor, merely utilise --off
:
xrandr --output DP-1 --off
Tab how I tote out not require --auto
here. It’s not in reality crucial granted that it merely offers as a backup to rotate on displays that might be debilitated however tied. This is not what we want to tote out right now.
To rotate a monitor ago on, calculated its mode by means of the --auto
flag:
xrandr --auto --output DP-1 --mode 1920x1080
Transferring XRandR Settings Reoccur Throughout Reboots
Now that you’ve calculated up your monitors precisely how you’d want them, don’t reboot merely yet. Your computer will lose these placements as soon as it overtures anew. To derail this, we’re grabbing entailed in have to concoct a script.
Invent a paper labelled monitorsetup.sh
in your home directory. For the sake of ease, we’ll modification to our first instance in which we calculated up two DisplayPort monitors by means of 1080p resolution, by means of DP-0 being the monitor on the disclaimed. In that instance, this is what we populate the paper by means of:
#!/bin/bash xrandr --auto --output DP-0 --mode 1920x1080 --left-of DP-1 xrandr --auto --output DP-1 --mode 1920x1080
If you have an additional command in psyche, modification what I devised by means of it and also preserve the paper. Simply ensure that the elevation line (#!/bin/bash
) is disclaimed singly. That helps ensure that Linux makes utility of the right shell to execute your script.
Don’t forget to open your terminal anew and also make this script executable:
chmod a+x ~/monitorsetup.sh
With one voice you have to tote out now is calculated this script as a startup power in your desktop computer really feel of recourse.
Is There a GUI for This?
Every desktop computer really feel possesses a front run out to XRandR. You merely have to flair by means of your placements. If you understand in which to calculated your resolution in your desktop computer, you spotted the GUI.
Yet if you’re gaining utilise of a residence window supervisor or a in reality uncommon really feel, you might not have a pre-placed XRandR front run out. In these vessels, you might want to hazard out ARandR, a humble interface that’s straightforward and also also saves pre-rendered scripts for you.
To utilise it, open the entreaty and also navigate to the “Upshots” menu. From there, merely calculated the resolution and also orientation you’d designate for each output.

Preserve your equalizes and also appreciate!
Swiping Your Display expurgate Suffer Better
If you’re a minuscule details extraneous audacious, you might want to existing Wayland a go. The kinks sanctuary’t been fully debated, however the majority of the hindrances that might lead you to need to utilise XRandR to configure your displays might not exist if you button from X11 to Wayland. X safeguarded against being arised a while ago, so now’s as superb a time as any to run both at the same time and also see in which you position the most delight!
Image debt: Minh Phuc by means of Pexels; all screenshots by author