8

I'm using a laptop with Ubuntu (no graphical desktop) to do all of my work. The resolution is awful, at 1024x576 or something similar. So I just close my laptop lid and plug it into an external monitor - but the external one never seems to stretch out to its full size.

The reason for this is that the laptop monitor is always enabled - even when the laptop lid is closed. As a result, the external monitor never assumes the full size, and any time I set GRUB to use a resolution higher than 1024x576, the external screen ignores it.

Is there any way to disable the laptop screen in GRUB, or to specify which screen I want as the primary one? I've tried Google, and absolutely nothing comes up.

(The computer is a Lenovo S10e, if it helps at all.)

11
  • Well, in Windows, you could select the primary display after you connected the second. I doubt that you can set the external display as default, seeing as it would give a lot of problems to the graphics card (they expect some kind of display). Aug 26, 2013 at 3:20
  • @doktoro-reichard Uhh, this is in Linux. Aug 26, 2013 at 3:21
  • I know, I'm just telling you my experience (and not answering because I don't have Unix). Now, graphics cards need to be connected to a display at start - tried to disconnect my VGA cable from the PC then reconnected while the system was running, it froze. What this means is that unless the graphics board is granted that there is a display, it won't output anything. And since a laptop already has a display, it will output to there. Besides, you said you weren't using a graphical interface so why (in my opinion) should there be a function to control displays? Aug 26, 2013 at 3:26
  • @DoktoroReichard - You're totally misinterpreting what I'm asking for. I'm asking for a way to disable my laptop's screen in favour of using my external VGA output. Your comment added nothing to the discussion. And besides, "why (in my opinion) should there be a function to control displays?" Maybe because some people like myself want to use an external display over the pre-installed laptop display. It's not unheard of. Aug 26, 2013 at 8:07
  • @zagrimsan - My question stated that I'm running no graphical desktop, ergo I don't use X. Unless I'm missing something big, why would an X utility solve a non-X problem? Aug 26, 2013 at 8:08

5 Answers 5

12

I managed to find a fix for my problem. I simply added this to my /etc/default/grub file:

GRUB_CMDLINE_LINUX_DEFAULT="<default paramaters> video=LVDS-1:d"

Then did a good ol' fashin update-grub.

This disabled the laptop's LCD on boot, and allowed the external monitor to automatically set its resolution, which worked without a hitch.

2
  • 1
    This worked for me. I got the name for my screen by running xrandr.
    – Sjoerd
    Apr 5, 2018 at 9:27
  • 1
    I had to use LVDS-1 (with a hyphen) as in the example although xrandr gave the name as LVDS1 (without hyphen).
    – chirlu
    Oct 29, 2018 at 16:55
7

If your kernel has i915 driver enabled, the following (which I quote from ArchLinux Wiki, and which in turn quotes from nouveau wiki) might prove helpful.

Basically you could experiment with adding video=... parameter in grub using the d option (see the parameter format below) to disable the internal monitor (whichever name it might have for <conn> option you need to find from the system log which should display the available options during kernel start-up. The information might still be available from previous start-up in /var/log/dmesg if your distro has that, please try grep i915 /var/log/dmesg* and post it here.

https://wiki.archlinux.org/index.php/Kernel_Mode_Setting:

A mode can be forced on the kernel command line. Unfortunately, the command line option video is poorly documented in the DRM case. Bit and pieces on how to use it can be found in

http://cgit.freedesktop.org/nouveau/linux-2.6/tree/Documentation/fb/modedb.txt
http://cgit.freedesktop.org/nouveau/linux-2.6/tree/drivers/gpu/drm/drm_fb_helper.c

The format is:

video=<conn>:<xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd]

<conn>: Connector, e.g. DVI-I-1, see your kernel log.
<xres> x <yres>: resolution
M: compute a CVT mode?
R: reduced blanking?
-<bpp>: color depth
@<refresh>: refresh rate
i: interlaced (non-CVT mode)
m: margins?
e: output forced to on
d: output forced to off
D: digital output forced to on (e.g. DVI-I connector) 

You can override the modes of several outputs using "video" several times, for instance, to force DVI to 1024x768 at 85 Hz and TV-out off:

video=DVI-I-1:1024x768@85 video=TV-1:d

1
  • Thanks for this! While I managed to fix the problem using that very method, I didn't know of all the possible options. I might need these in the future! ;) Aug 26, 2013 at 13:17
0

The comment I left lead me to search Google and, as you said, the problem didn't seem all that uncommon, as I got a lot of results (so maybe you were just a little too lazy :) )

Nonetheless, this link shows a bash script that might do the trick.

#!/bin/sh
echo "Turn on: 1\nTurn off: 2"
read option
if [ $option = 1 ];
then xrandr --output DFP2 --auto --left-of DFP1
elif [ $option = 2 ];
then xrandr --output DFP2 --off
fi

As a comment in the link said, DFP1 and DFP2 may change according to your system, so first query xrandras it will give you the names of the displays you currently have. Then adapt the script as needed.

I assume you can run this at startup, so, like I said, adapt as needed.

0

here is my solution shell script

dmesg | grep "\[.*\] usb [^:]*: .*$input" | grep -o -P "usb .*?:" | grep -o "[0-9][^:]*" | uniq | while read device; do echo enabled >/sys/bus/usb/devices/$device/power/wakeup; done

$input = The name of your device. accepts regex and can be only part of the name of the device.


Here is how it gets the ids of the device:
input="HyperX"

  • dmesg | grep "\[.*\] usb [^:]*: .*$input"
[    2.117325] usb 1-2.1.3: Product: HyperX Alloy Elite
[    2.117326] usb 1-2.1.3: Manufacturer: HyperX Alloy Elite
  • dmesg | grep "\[.*\] usb [^:]*: .*HyperX" | grep -o -P "usb .*?:"
usb 1-2.1.3:
usb 1-2.1.3:
  • dmesg | grep "\[.*\] usb [^:]*: .*HyperX" | grep -o -P "usb .*?:" | grep -o "[0-9][^:]*" | uniq
1-2.1.3

gist = https://gist.github.com/FlafyDev/925cb58aaa3e16dad8483e8702e257af

-2

Im sure someone can give a Linux related answer that would solve your problem. But in the mean time you can disconnect the ribbon cable from the display to the motherboard of the laptop. If you are comfortable opening up your laptop, it should be fairly easy to do - and redo.

2
  • That sounds good, but I also take the laptop out with me every day. Disconnecting the ribbon cable when I leave home then reconnecting it when I get home is totally impractical. Thanks for the answer anyways! :) Aug 26, 2013 at 8:09
  • 3
    This didn't work for me. I removed the whole screen from the laptop, but still X would try to display on the missing laptop screen.
    – Sjoerd
    Apr 5, 2018 at 9:27

You must log in to answer this question.

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