Results 1 to 2 of 2

Thread: How to create a 2nd X screen with xrandr?

  1. #1
    Join Date
    Apr 2008
    Posts
    127

    Default How to create a 2nd X screen with xrandr?

    Instead of using aticonfig to setup a dual-head configuration, I would like to use xrandr to do the same thing. I was wondering if this is possible. I'm looking for a setup with two separate desktops (no window dragging from one monitor to another, so I am NOT looking for a single large desktop).

    Using aticonfig I can setup a dual-head configuration using:
    Code:
    aticonfig --initial=dual-head -f
    In my xorg.conf this gives me 2 screen sections, 2 monitor sections and 2 device sections. In the serverlayout section both screens are listed. With xrandr I'm able to address the separate screens with the option `--screen 0' and `--screen 1'.
    But with the newest fglrx drivers I'm experiencing problems after configuring my dual-head setup this way (gnome only uses 1024x768 pixels of the 1280x1024 pixels that show up on my monitor).

    So I was wondering if I could achieve the same dual-head setup with xrandr. So I did:
    Code:
    aticonfig --intial -f
    And my main monitor works fine. My xorg.conf only has one screen, monitor and device section and only one screen is listed in the serverlayout. Now I would like to add a 2nd X screen for the second desktop, using xrandr. How should I do this, and is this even possible?

    I can't find much information about this topic because almost everybody seems to want to stretch their desktop over multiple screens. I don't want that because one of my monitors is my TV, which is often turned off and I don't accidentally drag windows to them. I don't want a setup with cloning the screens either, because I like to use my main monitor while I'm playing a movie on my tv.

  2. #2
    Join Date
    Sep 2008
    Posts
    124

    Default

    If you dont want the desktop to stretch, then it's up to your desktop enviroment to be able to support randr. In my WM (Awesome WM) it works great. And you will always be able to drag the windows between the screen (but this doesn't mean the desktop will stretch, i got two different taskbars with different applications on each, and if i pull one over, it'll move to the other taskbar).
    I guess it's up to your WM to prevent windows from entering the TV-screen, however, there is a nice solution for this.
    Since some applications mess up the resolution when i go fullscreen, i have created some small scripts which turn off/on screens with xrandr.
    Code:
    When i want everything on my lappy:
    xrandr --output VGA-0 --off --output LVDS --auto
    
    When i want everything on my TV:
    xrandr --output VGA-0 -output LVDS --off
    
    And both, next to each other:
    xrandr --output VGA-0 --auto --left-of LVDS --output LVDS --auto
    If i turn off the TV-screen, all windows that were over there gets moved back to my laptop. I got these mapped to some keyboard shortcuts.

    This is what i got in my xorg.conf (i cleaned it up a bit though).
    I'm not sure you even have to specify a monitor, the important part is the Virtual size.
    Code:
    Section "Screen"
    	Identifier	"Default Screen"
    	Device		"your-video-device"
    	Monitor		"Some monitor"
    	DefaultDepth	24
    	SubSection "Display"
    		Virtual 	2640 800 # Large enough to place two screens next to each other
    	EndSubSection
    EndSection
    Last edited by Micket; 04-22-2009 at 09:29 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •