Dual Screen einrichten

From LUGUM

Jump to: navigation, search

Inhaltsverzeichnis

Grundsätzliches

Howto TwinView mit 2 unterschiedlich grossen Monitoren unter Verwendung eines xorg.conf-Auswahlmenüs

Die Problematik, aus der wir zu dritt nicht ausbrechen konnten, ist diese: Bei Verwendung eines Laptop(Screens) mit extern angeschlossenem TFT wird der Laptop-Monitor automatisch als Monitor 2 (der sekundäre Monitor) definiert, nicht wie im Single-Monitor Modus, als Monitor 1 (der primäre Monitor). Wir haben es nicht geschafft, hardware- bzw softwaretechnisch dieses Problem zu lösen.

Daher wurde ein Script geschrieben, welches es dem Benutzer ermöglicht, vor dem Start von KDE mittels eines xorg.conf-Auswahlmenüs auszuwählen, an welchem Standort er sich denn nun befindet, und welche xorg.conf geladen werden soll. In meinem Fall: Single-Screen für im Office, TwinView für zu Hause.

Zum Laufen gebracht wurde dies auf einer DELL Precision M70 (1680x1050) und einem externen DELL UltraSharp (1024x768), der links meines Laptops aufgebaut ist.

Lange Rede, kurzer Sinn, das Lesen dieses Textes hat länger gedauert, als die kommenden Aktionen dauern werden.

1)Erstellen von zwei xorg.conf-Versionen, einmal für deine Single-Monitor Konfiguration, einmal für die TwinView

2)Das Script 'monitor-twinview' nach '/usr/local/bin' kopieren und startbar machen mit 'chmod a+x'

3)Die Datei '/etc/init.d/kdm' editieren:

'/usr/local/bin/monitor-twinview' vor 'set -e' einfügen. 4)Kopieren deiner beiden xorg.conf-Versionen nach /etc/X11/ und dann entsprechend das Auswahlscript anpassen. 5)Reboot ;o) and keep smiling.

Das Auswahlscript

#!/bin/bash

# /usr/local/bin/monitor-twinview
# Author: Andreas Kraus (lug@ak1301.de)
# Lizenz: GPL 2


# Wie lange soll das Script auf die Benutzereingabe warten
timeout=10

# Wie viele Eintraege hat dein Script
items=2

# Wo liegt die xorg.conf
XORGCONF=/etc/X11/xorg.conf

# Wo liegt die Twin_view Config
TWINVIEW=/etc/X11/xorg.conf.twin_view

# Wo liegt die Single_view Config
SINGLE=/etc/X11/xorg.conf.single_view

height=$((items + 6))
width=70
result=`/usr/bin/dialog --timeout $timeout --stdout --no-cancel \
       --radiolist "Bitte Konfiguration auswaehlen (timeout = $timeout sekunden)" \
       $height $width $items \
       single_view "1 Monitor" on \
       twin_view "2 Monitore" off \
       2> /dev/null`

input=`echo $result | sed -e 's/^"//' | sed -e 's/"$//'`

case "$input" in
    single_view)
        echo "1 Monitor"
        if [ -f $SINGLE ]; then
            cp $SINGLE $XORGCONF
        else
            exit 1
        fi
        ;;
    twin_view)
        echo "2 Monitore"
        if [ -f $TWINVIEW ]; then
            cp $TWINVIEW $XORGCONF
        else
            exit 1
        fi
        ;;
esac

xorg.conf.single_view

Section "InputDevice"
        Identifier      "Generic Keyboard"
        Driver          "keyboard"
        Option          "CoreKeyboard"
        Option          "XkbRules"      "xorg"
        Option          "XkbModel"      "pc105"
        Option          "XkbLayout"     "de"
        Option          "XkbVariant"    "nodeadkeys"
EndSection

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "SendCoreEvents"        "true"
        Option          "Device"                "/dev/input/mice"
        Option          "Protocol"              "ImPS/2"
        Option          "Emulate3Buttons"       "true"
        Option          "ZAxisMapping"          "4 5"
        Option          "Buttons"               "5"
EndSection

Section "Extensions"
        Option "Composite" "Enable"
EndSection

Section "InputDevice"
        Identifier  "PS/2 Mouse"
        Driver      "mouse"
        Option      "Protocol" "auto"
        Option          "ZAxisMapping"          "4 5"
        Option      "Device" "/dev/psaux"
        Option      "Emulate3Buttons" "true"
        Option          "CorePointer"
        Option      "Emulate3Timeout" "70"
        Option      "SendCoreEvents"  "true"
EndSection

Section "Device"
        Identifier      "Generic Video Card0"
        Driver          "nvidia"
        BusID           "PCI:1:0:0"
        Option          "AllowGLXWithComposite" "true"
        Option          "UseEdidFreqs" "off"
        Option          "IgnoreEDID" "True"
        Option          "MetaModes" "1680x1050,1680x1050"
EndSection

