Results 1 to 8 of 8

Thread: Switch between single/dual monitor mode?

  1. #1
    Join Date
    Jul 2008
    Beans
    141
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Switch between single/dual monitor mode?

    I recently hooked my television up to my computer as a second monitor so that I can watch videos on it. However, I don't always want to be in dual monitor mode. I've found that running "gksudo nvidia-settings" allows me to switch between the two modes without restarting X if I change some settings around and click "apply".

    Is there a way I could setup two scripts to handle this process? The main problem I'm encountering is the fact that I change all the settings through the nvidia-settings graphical interface; therefore, I have no idea what's actually happening behind the scenes, so I don't know how to go about putting the two scripts together (what commands to issue, etc.). Could someone help me out with this?

    Thank you

  2. #2
    Join Date
    May 2010
    Location
    Georgia , USA
    Beans
    164
    Distro
    Ubuntu

    Re: Switch between single/dual monitor mode?

    have you see this?

    http://www.linuxquestions.org/questi...e-only-647626/

    create a launcher

  3. #3
    Join Date
    Nov 2010
    Location
    Berlin, Germany
    Beans
    4,534
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: Switch between single/dual monitor mode?

    Xrandr manual:
    http://manpages.ubuntu.com/manpages/.../xrandr.1.html

    Guide for setting monitor modes, you will need this to turn the monitor on again:
    https://wiki.ubuntu.com/X/Config/Resolution

    Thread with a live example regarding a similar intention:
    http://ubuntu-virginia.ubuntuforums.....php?p=9885433

  4. #4
    Join Date
    Jul 2008
    Beans
    141
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Switch between single/dual monitor mode?

    Quote Originally Posted by mrhhug View Post
    have you see this?

    http://www.linuxquestions.org/questi...e-only-647626/

    create a launcher
    I read through that, but I'm not sure how to apply it to my situation. In that thread, the person only has one screen active at a time (either his laptop screen or his external monitor). For me, I will always have my main monitor active, but I'd like to be able to switch between having just my monitor active and having both my monitor and TV active at the same time.

    I've looked at the differences between xorg.conf when I'm in single-monitor mode vs dual-monitor mode, but I can't figure out what to change so that I can use xrandr like the person in that thread. I've put the differences in blue below.

    Single-monitor xorg.conf:
    Code:
    Section "Monitor"
        # HorizSync source: edid, VertRefresh source: edid
        Identifier     "Monitor0"
        VendorName     "Unknown"
        ModelName      "Acer X223W"
        HorizSync       30.0 - 82.0
        VertRefresh     56.0 - 76.0
        Option         "DPMS"
    EndSection
    
    Section "Device"
        Identifier     "Device0"
        Driver         "nvidia"
        VendorName     "NVIDIA Corporation"
        BoardName      "GeForce 8800 GT"
    EndSection
    
    Section "Screen"
        Identifier     "Screen0"
        Device         "Device0"
        Monitor        "Monitor0"
        DefaultDepth    24
        Option         "TwinView" "0"
        Option         "TwinViewXineramaInfoOrder" "DFP-0"
        Option         "metamodes" "DFP: nvidia-auto-select +0+0"
        SubSection     "Display"
            Depth       24
        EndSubSection
    EndSection
    Dual-monitor xorg.conf:
    Code:
    Section "Monitor"
        # HorizSync source: edid, VertRefresh source: edid
        Identifier     "Monitor0"
        VendorName     "Unknown"
        ModelName      "LG Electronics LG TV"
        HorizSync       30.0 - 83.0
        VertRefresh     58.0 - 62.0
        Option         "DPMS"
    EndSection
    
    Section "Device"
        Identifier     "Device0"
        Driver         "nvidia"
        VendorName     "NVIDIA Corporation"
        BoardName      "GeForce 8800 GT"
    EndSection
    
    Section "Screen"
        Identifier     "Screen0"
        Device         "Device0"
        Monitor        "Monitor0"
        DefaultDepth    24
        Option         "TwinView" "1"
        Option         "TwinViewXineramaInfoOrder" "DFP-0"
        Option         "metamodes" "CRT: 1680x1050 +1680+0, DFP: nvidia-auto-select +0+0"
        SubSection     "Display"
            Depth       24
        EndSubSection
    EndSection
    Is there a way I could put both options in one xorg.conf file and be able to switch between them?

  5. #5
    Join Date
    May 2010
    Location
    Georgia , USA
    Beans
    164
    Distro
    Ubuntu

    Re: Switch between single/dual monitor mode?

    i stole this from here : http://www.dotkam.com/2007/06/02/swi..._ubuntu_linux/

    while in single monitor mode do:
    Code:
    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.single
    get into dual monitor mode by whatever means possible then do
    Code:
    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.dual
    write the 2 scripts
    Code:
    echo "#/bin/sh \
    # restart gdm with single monitor support \
    sudo cp /etc/X11/xorg.conf.single /etc/X11/xorg.conf; sudo /etc/init.d/gdm restart" > ./singledisplay
    Code:
    echo "#/bin/sh \
    # restart gdm with dual monitor support \
    sudo cp /etc/X11/xorg.conf.dual /etc/X11/xorg.conf; sudo /etc/init.d/gdm restart" > ./dualdisplay
    move the 2 scripts so all you have to do it type the script name
    Code:
    sudo mv ./dualdisplay /usr/bin/dualdisplay
    Code:
    sudo mv ./singledisplay /usr/bin/singledisplay
    make the both executable
    Code:
    sudo chmod +x /usr/bin/singledisplay
    Code:
    sudo chmod +x /usr/bin/dualdisplay
    now all you have to do it open a terminal and type "sudo dualdisplay" or "sudo singledisplay" and everything should be automated.
    Im sure there is a way to do this with one script instead of 2 and also a launcher but this should make your life a little easier - sorry i didnt have dual displays to test the thing

  6. #6
    Join Date
    Jul 2008
    Beans
    141
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Switch between single/dual monitor mode?

    That's close to what I'm trying to accomplish, but that method still requires restarting X. I think the xrandr way is what I need to try and figure out, but suited to my setup. Thank you, though. I appreciate the help!

  7. #7
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Kubuntu 11.04 Natty Narwhal

    Re: Switch between single/dual monitor mode?

    Have a look at disper.
    it is made for this purpose.

  8. #8
    Join Date
    Jul 2008
    Beans
    141
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Switch between single/dual monitor mode?

    Quote Originally Posted by realzippy View Post
    Have a look at disper.
    it is made for this purpose.
    Thank you! That does exactly what I want.

Bookmarks

Posting Permissions

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