How to change display's position from command line?
34,434
Try this:
xrandr --output eDPI1 --mode 1024x768 --pos 0x0 --rotate normal --output HDMI2 --mode 1366x768 --pos 1024x384 --rotate normal
Related videos on Youtube
Author by
Eduardo
Updated on September 18, 2022Comments
-
Eduardo over 1 year
How can I use the command prompt to do get the setup shown below?
Edit: I need the secondary display to be located to the left and half-way to the top of the primary display, as shown above.
The output of xrandr is:
Screen 0: minimum 320 x 200, current 3200 x 1567, maximum 32767 x 32767 eDP1 connected primary 1920x1080+1280+487 (normal left inverted right x axis y axis) 345mm x 194mm 1920x1080 60.0*+ 59.9 1680x1050 60.0 59.9 1600x1024 60.2 1400x1050 60.0 1280x1024 60.0 1440x900 59.9 1280x960 60.0 1360x768 59.8 60.0 1152x864 60.0 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 VGA1 disconnected (normal left inverted right x axis y axis) DP1 disconnected (normal left inverted right x axis y axis) HDMI1 disconnected (normal left inverted right x axis y axis) HDMI2 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 376mm x 301mm 1280x1024 60.0*+ 75.0 1920x1080 60.0 59.9 1152x864 75.0 1280x720 60.0 59.9 1024x768 75.1 60.0 800x600 75.0 60.3 640x480 75.0 60.0 59.9 720x400 70.1 VIRTUAL1 disconnected (normal left inverted right x axis y axis)
-
Pilot6 about 9 yearsYou can do it by "xrandr" command. "man xrandr" has help.
-
terdon about 9 yearsPlease edit your question and add the output of
xrandr
. Also, please explain what you need. Are you expecting one screen to be above the other? By how much? Do you just need one screen to be on the right of the other one? -
Jacob Vlijm about 9 yearspossible duplicate of Output of xrandr shows 1024x768+1366+0; what does it mean and can I change it?
-
Jacob Vlijm about 9 yearsPlease take a look at the dupe I marked your question as. Strictly taken I am doubting if it is a literal dupe, however, the answer I would post would be a 100% copy. If you don't agree, please leave a comment and I'll remove the dupe mark.
-
-
Jacob Vlijm about 9 yearsThat's a lot more than strictly needed. Simply
xrandr --output eDPI1 --pos <x>x<y>
would do :) -
Sergiy Kolodyazhnyy about 9 years<.< shhh, I copied settings from lxrandr, I've no idea what I am doing
-
Jacob Vlijm about 9 yearshaha, You are the best :)
-
Jacob Vlijm about 9 yearsOn my turn, I simply copied
eDPI1
from your answer, while op does not have a screen like that :) -
Sergiy Kolodyazhnyy about 9 yearswait what ? OP posted output of xrandr which reports eDPI1 there. Did I miss something ?
-
Jacob Vlijm about 9 yearsOh dear, I should learn to read some day.
-
Sergiy Kolodyazhnyy about 9 years@JacobVlijm we need more coffee XD
-
Eduardo about 9 yearsI actually modified your script into
xrandr --output HDMI2 --mode 1280x1024 --pos 0x0 --rotate normal --output eDP1 --mode 1920x1080 --pos 1280x512 --rotate normal
. Thanks a lot! -
Sergiy Kolodyazhnyy about 9 yearsEduardo, that works :) youre very welcome
-
Mark Jeronimus about 4 yearsI used
--size
instead of--mode
-
Sergiy Kolodyazhnyy about 4 years@MarkJeronimus Yep, that's a good one too. Just keep in mind,
--size
is actually something different than--mode
. The--size
option sets the size of the "virtual" or "software" screen. For single monitor setup ( like a laptop for example ) that's going to behave the same, but on dual monitor setups that it's obviously different. -
Mark Jeronimus about 4 yearsI needed it to solve this problem, but then the displays were not relatively aligned anymore