Linux: How to clone and split screens using Xrandr

XRandr is a very handsome tool to deal with multiple screens in Linux. It allows to clone split, clone and re-arrange the output. It has been developed as official user-interface for the RandR protocol which serves to configure the X11 server. It is a bit difficult to use. However, if you know some magic commands and create aliases the tool may still do some magic as will shown below. For the too trick we assume that you are using a laptop with a VGA port where an external screen is plugged in.

In the first exercise we just want to clone this external screen:
[sourcecode language=”bash”]
xrandr –output LVDS-0 –auto –output VGA-0 –auto –same-as LVDS-0
[/sourcecode]
After executing that line you should just have a exact copy of your screen on the external one connected by VGA.

I the second exercise we want to split the screen between the Laptop screen and the external one.
[sourcecode language=”bash”]
xrandr –output LVDS-0 –primary
xrandr –auto –output VGA-0 –mode 1920×1080 –right-of LVDS-0
[/sourcecode]
This example adds the external screen right of your laptop screen. With the –left-of option you can add it at the opposite site.Make sure that you have to choose a resolution which is supported by both screens.

Leave a Reply

Your email address will not be published. Required fields are marked *