Ten przewodnik powstał na podstawie : http://zdzichubg.jogger.pl/2007/05/07/xrandr-1-2-sweetness/
Wszelkie testy przeprowadzono na laptopie Acer Travelmate 5720 z następującą konfiguracją grafiki :
# lspci -vv -s 00:02 00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 03) (prog-if 00 [VGA controller]) Subsystem: Acer Incorporated [ALI] Device 011f Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 0 Interrupt: pin A routed to IRQ 30 Region 0: Memory at fc000000 (64-bit, non-prefetchable) [size=1M] Region 2: Memory at d0000000 (64-bit, prefetchable) [size=256M] Region 4: I/O ports at 1800 [size=8] Expansion ROM at <unassigned> [disabled] Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit- Address: fee0300c Data: 41c1 Capabilities: [d0] Power Management version 3 Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME- Bridge: PM- B3+ Kernel driver in use: i915 00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 03) Subsystem: Acer Incorporated [ALI] Device 011f Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 0 Region 0: Memory at fc100000 (64-bit, non-prefetchable) [size=1M] Capabilities: [d0] Power Management version 3 Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME- Bridge: PM- B3+
Pomimo istniejącej w KDE4 aplikacji krandrtray (paczka kde4-kdebase-workspace), nie udało mi się na dzień dzisiejszy (5.1.2010 r.) podjąć z nią sensownej współpracy - uruchomienie powoduje rozsypanie okien, a nawet segfault kwin.
Należy zainstalować paczkę z programem xrandr np. za pomocą poldka
poldek:/all-avail> install xorg-app-xrandr
Po podłączeniu drugiego monitora powinniśmy uzyskać coś podobnego, w zależności od podłączonego sprzętu :
$ xrandr Screen 0: minimum 320 x 200, current 1680 x 1850, maximum 8192 x 8192 VGA1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 473mm x 296mm 1680x1050 60.0*+ 1280x1024 75.0 1152x864 75.0 1024x768 75.1 70.1 60.0 832x624 74.6 800x600 72.2 75.0 60.3 56.2 640x480 72.8 75.0 66.7 60.0 720x400 70.1 LVDS1 connected 1280x800+0+1050 (normal left inverted right x axis y axis) 331mm x 207mm 1280x800 60.0*+ 1024x768 85.0 75.0 70.1 60.0 832x624 74.6 800x600 85.1 72.2 75.0 60.3 56.2 640x480 85.0 72.8 75.0 59.9 720x400 85.0 640x400 85.1 640x350 85.1 TV1 disconnected (normal left inverted right x axis y axis)
Teraz można rozdzielić zadania każdego monitora na różne obszary, ja używam większego obszaru dodatkowego monitora do oglądania filmów - działa świetnie z mplayerem na full-screen, przy czym na mniejszym obszarze nadal można coś robić :
$ xrandr --output VGA1 --above LVDS1
Takowe polecenie można łatwo dopisać do autostartu (w kde4 wystarczy wstawić skrypt powłoki w ~/.kde/Autostart/ ), ewentualnie sprawdzając, czy dodatkowy monitor jest podłączony :
#!/bin/bash IntVideo="LVDS1" ExtVideo="VGA1" if [ -x "/usr/bin/xrandr" ]; then kdialog --passivepopup "Pakiet xorg-app-xrandr jest zainstalowany" --title "Status instalacji xrandr" 10 echo "Pakiet xorg-app-xrandr jest zainstalowany" else kdialog --error "Zainstaluj pakiet xorg-app-xrandr" --title "Status instalacji xrandr" echo "Błąd : Zainstaluj pakiet xorg-app-xrandr" exit -1 fi if [ "$(xrandr | grep ${ExtVideo} | sed -ne 's/^.*\s\(.*connected\)\(.*\)/\1/p')" == "connected" ]; then ExtVideoStatus="Podłaczone" xrandr --auto && xrandr --output ${ExtVideo} --above ${IntVideo} else ExtVideoStatus="Rozłaczone" fi kdialog --passivepopup "Wyjście video ${ExtVideo} ${ExtVideoStatus}" --title "Stan wyjścia SVGA" 10
Inną możliwością jest konfiguracja dwóch wyjść monitorowych na jednej karcie w /etc/X11/xorg.conf :
Section "Monitor" Identifier "MatrixEmbeded" VendorName "Acer" ModelName "Travelmate LCD" Option "PreferredMode" "1280x800" Option "DPMS" EndSection Section "Monitor" Identifier "AsusMW221u" VendorName "Asus" ModelName "MW221u" Modeline "1680x1050" 149.00 1680 1784 1960 2240 1050 1053 1059 1089 # 1680x1050 @ 60.00 Hz (GTF) hsync: 65.22 kHz; pclk: 147.14 MHz Modeline "1680x1050@60" 147.14 1680 1784 1968 2256 1050 1051 1054 1087 -HSync +Vsync # 1680x1050 @ 61.00 Hz (GTF) hsync: 66.31 kHz; pclk: 149.59 MHz Modeline "1680x1050@61" 149.59 1680 1784 1968 2256 1050 1051 1054 1087 -HSync +Vsync Option "PreferredMode" "1680x1050@60" # Option "DPMS" Option "Above" "MatrixEmbeded" EndSection Section "Device" Identifier "IntelGM965" Driver "intel" BoardName "Intel Mobile GM965/GL960" Option "DRI" "on" Option "Tiling" "True" Option "SwapbuffersWait" "False" Option "Display" "LCD" Option "Monitor-LVDS1" "MatrixEmbeded" Option "Monitor-VGA1" "AsusMW221u" # Option "Monitor-TV1" "TV-Out" # Option "Monitor-TMDS1" "Dvi-Out" Option "XvMC" "True" Option "XvPreferOverlay" "True" Option "DPMS" EndSection Section "Screen" Identifier "MainScreen" Device "IntelGM965" Monitor "MatrixEmbeded" DefaultDepth 24 Subsection "Display" Depth 24 ViewPort 0 0 EndSubsection EndSection Section "ServerLayout" Identifier "AcerXLayout" Screen 0 "MainScreen" 0 0 InputDevice "SynapticTouchpad" "CorePointer" InputDevice "UsbMouse" "Pointer" InputDevice "AcerKeyboard" "CoreKeyboard" EndSection
Modelines wstawiłem, ponieważ nie zawsze raportowane możliwości monitora są u mnie zgodne z rzeczywistością… Skąd można wziąć magiczne wpisy „Modeline” ? Ano np. po zapoznaniu się z :
$ man gtf
Miłego użytkowania…
— Daniel Dawid Majewski 5.1.2010 r. 12:04