Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a laptop (~5 year old HP compaq nc6400 running Fedora Linux) that I use most of the time as a desktop machine. It is plugged into a docking station with its lid closed and connected through that by DVI cable to a large external LCD display.

For various reasons (login greeter appears on closed display, limited graphics card cannot do 3D to both displays at once) I would like to prevent the laptop's integrated display panel being used by X at all. While docked and on my desk (which is how I use it about 97% of the time) I would like it to simply not use the integrated laptop panel. Booting is not a particular problem, as by default everything is mirrored between the two displays. Also, I don't mind a 'manual' solution, such that I have to undo settings on those rare occasions when I am using the laptop away from my desk.

Once logged in I can configure Gnome so that it only uses the external monitor and the laptop panel is marked "off", however this has no effect on the initial auto-configured state of X and the pre-login greeter display. Surprisingly the laptop does not appear to have a lid sensor, so opening or closing the lid does not appear to trigger any events. I can use xrandr -display :0 --output LVDS1 --off --output DVI1 --auto on a separate VC before login, but this is still after the fact of X having started and discovered and deciding to use both displays.

I tried configuring Xorg by creating a file /etc/X11/xorg.conf.d/01-turn-off-laptop-display.conf which contains:

Section "Monitor"
    Identifier  "laptop panel"
    Option  "Monitor-LVDS1" "laptop panel"
    Option  "Enable" "no"
EndSection
Section "Monitor"
    Identifier  "big display"
    Option  "Monitor-DVI1" "big display"
EndSection

Section "Screen"
    Identifier  "main"
    Device  "Default"
    Monitor "big display"
EndSection

However that did not have a useful effect. The video card is Intel 945GM:

[dan@khorium ~]$ sudo lspci -v -s 0:2
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03) (prog-if 00 [VGA controller])
    Subsystem: Hewlett-Packard Company Device 30ad
    Flags: bus master, fast devsel, latency 0, IRQ 16
    Memory at f4600000 (32-bit, non-prefetchable) [size=512K]
    I/O ports at 4000 [size=8]
    Memory at e0000000 (32-bit, prefetchable) [size=256M]
    Memory at f4680000 (32-bit, non-prefetchable) [size=256K]
    Expansion ROM at <unassigned> [disabled]
    Capabilities: [90] MSI: Enable- Count=1/1 Maskable- 64bit-
    Capabilities: [d0] Power Management version 2
    Kernel driver in use: i915
    Kernel modules: i915

00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)
    Subsystem: Hewlett-Packard Company Device 30ad
    Flags: bus master, fast devsel, latency 0
    Memory at f4700000 (32-bit, non-prefetchable) [size=512K]
    Capabilities: [d0] Power Management version 2

The machine has been running various versions of Fedora Linux (x86_64) since about version 10/11). I'm currently trying Fedora 15 beta (which includes Gnome 3), but the problem has existed in previous OS releases.

share|improve this question

migrated from superuser.com May 23 '11 at 9:01

This question came from our site for computer enthusiasts and power users.

    
ahh, okay - I wasn't sure which was the best place to ask. I presume with a rep. of 1 I cannot move my question between SE sites so I just have to let someone else do it? –  Norky May 20 '11 at 10:55
    
@Norky I have flagged the question for moderators. –  Let_Me_Be May 20 '11 at 11:14
    
@Let_Me_Be and @Norky - this question is on topic here as well. But, @Norky, if you personally would prefer to put the question up on Unix.SE instead then please feel free (and @ comment be back so I can remove this one), but otherwise there's nothing wrong with it here. –  DMA57361 May 20 '11 at 11:27
    
@DMA57361 - I have no particular preference, whichever you think is best :) –  Norky May 20 '11 at 13:14
    
Ah, @Norky, the point is you can use whichever you think is best - it's your question and it's perfectly valid on both sites, you'll just get answers from a different community. So, if you're fine with it here, we'll leave it here for now. However, if the post hasn't received an answer in the near future the @ me back again and I'll shift it for you. –  DMA57361 May 20 '11 at 13:16

3 Answers 3

up vote 4 down vote accepted

I was able to achieve the desired aim with the following xorg.conf:

Section "Monitor"
        Identifier      "laptop panel"
        Option  "ignore"        "true"
EndSection
Section "Monitor"
        Identifier      "big display"
EndSection    
Section "Device"
        Identifier      "onboard"
        Option  "Monitor-LVDS1" "laptop panel"
        Option  "Monitor-DVI1" "big display"
EndSection

the critical element being Option "Ignore" "true". I might be able to simplify this further, but it works. I don't yet know what will happen when/if I use the laptop away from the external display, possibly X will exit with an error - not a perfect solution but I can move the configuration out of the way in that event.

share|improve this answer

I would suggest a slightly different approach that might be more flexible for those rare occasions you want to use the laptop as a laptop.

Depending on your display manager (probably GDM, KDM, or LightDM) you can run a script as the display manager starts up. You won't need a modified xorg.conf file at all. the location for the script is as follows(1):

  • KDM: /etc/kde/kdm/Xsetup (at the bottom)
  • XDM: /etc/X11/xdm/Xsetup (at the bottom)
  • GDM: /etc/gdm/Init/Default - place the script code just above the "/sbin/initctl" line. (1)
  • LightDM: /etc/lightdm/lightdm.conf - "display-setup-script=" points to the script wherever you want it to be. Make sure the first line of the script is #!/bin/sh

The script can be something like this. You'll need to replace monitor names with those appropriate for your machine. I've tried to guess based on your xorg.conf above.

/usr/bin/xrandr --current | grep "DVI1 connected "
if [ $? -eq 0 ]; then
echo "DVI found"
sleep 1s 
/usr/bin/xrandr --output LVDS1 --off
/usr/bin/xrandr --output DVI1 --auto --primary

This will test if your DVI monitor is connected, and if it is enable it instead of the built in display. I've got a much more complicated version of this that makes my laptop dock well at work, but still be fine for usage elsewhere. It's more complicated for me because i'm using 5 screens at work.

(1) some file location info from http://forum.xfce.org/viewtopic.php?pid=25026#p25026

share|improve this answer

slightly modified version of the previous post's xorg.conf

Section "Monitor"
   Identifier "hdmi out"
   Option "ignore" "true"
EndSection

Section "Monitor"
   Identifier "big display"
EndSection

Section "Device"
   Identifier "onboard"
   Option "Monitor-LVDS1" "hdmi out"
   Option "Monitor-VGA1" "big display"
EndSection

seems to work for intel NM10 chip. The box has vga out for the "big display"

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.