Two Monitors in an i3 Environment: How to properly set the relative Location

Hey there,

with the help of a great member on here I was able to install EOS on a different computer today. On said computer I use two monitors: an NZTX 32Q with a 2560x1440 resolution and an older Acer Nitro QG241Y with a 1920x1080 resolution. I use the i3 edition of EOS.

I’m fairly certain that there are no general settings for i3, at least not like in the desktop environments. Instead, I think you would just call system commands from within the config. I suspect that most people probably use xrandr.

To be honest, this is a very long preamble when considering that it works almost perfectly out-of-the-box. On both screens I have the bar at the bottom of the screen and both monitors have their workspaces. The only problem is: It assumes that my bigger screen is on the left and the Acer screen is on the right, while in fact it’s the other way around.

This is the information I get from running xrandr:

Screen 0: minimum 320 x 200, current 4480 x 1440, maximum 16384 x 16384
DP-1 disconnected primary (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 697mm x 392mm
HDMI-1 connected 1920x1080+2560+0 (normal left inverted right x axis y axis) 527mm x 296mm

(For brevity’s sake, I didn’t include the available resolutions.)

What I tried
I tried to run the following command:
xrandr --output DP-3 --mode 2560x1440 --primary --output HDMI-1 --mode 1920x1080 --left-of DP-3
However, this resulted in a total mess with windows being fragmented over the two screens (and confusion as to what window the mouse hovers over). I then tried arandr. Naively, I just dragged-and-dropped the smaller screen to the left and the bigger screen to the right – and the result was exactly the same as from the command just cited.

Is there an easy way to have my configuration exactly as it is right now, only with the relative position of the monitors exchanged?

Thanks very much for any suggestions!

Hey @BonfireAtNight ,
Do you happen to know
arandr
It helps to make the xrandr interactively and use it with ‘Save as’ into
~/.screenlayout/monitor.sh
Then insert to i3 config or call it. (chmod +x is needed for monitor.sh)

1 Like

Thanks for the reply!

Yes, I do know xrandr. As I’ve said in my initial post, I started it and simply reversed the position of the two screen shown in the GUI. It’s then displayed the same way as with the above-given xrandr command, with windows breaking apart over the different screens.

I just noticed that my xrandr output says current 4480 x 1440, which happens to be the width from 1920+2560 (and the height of the bigger screen). So I suspect that the display problem from applying the arandr changes result from the fact that the “break point” between the two displays remains at the same position somehow?

Assuming that this accurately describes the problem, now the question is how to set the x coordinate where the break occurs? Or am I completely on the wrong track here?

Edit: xrandr --output HDMI-1 --mode 1920x1080 --pos 0x0 --output DP-3 --primary --mode 2560x1440 --pos 1920x0 seems to do the trick. But I’m confused about what is going on exactly. If I run this command after booting into the system, the result is off. When I then run a different command (xrandr --output HDMI-1 --mode 1920x1080 --pos 0x0 --output DP-3 --primary --mode 2560x1440 --pos **2560**x0, say) and then run the one with the position of 1920x0 again everything is fine.

Does the command somehow move the origin point? Or more to the practical problem at hand, where would I best put the above command to set things right during boot?

Again, I’m thankful for all suggestions!

Try lxrandr as you can set everything all at once.

1 Like

Thanks for your reply! I’ll check it out if I cannot get it working another way.

Can someone tell me in what file EOS stores the command that leads to the default configuration? I think I could replace this line with xrandr --output HDMI-1 --mode 1920x1080 --pos 0x0 --output DP-3 --primary --mode 2560x1440 --pos 1920x0 and it should work?

Check ~/.screenlayout/monitor.sh
Put your xrandr line into it. (btw arandr is an easy interactive tool to arrage your screens by a GUI. File / Commit; File / Save as monitor.sh Sorry to repeat myself)
chmod u+x ~/.screenlayout/monitor.sh
It is called from .config/i3/config (line 394 by default)

my 1st steps

#!/bin/sh
xrandr --output eDP-1 --primary --mode 1920x1080 --pos 1600x0 --rotate normal --output HDMI-1 --mode 1600x900 --pos 0x0 --rotate normal

HDMI-1 is the secondary display with me on the left
diff -e .config/i3/config1 .config/i3/config
432c
#exec --no-startup-id sleep 7 && firefox https://github.com/endeavouros-team/endeavouros-i3wm-setup/blob/main/force-knowledge.md
.
428c
exec_always --no-startup-id autotiling
.
324c
assign [class="(?i)firefox"] $ws1
.
316,320c
workspace $ws1 output eDP-1
workspace $ws2 output eDP-1
workspace $ws3 output HDMI-1
workspace $ws4 output HDMI-1
workspace $ws5 output HDMI-1
1 Like

Have you tried arandr that is installed on i3.

1 Like

Yes, I’ve tried that. Sorry, when I said " Yes, I do know xrandr" above, what I wanted to say was arandr. In fact, the result is exactly the same as with xrandr.

Please see this post from a different thread (that I opened because I felt maybe my question wasn’t specific enough).

Did you try lxrandr?