Announcement

Collapse
No announcement yet.

How to create a 2nd X screen with xrandr?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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; 22 April 2009, 08:29 AM.

    Comment

    Working...
    X