Replace xorg.conf with xrandr for dualhead on demand

Ralf Mardorf silver.bullet at zoho.com
Thu Aug 3 10:38:49 UTC 2017


Hi,

do you have any hints on what to consider, when writing a script for an
LCD monitor and a CRT monitor using an Intel graphics?

I already have done some research on my own [1], but actually I booted
with an xorg.conf, IOW it's not removed yet. Perhaps I already got
everything to start writing my script.

Regards,
Ralf

[1]
Running the following works always

xrandr --output HDMI2 --mode 1920x1080 --output VGA1 --mode 1024x768 --right-of HDMI2
xrandr --output HDMI2 --mode 1920x1080 --output VGA1 --mode 800x600  --right-of HDMI2
xrandr --output HDMI2 --mode 1024x768  --output VGA1 --mode 1024x768 --same-as  HDMI2

Running the below, using the same "name", works just one time

xrandr --newmode "1024x768-safe" 65.00 1024 1048 1184 1344 768 771 777 806 -hsync -vsync && xrandr --addmode VGA1 1024x768-safe && xrandr --output VGA1 --mode 1024x768-safe
xrandr --newmode "1024x768-75hz" 81.80 1024 1080 1192 1360 768 769 772 802 -hsync +vsync && xrandr --addmode VGA1 1024x768-75hz && xrandr --output VGA1 --mode 1024x768-75hz

but it works again with a different "name"

xrandr --newmode "1024x768-s" 65.00 1024 1048 1184 1344 768 771 777 806 -hsync -vsync && xrandr --addmode VGA1 1024x768-s && xrandr --output VGA1 --mode 1024x768-s

or by simply running

xrandr --output VGA1 --mode 1024x768-75hz
xrandr --output VGA1 --mode 1024x768-safe

This works

xrandr --output HDMI2 --auto --output VGA1 --off
xrandr --output HDMI2 --auto --output VGA1 --mode 1024x768 --right-of HDMI2

but take notice of

https://wiki.archlinux.org/index.php/xrandr#Avoid_X_crash_with_xrasengan

xrandr --output HDMI2 --set "Broadcast RGB" "Full" # makes no difference, at least not with the used xorg.conf

Aspect ratio:

xrandr --output HDMI2 --mode 1024x768 --scale 1x1
xrandr --output HDMI2 --mode 1024x768 --scale 1.33333333x1
xrandr --output HDMI2 --scale 1x1
xrandr --output HDMI2 --scale 1.33333333x1

It affects the windows. It's not exactly as described by

https://unix.stackexchange.com/questions/220387/how-to-set-scaling-mode-for-external-displays-on-intel-gpu





More information about the ubuntu-users mailing list