Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am running Ubuntu on a Dell Latitude with the latest Nvidia drivers. Basically what I want is when I disconnect my external display that everything goes back to the main one without having to change the config every time.

Any help is welcome!

share|improve this question
    
Have you tried sudo xrandr --auto after a change ? –  Popinou Oct 28 '10 at 14:43
add comment

6 Answers 6

up vote 9 down vote accepted

First install disper, then download autorandr and follow these instructions:

  • When the external monitor is undocked, run the following command in terminal:

    auto-disper.sh --save undocked
    
  • When the external monitor is docked and configured as you want (with Nvidia X Server Settings), run:

    auto-disper.sh --save docked
    
  • Try:

    auto-disper.sh --change
    

    with docked and undocked monitor. It should detect the state and change the configuration.

  • Finaly make a keyboard shortcut for auto-disper.sh --change

I tried to make a script that run it every 3 seconds, so auto-dectection works, but use too much ressource. Hope that can help!

share|improve this answer
    
This worked great. Thanks! –  Diego Oct 29 '10 at 19:03
1  
This project has been merged into autorandr and is only available to keep links working. Please check autorandr. github.com/wertarbyte/autorandr –  belacqua Mar 28 '11 at 15:21
1  
disper is not in the 10.10 repositories. It is available as a ppa: launchpad.net/~disper-dev/+archive/ppa –  belacqua Mar 28 '11 at 15:26
add comment

This is a limitation of Nvidia Twinview on Linux. The open source driver will work as expected (though you'll lose 3D acceleration and Compiz).

share|improve this answer
add comment

I'm in about the same situation. I use a laptop which is sometimes connected to my external monitor. When it is, I usually want to use only this monitor (because I have it hooked up to an external keyboard & mouse also).

What I found, is that if you have a file called .xprofile, it is called every time the display is initialized (by X.org?). Here is the contents of my file. As you can see, I adapted it from here.

What you should do is save it to ~/.xprofile and then make it runnable (chmod +x .xprofile). Check how your internal and your external monitors are called - do this by running xrandr with no arguments. Mine are VGA1 and LVDS1 respectively. The last thing is to set the EXTERNAL_RES variable to the native resolution of your external monitor.

Now on boot up, the connected monitor will be used if it is connected. The tricky part is automation (such as removing the cable while Ubuntu is running). I haven't found a very good solution for this, but it seems that switching to a virtual console and back does the trick (Ctrl-Alt-F1 and then Ctrl-Alt-F7). It's a bit quicker than cycling through all the possibilities with the Fn key (which also sometimes messes up the display).

share|improve this answer
add comment

Use disper http://willem.engen.nl/projects/disper/ After installing it, you may want to create two shortcuts 1. to switch to extrnal display at max resolution: CTRL+E --> disper "max" -S 2. to go back to PRimary display : CTRL+P --> disper "max" -s

share|improve this answer
add comment

You can always just press Fn+F8 after disconnecting the monitor. That will probably change it back.

share|improve this answer
    
That doesn't work on my computer. The FN keys don't do anything. Do you know what could be? –  Diego Oct 19 '10 at 15:12
add comment

Automatic detection would be cool. Meanwhile I found this blog post which shows how to bind a key to a provided script that toggles between displays. It works pretty well for me. It would be nice if Ubuntu provided something like this out of the box.

http://ninetynine.be/blog/2010/05/quick-workaround-for-missing-switch-display-key-or-lcdcrt-key-on-ubuntu/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.