Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've purchased a USB driven external display for my laptop. I've gotten it working by adding a xorg.conf file, however when the usb monitor isn't plugged in I want the xorg.conf to disappear so that xrandr works normally. I use my laptop on its own, with the usb display, and docked to dual external displays.

I figure I just need to find a good way to move the xorg.conf back and forth based on detecting the usb display. Since it seems to come up sa /dev/fb0 and /dev/fb1 I figured I could get lightdm to check in it's init.d script perhaps? That seems a bit unmaintainable though as upgrades/etc happen.

Is there a better way to manage this? Since it's displaylink it can't be hot swapped, the monitor has to be plugged in and ready at boot. So I need something before lightdm gets going I think to set this up.

Thanks for any tips and ideas.

edit: Bonus points for something that "undoes" itself on shutdown automatically so I don't have to worry about the xorg.conf being there on the next boot.

share|improve this question
Just a write up of what I've got working so far:… – Rick Nov 8 '11 at 3:15
I wish I could tell you that this hasn't already come up before but alas - I have the same problem. – Nathan Osman Nov 8 '11 at 3:16
First and foremost - the biggest nuisance is that Xinerama requires both displays to have the same bit depth. So you either have to set your primary display to 16-bit color or disable Xinerama - which means you won't be able to drag windows from one screen to the other. – Nathan Osman Nov 8 '11 at 3:21
Thanks for the info George. That helps that part. I'm more worried about the conditional xorg.conf file for now. It'd be great if it "auto" loaded on boot if it saw the usb display. Just not sure where in the pipe to get something to do that. – Rick Nov 8 '11 at 3:59
I'm personally hoping that Wayland will correct this. – Nathan Osman Nov 8 '11 at 4:03
up vote 3 down vote accepted

Have you considered writing an init script that will check for those fb devices and copy the xorg.conf into place if they exist, then remove it when it shuts down? You could add it to the boot order before X or lightdm actually starts up but after the DisplayLink adapter has been detected and the device created. An init script is pretty simple, so that should solve your problem.

share|improve this answer
This is basically what I think I'll have to do. For now I just did a quick shell script that moves my xorg.conf to xorg.conf.bak and forth and I run that manually. Eventually I'll get annoyed enough to figure out an init script for it. Thanks! – Rick Nov 18 '11 at 0:38

Your Answer


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.