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"
Section "Monitor"
    Identifier  "big display"
    Option  "Monitor-DVI1" "big display"

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

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.

  • 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, 2011 at 10:55
  • @Norky I have flagged the question for moderators. May 20, 2011 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, 2011 at 11:27
  • @DMA57361 - I have no particular preference, whichever you think is best :)
    – Norky
    May 20, 2011 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, 2011 at 13:16

4 Answers 4


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

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

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.

  • Note that with Option "ignore" "true", the display will be disabled permanently; it cannot be re-activated on-demand via xrandr. You might prefer to use Option "Disable" "true" instead. (That option is actually undocumented and it does what Norky originally intended to configure via Option "Enable" "no".)
    – Alex O
    Mar 13, 2022 at 20:47

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)
  • SDDM: /etc/X11/xdm/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 and it is executable.

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


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

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

Section "Monitor"
   Identifier "big display"

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

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


If you use Option "ignore" "true" in /etc/X11/xorg.conf then you will not be able to use that output with xrandr (or depending tools) at all. Using this config I just disabled my HDMI output:

Section "Monitor"
        Identifier "My-DVI-D"
        Option "Primary" "true"
        Option "PreferredMode" "1920x1080x60.0"

Section "Monitor"
        Identifier "My-HDMI"
        Option "Enable" "false"
        Option "RightOf" "My-DVI-D"

Section "Device"
        Identifier "onboard"
        Option "Monitor-HDMI1" "My-DVI-D"
        Option "Monitor-HDMI2" "My-HDMI"

Note that every single config line is necessary to enable DVI-D (at full resolution) and to disable HDMI.

To find your outputs run xrandr -q and adapt Option "Monitor-... accordingly. The relevant manpage sections are:

   Option "Enable" "bool"
          This optional entry specifies whether the monitor should be turned on at  startup.   By  default,  the  server  will
          attempt to enable all connected monitors.  (RandR 1.2-supporting drivers only)
   Option "PreferredMode" "name"
          This optional entry specifies a mode to be marked as the preferred initial mode of the monitor.  (RandR 1.2-support‐
          ing drivers only)
   Option "Primary" "bool"
          This optional entry specifies that the monitor should be treated as the primary monitor. (RandR 1.2-supporting driv‐
          ers only)
   With RandR 1.2-enabled drivers, monitor sections may be tied to specific outputs of the video card.  Using the name of  the
   output  defined by the video driver plus the identifier of a monitor section, one associates a monitor section with an out‐
   put by adding an option to the Device section in the following format:

   Option "Monitor-outputname" "monitorsection"

   (for example, Option "Monitor-VGA" "VGA monitor" for a VGA output)
  • 1
    Good point -- with "Ignore", the display is completely hidden and it cannot be re-enabeld on demand via xrandr. Actually, the Enable option that was mentioned in the question should allow this -- but that option will not work due to an ancient bug. With the (uncodumented) option Option "Disable" "true" this will work, though.
    – Alex O
    Mar 13, 2022 at 20:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .