1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

xrandr on laptop with second monitor

Discussion in 'Other Window Managers' started by gpatrick, Apr 11, 2010.

  1. gpatrick

    gpatrick New Member

    Messages:
    320
    Thanks Received:
    32
    Have a second 23" monitor that is connected to the VGA port. The laptop has a resolution of 1366x768 and the monitor has a resolution of 1920x1080.

    Currently I have the laptop screen set to 1366x768 but with Windowmaker my dockapps are not on the right of the screen and cannot be moved. They're only 2/3's of the way to the right. I have the external screen to the left of the laptop and it is set using xrandr to 1920x1080.

    How do I set it so the external screen is set to the left using 1920x1080 and the laptop to 1366x768. I also want the external screen to be an additional screen while currently it is a duplicate of the laptop monitor.

    This is what I want but get the following error:
    Code:
    $ xrandr --output VGA-0 --mode 1920x1080 --left-of LVDS --output LVDS --mode 1366x768
    xrandr: screen cannot be larger than 1920x1920 (desired size 3286x1080)
    


    Code:
    $ xrandr -q
    Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 1920 x 1920
    VGA-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 510mm x 287mm
       1920x1080      60.0*+
       1680x1050      60.0  
       1280x1024      60.0  
       1440x900       59.9  
       1280x800       59.8  
       1152x864       75.0  
       1024x768       70.1     60.0  
       800x600        60.3     56.2  
       640x480        66.7     59.9  
       720x400        70.1  
    LVDS connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
       1366x768       60.0*+
       1280x720       59.9  
       1152x768       59.8  
       1024x768       59.9  
       800x600        59.9  
       640x480        59.4  
    HDMI-0 disconnected (normal left inverted right x axis y axis)
    


    I found this on an xrandr wiki and I put it in a file that is called before wmaker in the .xinitrc. However my mouse doesn't work and the screens are clones:
    Code:
    # If an external monitor is connected, place it with xrandr
     
    # External output may be "VGA" or "VGA-0" or "DVI-0" or "TMDS-1"
    EXTERNAL_OUTPUT="VGA-0"
    INTERNAL_OUTPUT="LVDS"
    # EXTERNAL_LOCATION may be one of: left, right, above, or below
    EXTERNAL_LOCATION="left"
     
    case "$EXTERNAL_LOCATION" in
           left|LEFT)
                   EXTERNAL_LOCATION="--left-of $INTERNAL_OUTPUT"
                   ;;
           right|RIGHT)
                   EXTERNAL_LOCATION="--right-of $INTERNAL_OUTPUT"
                   ;;
           top|TOP|above|ABOVE)
                   EXTERNAL_LOCATION="--above $INTERNAL_OUTPUT"
                   ;;
           bottom|BOTTOM|below|BELOW)
                   EXTERNAL_LOCATION="--below $INTERNAL_OUTPUT"
                   ;;
           *)
                   EXTERNAL_LOCATION="--left-of $INTERNAL_OUTPUT"
                   ;;
    esac
     
    xrandr |grep $EXTERNAL_OUTPUT | grep " connected "
    if [ $? -eq 0 ]; then
        xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --auto $EXTERNAL_LOCATION
        # Alternative command in case of trouble:
        # (sleep 2; xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --auto $EXTERNAL_LOCATION) &
    else
        xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --off
    fi
    
     
  2. adamk

    adamk New Member

    Messages:
    1,624
    Thanks Received:
    265
    Code:
    xrandr: screen cannot be larger than 1920x1920 (desired size 3286x1080)
    


    You need to create an xorg.conf file and add a Virtual directive in the Display SubSection. Something alone these lines:

    Code:
    Section "Screen"
            Identifier "ati"
            Device     "ati"
            DefaultDepth    24
            SubSection "Display"
                    Viewport   0 0
                    Depth     24    
                    Virtual   3286 1080
            EndSubSection
    EndSection
    
     
  3. gpatrick

    gpatrick New Member

    Messages:
    320
    Thanks Received:
    32
    Thanks that worked. Now though since I reinstalled I am having a problem that VGA-0 becomes the primary screen at boot and LVDS is blank.

    When I run
    Code:
    $ xrandr --output VGA-0 --mode 1920x1080 --left-of LVDS --output LVDS --mode 1366x768
    

    It is setting VGA-0 to the correct resolution, but LVDS is blank. Below is the output of 'xrandr -q'

    Code:
    $ xrandr -q
    Screen 0: minimum 320 x 200, current 3286 x 1080, maximum 3286 x 1080
    VGA-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 510mm x 287mm
       1920x1080      60.0*+
       1680x1050      60.0  
       1280x1024      60.0  
       1440x900       59.9  
       1280x800       59.8  
       1152x864       75.0  
       1024x768       70.1     60.0  
       800x600        60.3     56.2  
       640x480        66.7     59.9  
       720x400        70.1  
    LVDS connected 1366x768+1920+0 (normal left inverted right x axis y axis) 344mm x 194mm
       1366x768       60.0*+
       1280x720       59.9  
       1152x768       59.8  
       1024x768       59.9  
       800x600        59.9  
       640x480        59.4  
    HDMI-0 disconnected (normal left inverted right x axis y axis)
    


    I have a subsection with a line of 'Virtual 3286 1080' in xorg.conf.
    Code:
    $ cat /etc/X11/xorg.conf
    Section "ServerLayout"
    	Identifier     "X.org Configured"
    	Screen      0  "Screen0" 0 0
    	InputDevice    "Mouse0" "CorePointer"
    	InputDevice    "Keyboard0" "CoreKeyboard"
    EndSection
    
    Section "Files"
    	ModulePath   "/usr/local/lib/xorg/modules"
    	FontPath     "/usr/local/lib/X11/fonts/misc/"
    	FontPath     "/usr/local/lib/X11/fonts/TTF/"
    	FontPath     "/usr/local/lib/X11/fonts/OTF"
    	FontPath     "/usr/local/lib/X11/fonts/Type1/"
    	FontPath     "/usr/local/lib/X11/fonts/100dpi/"
    	FontPath     "/usr/local/lib/X11/fonts/75dpi/"
    EndSection
    
    Section "Module"
    	Load  "dbe"
    	Load  "dri"
    	Load  "dri2"
    	Load  "extmod"
    	Load  "glx"
    	Load  "record"
    EndSection
    
    Section "InputDevice"
    	Identifier  "Keyboard0"
    	Driver      "kbd"
    EndSection
    
    Section "InputDevice"
    	Identifier  "Mouse0"
    	Driver      "mouse"
    	Option	    "Protocol" "auto"
    	Option	    "Device" "/dev/sysmouse"
    	Option	    "ZAxisMapping" "4 5 6 7"
    EndSection
    
    Section "Monitor"
    	#DisplaySize	  340   190	# mm
    	Identifier   "Monitor0"
    	VendorName   "LGD"
    	ModelName    "d801"
    EndSection
    
    Section "Device"
            ### Available Driver options are:-
            ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
            ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
            ### [arg]: arg optional
            #Option     "NoAccel"            	# [<bool>]
            #Option     "SWcursor"           	# [<bool>]
            #Option     "Dac6Bit"            	# [<bool>]
            #Option     "Dac8Bit"            	# [<bool>]
            #Option     "BusType"            	# [<str>]
            #Option     "CPPIOMode"          	# [<bool>]
            #Option     "CPusecTimeout"      	# <i>
            #Option     "AGPMode"            	# <i>
            #Option     "AGPFastWrite"       	# [<bool>]
            #Option     "AGPSize"            	# <i>
            #Option     "GARTSize"           	# <i>
            #Option     "RingSize"           	# <i>
            #Option     "BufferSize"         	# <i>
            #Option     "EnableDepthMoves"   	# [<bool>]
            #Option     "EnablePageFlip"     	# [<bool>]
            #Option     "NoBackBuffer"       	# [<bool>]
            #Option     "DMAForXv"           	# [<bool>]
            #Option     "FBTexPercent"       	# <i>
            #Option     "DepthBits"          	# <i>
            #Option     "PCIAPERSize"        	# <i>
            #Option     "AccelDFS"           	# [<bool>]
            #Option     "IgnoreEDID"         	# [<bool>]
            #Option     "DisplayPriority"    	# [<str>]
            #Option     "PanelSize"          	# [<str>]
            #Option     "ForceMinDotClock"   	# <freq>
            #Option     "ColorTiling"        	# [<bool>]
            #Option     "VideoKey"           	# <i>
            #Option     "RageTheatreCrystal" 	# <i>
            #Option     "RageTheatreTunerPort" 	# <i>
            #Option     "RageTheatreCompositePort" 	# <i>
            #Option     "RageTheatreSVideoPort" 	# <i>
            #Option     "TunerType"          	# <i>
            #Option     "RageTheatreMicrocPath" 	# <str>
            #Option     "RageTheatreMicrocType" 	# <str>
            #Option     "ScalerWidth"        	# <i>
            #Option     "RenderAccel"        	# [<bool>]
            #Option     "SubPixelOrder"      	# [<str>]
            #Option     "ShowCache"          	# [<bool>]
            #Option     "DynamicClocks"      	# [<bool>]
            #Option     "VGAAccess"          	# [<bool>]
            #Option     "ReverseDDC"         	# [<bool>]
            #Option     "LVDSProbePLL"       	# [<bool>]
            #Option     "AccelMethod"        	# <str>
            #Option     "DRI"                	# [<bool>]
            #Option     "ConnectorTable"     	# <str>
            #Option     "DefaultConnectorTable" 	# [<bool>]
            #Option     "DefaultTMDSPLL"     	# [<bool>]
            #Option     "TVDACLoadDetect"    	# [<bool>]
            #Option     "ForceTVOut"         	# [<bool>]
            #Option     "TVStandard"         	# <str>
            #Option     "IgnoreLidStatus"    	# [<bool>]
            #Option     "DefaultTVDACAdj"    	# [<bool>]
            #Option     "Int10"              	# [<bool>]
            #Option     "EXAVSync"           	# [<bool>]
            #Option     "ATOMTVOut"          	# [<bool>]
            #Option     "R4xxATOM"           	# [<bool>]
    	Identifier  "Card0"
    	Driver      "radeon"
    	VendorName  "ATI Technologies Inc"
    	BoardName   "Unknown Board"
    	BusID       "PCI:1:5:0"
    EndSection
    
    Section "Screen"
    	Identifier "Screen0"
    	Device     "Card0"
    	Monitor    "Monitor0"
    	SubSection "Display"
    		Viewport   0 0
    		Depth     1
    	EndSubSection
    	SubSection "Display"
    		Viewport   0 0
    		Depth     4
    	EndSubSection
    	SubSection "Display"
    		Viewport   0 0
    		Depth     8
    	EndSubSection
    	SubSection "Display"
    		Viewport   0 0
    		Depth     15
    	EndSubSection
    	SubSection "Display"
    		Viewport   0 0
    		Depth     16
    	EndSubSection
    	SubSection "Display"
    		Viewport   0 0
    		Depth     24
    		Virtual   3286 1080
    	EndSubSection
    EndSection
    


    Want LVDS to be the primary display at boot and VGA-0 to not be a clone but just an extended desktop. Using xfce4 right now but may go back to Windowmaker.
     
  4. adamk

    adamk New Member

    Messages:
    1,624
    Thanks Received:
    265
    There is no way to force LVDS to be primary at boot, or even at X start. You can use 'xrandr --output LVDS --primary' to force it to be primary once X starts. However, from what I'm understanding, the LVDS just stays blank now no matter what?

    Adam
     
    gpatrick thanks for this.
  5. aragon

    aragon New Member

    Messages:
    2,031
    Thanks Received:
    252
    There is, but it'll require the OP to switch to the radeonhd driver and adding something like this to xorg.conf:

    Code:
    Option "RROutputOrder" "DVI-I_1/digital VGA_1"
    
     
    gpatrick thanks for this.
  6. gpatrick

    gpatrick New Member

    Messages:
    320
    Thanks Received:
    32
    If I use
    Code:
    xrandr --output VGA-0 --off

    Then LVDS comes on of course, but when I run
    Code:
    xrandr --auto --output VGA-0 --mode 1920x1080 --left-of LVDS --auto

    Then LVDS goes blank and VGA-0 becomes the desktop. And if I'm using Windowmaker, then icons at the bottom for Firefox, for example, are not at the bottom of the screen but only two-thirds down.

    For some reason I can't get LVDS to activate with VGA-0 active at the same time, though I had it before I reinstalled.

    If I run this script I found
    Code:
    # External output may be "VGA" or "VGA-0" or "DVI-0" or "TMDS-1"
    EXTERNAL_OUTPUT="VGA-0"
    INTERNAL_OUTPUT="LVDS"
    # EXTERNAL_LOCATION may be one of: left, right, above, or below
    EXTERNAL_LOCATION="left"
     
    case "$EXTERNAL_LOCATION" in
           left|LEFT)
                   EXTERNAL_LOCATION="--left-of $INTERNAL_OUTPUT"
                   ;;
           right|RIGHT)
                   EXTERNAL_LOCATION="--right-of $INTERNAL_OUTPUT"
                   ;;
           top|TOP|above|ABOVE)
                   EXTERNAL_LOCATION="--above $INTERNAL_OUTPUT"
                   ;;
           bottom|BOTTOM|below|BELOW)
                   EXTERNAL_LOCATION="--below $INTERNAL_OUTPUT"
                   ;;
           *)
                   EXTERNAL_LOCATION="--left-of $INTERNAL_OUTPUT"
                   ;;
    esac
     
    xrandr |grep $EXTERNAL_OUTPUT | grep " connected "
    if [ $? -eq 0 ]; then
        xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --auto $EXTERNAL_LOCATION
        # Alternative command in case of trouble:
        # (sleep 2; xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --auto $EXTERNAL_LOCATION) &
    else
        xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --off
    fi
    

    it returns this
    Code:
    VGA-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 510mm x 287mm
    

    And only VGA-0 is displayed. LVDS is blank.

    What is very, very bizarre, is that after a 10 minute (or so, never timed) timeout (probably power saving) when I go back to use the laptop, both screens are available.