HOWTO.dualhead-x60s

From openSUSE

                                jw, Tue May 13 00:59:53 CEST 2008

# read http://en.opensuse.org/Multiple_Displays_Using_XRandR
#
cd /etc/X11
cp xorg.conf{,.dualclone}

## first get suitable modelines for the intended external monitors.
## No need to connect them.
## sax will always test them with the resolution of the internal LCD (dualclone mode).
## but sax will write modelines to /etc/X11/xorg.conf, overwriting any manual tuning.
##
sax2
-> Display 1: Resolution 1024x768
-> Dual Head Mode
   -> [X] Activate Dual Head Mode
   -> Configure...
## for a larger 4:3 monitor we have vesa settings:
    -> Second Monitor: VESA 1280x1024@60HZ
    -> test, save
grep Modeline /etc/X11/xorg.conf > /tmp/modelines
    -> Second Monitor: VESA 1280x1024@75HZ
    -> test, save
grep Modeline /etc/X11/xorg.conf >> /tmp/modelines
sax2
   -> Configure...
    -> Second Monitor: Samsung SYNCMASTER 226BW
    -> test, save
grep Modeline /etc/X11/xorg.conf >> /tmp/modelines
## like this, collect modelines for all needed monitors.
##
## instead of guessing the correct vesa modes for an unknown monitor,
## you can also
## - connect the monitor,
## - restart X-server
## - grep -A 16 'Supported VESA Video Modes' /var/log/Xorg.0.log
##

## now edit xorg.conf:
## - include all modelines,
##   :.!sort -u /tmp/modelines
## - pump up the screen section,
##   * list the most useful modelinenames
##   * Add 'Virtual' with the sum of the largest external and largest internal width
##     and the maximum of internal and external heights.
## do this for all display subsections
vi xorg.conf
...
Section "Modes"
  Identifier   "Modes[0]"
:.!sort -u /tmp/modelines

Section "Screen"
  DefaultDepth 24
  SubSection "Display"
    Depth      15
    Modes      "1680x1050" "1600x1000" "1280x1024" "1280x800" "1024x768" "800x600"
    Virtual    2704 1050
  EndSubSection
...
ZZ
## immediatly do a backup:
cp xorg.conf{,.dual2704.1}

# restart X. e.g. Ctrl-Alt-Backspace, so that it loads the new modelines.
# did not work without the monitor connected, xrandr had no matches, as really nothing matched..
# third attempt, still nothing matches...
# xrandr only offers 1024... sigh.

## seperate the displays:
xrandr --auto --output VGA --mode 1024x768 --right-of LVDS

## force resolution up.
xrandr --newmode 1280x1024a 108.0 1280 1328 1440 1688 1024 1025 1028 1066
xrandr ----addmode VGA 1280x1024a
xrandr --auto --output VGA --mode 1280x1024a --right-of LVDS

## bingo.
## sax2 deletes modes from the display subsections, but it keeps the virtual
## entries. looks liek the virtual entries are the only relevant things anyway.
## the above 1280x1024a is neither in the modelines, nor in the display subsections,
## but it works.
## so how about a script, that pumps the correct modelines into xrandr and switches them...

## kdepanel may no longer be on the internal display, force it back with
xrandr --auto --output VGA --off

# see also
# ~seife/bin/dualhead.sh