Section "Monitor"
        Option       "CalcAlgorithm" "CheckDesktopGeometry"
        DisplaySize  1680 1050
        HorizSync    27-90
        Identifier   "Monitor0"
        ModelName    "1680X1050@60HZ"
        Option       "DPMS"
        VendorName   "--> LCD"
        VertRefresh  40-60
EndSection

Section "Screen"
        Identifier      "Screen0"
        Device          "Generic Video Card0"
        Monitor         "Monitor0"
        DefaultDepth    24
        SubSection "Display"
                Depth           1
                Modes           "1024x768" "800x600" "640x480"
        EndSubSection
        SubSection "Display"
                Depth           4
                Modes           "1024x768" "800x600" "640x480"
        EndSubSection
        SubSection "Display"
                Depth           8
                Modes           "1024x768" "800x600" "640x480"
        EndSubSection
        SubSection "Display"
                Depth           15
                Modes           "1024x768" "800x600" "640x480"
        EndSubSection
        SubSection "Display"
                Depth           16
                Modes           "1024x768" "800x600" "640x480"
        EndSubSection
        SubSection "Display"
                Depth           24
                Modes           "1680x1050" "1024x768" "800x600" "640x480"
        EndSubSection
EndSection

Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          "Screen0" 0 0
        InputDevice     "Generic Keyboard"
        InputDevice     "Configured Mouse"
        InputDevice     "PS/2 Mouse"
    Option         "VideoRam" "245760k"
EndSection

Section "DRI"
        Mode    0666
EndSection

xorg.conf.twin_view

(mit Zusatzoptionen zum selber rumspielen ;o)

Section "InputDevice"
        Identifier      "Generic Keyboard"
        Driver          "keyboard"
        Option          "CoreKeyboard"
        Option          "XkbRules"      "xorg"
        Option          "XkbModel"      "pc105"
        Option          "XkbLayout"     "de"
        Option          "XkbVariant"    "nodeadkeys"
EndSection

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "SendCoreEvents"        "true"
        Option          "Device"                "/dev/input/mice"
        Option          "Protocol"              "ImPS/2"
        Option          "Emulate3Buttons"       "true"
        Option          "ZAxisMapping"          "4 5"
        Option          "Buttons"               "5"
EndSection

Section "Extensions"
        Option "Composite" "Enable"
EndSection

Section "InputDevice"
        Identifier  "PS/2 Mouse"
        Driver      "mouse"
        Option      "Protocol" "auto"
        Option          "ZAxisMapping"          "4 5"
        Option      "Device" "/dev/psaux"
        Option      "Emulate3Buttons" "true"
        Option          "CorePointer"
        Option      "Emulate3Timeout" "70"
        Option      "SendCoreEvents"  "true"
EndSection

Section "Device"
        Identifier      "Device0"
        Driver          "nvidia"
        Option          "AGPMode" "4"
        Option          "AGPFastWrite" "on"
        Option          "DynamicClocks" "on"
#       Option          "TwinView" "on"
        Option          "MetaModes"     "1024x768,1680x1050;1024x768,1024x768"
#       Option          "ConnectedMonitor" "crt-0"
        BusID           "PCI:1:0:0"
        Screen          0
EndSection

Section "Device"
        Identifier      "Device1"
        Driver          "nvidia"
        Option          "AGPMode" "4"
        Option          "AGPFastWrite" "on"
        Option          "DynamicClocks" "on"
#       Option          "ConnectedMonitor" "dfp-0"
        BusID           "PCI:1:0:0"
        Screen          1
EndSection

Section "Monitor"
        # Laptop Schirm
        Identifier      "Monitor0"
        HorizSync       64
        VertRefresh     60
        DisplaySize     332     205
        Gamma           1.35
        Option          "DPMS"
EndSection

Section "Monitor"
        # Externer CRT
        Identifier      "Monitor1"
        HorizSync       30-70
        VertRefresh     50-150
        DisplaySize     325     245
        Option          "DPMS"
EndSection

Section "Screen"
        # Screen fuer den Laptop-Monitor
        Identifier      "Screen1"
        Device          "Device1"
        Monitor         "Monitor1"
        DefaultDepth    24
        SubSection "Display"
                Depth           24
                Modes           "1680x1050" #"1024x768"
                ViewPort        0 0
        EndSubSection
EndSection

Section "Screen"
        # Screen fuer den externen Monitor mit Virtual Screen
        Identifier      "Screen0"
        Device          "Device0"
        Monitor         "Monitor0"
        DefaultDepth    24
        SubSection "Display"
                Depth           24
                Modes           "1024x768" "1680x1050"
                Virtual         1680 1050
                ViewPort        0 0
        EndSubSection
EndSection

Section "ServerFlags"
        Option "Xinerama" "On"
EndSection

Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          "Screen0"
        Screen          "Screen1" RightOf "Screen0"
        Option  "TwinView" "on"
#       Option  "ConnectedMonitor"      "dfp-0, crt-0"
#       Option          "TwinViewOrientation" "crt-0 LeftOf dfp-0"
        InputDevice     "Generic Keyboard"
        InputDevice     "PS/2 Mouse"
EndSection

Section "DRI"
        Mode    0666
EndSection
Persönliche Werkzeuge