How to duplicate desktop in Linux with xrandr?
Solution 1
First find out the name of each display e.g. using xrandr --current
. Then the following command should work to duplicate them.
$ xrandr --output <projector> --same-as <desktop>
Solution 2
I use this command to mirror my desktop with my external VGA:
$ xrandr --output LVDS-1 --mode 1366x768 --scale 1x1 --output VGA-1 --same-as LVDS-1 --mode 1920x1080 --scale 0.711x0.711
LVDS-1
is the laptop screen , natively working in 1366x768.
VGA-1
is my external VGA monitor, with native resolution of 1920x1080, scaled to 0.711 which equals close to 1366x768 (laptop resolution).
Results are good for me. You can experiment with those options.
Similarly, I use this one for extended desktop:
$ xrandr --output VGA-1 --mode 1920x1080 --scale 1x1 --output LVDS-1 --mode 1366x768 --scale 1x1 --left-of VGA-1
You can detect the names of your screens by just running xrandr
Solution 3
A little shell script I wrote to mirror all monitors connected. You shouldn't have to worry about figuring out which monitors are available. This should handle that.
RESOLUTION=1920x1080
xrandr --listmonitors | sed -n '1!p' | sed -e 's/\s[0-9].*\s\([a-zA-Z0-9\-]*\)$/\1/g' | xargs -n 1 -- bash -xc 'xrandr --output $0 --mode '$RESOLUTION' --pos 0x0 --rotate normal'
Related videos on Youtube
Comments
-
Dark Cyber over 1 year
Currently, I'm using Deepin OS 15.4.
By default Deepin sets the desktop to extended mode when a projector is connected, but what I want is to duplicate my screen.
I can't find it in the Control Center configuration, but I stumbled upon in this question.
The above extends the monitor with xrandr,
How do I duplicate my desktop to the projector with xrandr?
-
rlf almost 7 yearsIf your question has been answered, please accept one of the given answers.
-
-
Edenshaw about 6 yearsYours was the only option that worked for me. Playing with panning was becoming a nightmare. The key was to leave alone the resolutions. Thxs!