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.

Context

I use Ubuntu 11.04 on a laptop. I have three monitor configurations:

  • Work: disable laptop monitor, use external 1920 X 1200 monitor
  • Home: disable laptop monitor, use external 1680 x 1050 monitor
  • Other: just laptop monitor

I use NVIDIA X Server settings to switch between monitor configurations.

  • The ideal situation would be that the monitor configuration could be activated based on what external monitor was plugged into the laptop.
  • Another reasonable option would be to have a shortcut key that toggled between the three laptop configurations (or perhaps three shortcut keys, one for each configuration).

Question

  • How can I more simply switch between monitor configurations?

Initial thoughts

  • A user asked about automatic switching of monitor configurations on ubuntu forums with some more suggestions here
  • I thought there might be some way of using a shortcut key to manipulate the xorg.conf file.
share|improve this question
    
Check out this thread for some clues: askubuntu.com/questions/62099/… –  Victor S Feb 21 '12 at 16:04

3 Answers 3

up vote 5 down vote accepted

Try Disper, it's got some potential. I am still figuring it out but it will definitely do what you described. I don't think auto-switching is a realistic option yet, but Disper with a keyboard shortcut is worth trying out.

share|improve this answer
1  
Also, there's autorandr/disper, which can remember disper monitor configurations. I think that's just what you need. github.com/wertarbyte/autorandr –  Christoph May 13 '11 at 8:56
1  
Additionally, there's a GUI for the script. worked perfectly in Maverick, I'm not sure about the current status in Natty (app-indicator) bugs.launchpad.net/disper/+bug/619897 –  Christoph May 13 '11 at 8:57

If you're using xorg.conf for your setup, this inelegant, but simple solution has worked for me:

Create a separate configuration file for each setup, which you will put in /etc/X11. Name them something like this:

  • xxorg.conf.work
  • xxorg.conf.home
  • xxorg.conf.single

(The double exes will prevent the server from spontaneously deleting the files)

Then create three simple shell scripts and put them in /usr/local/bin. Name them something like:

  • display.work
  • display.home
  • display.single

An example of the contents of one of the files looks like this:

  • "#!/bin/sh"
  • cp -f /etc/X11/xxorg.conf.work /etc/X11/xorg.conf
  • echo "Display is set for WORK"
  • echo "You must restart the display manager for settings to take effect."

To use these scripts, assuming you've booted up and are looking at the wrong display--

  • Press Ctrl-Alt-F2 to bring up a non-graphical shell.
  • log in
  • as root, (su or sudo, depending on your system) run the desired script.
  • restart your X server

Yes, it's not as nice as plug and play would be, but it's pretty quick and painless nonetheless.

share|improve this answer

As @JE2Tom suggested, Disper was able to do the job. For those interesed, this is what I did.

  • I installed Disper for Ubuntu

  • I then used CompizConfig - General - Commands to create shortcut keys for the two commands that i wanted:

    • disper -s activates just the primary monitor
    • disper -S activates just the secondary monitor
share|improve this answer

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.