Dual Monitor Setup?

Hi
I am trying to experiment with different places to setup my dual monitors on openbox (zsh shell, if that makes any difference)

The xrandr command that works in a terminal is:

xrandr --output eDP1 --mode 1366x768 --pos 277x1080 --rotate normal --output DP1 --off --output HDMI1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output VIRTUAL1 --off

  1. If I put the below in my ~/.config/openbox/autostart all works perfectly:
# Monitors
(sleep 1 && xrandr --output eDP1 --mode 1366x768 --pos 277x1080 --rotate normal --output DP1 --off --output HDMI1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output VIRTUAL1 --off) &
  1. However, if I put the below in my ~/.xprofile, the openbox session doesnt start starts with mirrored monitors
# Monitors
xrandr --output eDP1 --mode 1366x768 --pos 277x1080 --rotate normal --output DP1 --off --output HDMI1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output VIRTUAL1 --off &

If I then copy paste the same xrandr command into a terminal then it works


What am I doing wrong in case 2?

You still logging in from console with startx? If so, enter that xrandr command in the console and see if it gives you an error message. From what you’ve posted, it seems the window manager has to be running for the command to work.

2 Likes

No, I’m going back to basics, reinstalled Archlabs completely with zsh now just trying to work out why that command doesnt seem to work in my .xprofile

The command works fine in a terminal

IIRC you said you set up your monitors in .xprofile, can I ask what command you use(d) please?

Edit: I got it to work!
After reading this I tried a sleep (in my .xprofile, not a sesta / siesta) and it worked - I think I may have had this in before I reinstalled everything …

# Monitors
(sleep 1 && xrandr --output eDP1 --mode 1366x768 --pos 277x1080 --rotate normal --output DP1 --off --output HDMI1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output VIRTUAL1 --off) &

Edit: is it bad form to mark your own post as the answer?

No.
Good you worked it out yourself.

1 Like

I have two 1920x1080 monitors side-by-side:

xrandr --output HDMI1 --primary --mode 1920x1080 --rotate normal --output VGA1 --mode 1920x1080 --rotate normal --right-of HDMI1

works with all window managers.

2022-06-04-01-21-08

4 Likes

Nice!
Thanks