Results 1 to 6 of 6

Thread: How to switch between single and dual monitors?

  1. #1
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,261
    Distro
    Ubuntu

    Question How to switch between single and dual monitors?

    I usually use my laptop at my office desk connected to another monitor, using an extended desktop (dual monitors).

    Sometimes, I leave the office. But then my laptop doesn't realise that a monitor is missing, and I can't use the computer.

    I can solve this problem each time by changing the file /etc/X11/xorg.conf (I have a working copy of each version of xorg.conf so I can just copy the relevant version). However, that is a bit of a pain as either I have to remember to do this before shutting down, or I must boot in a recovery mode and make the change.

    Question: Is it possible to write a script to check automatically when booting, and copy the relevent xorg.conf to /etc/X11?

  2. #2
    Join Date
    Apr 2008
    Beans
    4,377
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: How to switch between single and dual monitors?

    What video card do you have and which driver is it using?

  3. #3
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,261
    Distro
    Ubuntu

    Re: How to switch between single and dual monitors?

    Quote Originally Posted by markbuntu View Post
    What video card do you have and which driver is it using?
    I'm not entirely sure...

    When I type
    lspci | grep VGA
    I get
    00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)

    When I open Applications -> Other -> Screens and Graphics, it shows the Graphics Card as
    i810 - Intel Integrated Graphics Chipsets (Intel 945)

    I hope that helps.

  4. #4
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,261
    Distro
    Ubuntu

    Re: How to switch between single and dual monitors?

    OK, I've found out how to tell whether I have a monitor running. I use the command
    xrandr -q
    and check the results with fgrep. I've written a script to make the change according to what's connected.

    However, as the script replaces /etc/X11/xorg.conf, it needs to run as a superuser. Therefore, putting it into the start-up (System -> Preferences -> Sessions) doesn't work.

    Do you know how I can get this script to run at start-up as a superuser?

  5. #5
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,261
    Distro
    Ubuntu

    Re: How to switch between single and dual monitors?

    I've answered my own question about how to run it as root.

    Use either update-rc.d or /etc/rc.local.

    However, none of them works because of the timing of the run.

    I shall just manually run the script whenever necessary.

  6. #6
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,261
    Distro
    Ubuntu

    Re: How to switch between single and dual monitors?

    Much easier option:

    Use xrandr (see the RandR HowTo).

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
  •