Position 2 monitors at login with xrandr

1.3k Views Asked by At

I'm running Ubuntu 14.04 LTS trusty on a Dell Dimension M6500 and try to get 2 monitors automatically positionned.

Graphic card: Quadro FX 2800M NVIDIA Driver Version:331.38

I put the line

xrandr --output DP-0 --left-of LVDS-0

which works as a command line in various files: .profile, .xsession, .xinitrc, /etc/X11/Xsession.d/45custom_xrandr-settings

put a sleep 2 before, tried to launch it via batch

the lines

xrandr -q >> xrandr.log xrandr --output DP-0 --left-of LVDS-0& xrandr -q >> xrandr.log

work in the .profile file and show that the re-positionning occured but went back before I can see anything !

Any ideas ?

1

There are 1 best solutions below

0
On

I know this is a bit old, but I found this post while looking for the solution myself, so I thought I'd help.

Make a script called setup_monitors in /usr/bin/ and do sudo chmod +x /usr/bin/setup_monitors

Add this to setup_monitors

#!/bin/sh
# you might want to uncomment the following line or
# something like it as well
# xrandr --output DP-0 --mode 1920x1080 --noprimary --pos 1920x0
xrandr --output DP-0 --left-of LVDS-0

Then in your /etc/lightdm/lightdm.conf add the following:

display-setup-script=/usr/bin/setup_monitors

Restart your desktop environment (logout/restart computer), and it should work.