Disabling laptop monitor on boot?

6

5

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.)

Joshua Merriman

Posted 2013-08-26T03:06:09.163

Reputation: 451

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). – Doktoro Reichard – 2013-08-26T03:20:46.387

@doktoro-reichard Uhh, this is in Linux. – Joshua Merriman – 2013-08-26T03:21:53.750

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? – Doktoro Reichard – 2013-08-26T03:26:46.817

@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. – Joshua Merriman – 2013-08-26T08:07:27.657

@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? – Joshua Merriman – 2013-08-26T08:08:36.617

@Joshua maybe this post might help

– Doktoro Reichard – 2013-08-26T10:56:51.783

@Joshua - Sorry for missing that part about not having X. In that case things are a bit more difficult as the configuration you want would likely need to be passed as kernel parameters, which requires that the Intel graphics kernel driver would support setting up these things with parameters, and I'm not at all confident that that would be the case. – zagrimsan – 2013-08-26T11:59:52.047

Please post the output of uname -a – zagrimsan – 2013-08-26T12:01:39.570

@DoktoroReichard - While that is a nice post, it still applies to X. I don't have any form of graphical window system on my machine, and I don't plan on getting one soon. – Joshua Merriman – 2013-08-26T13:19:23.413

@zagrimsan - I managed to do just that, passing a single line to GRUB on boot to disable my laptop LCD, which let the external VGA display take over and set its own resolution. – Joshua Merriman – 2013-08-26T13:21:43.750

@zagrimsan - I will, give me some time! I'm not able to accept my own answer until two days have passed. – Joshua Merriman – 2013-08-27T03:12:51.747

Answers

9

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.

Joshua Merriman

Posted 2013-08-26T03:06:09.163

Reputation: 451

1This worked for me. I got the name for my screen by running xrandr. – Sjoerd – 2018-04-05T09:27:12.623

I had to use LVDS-1 (with a hyphen) as in the example although xrandr gave the name as LVDS1 (without hyphen). – chirlu – 2018-10-29T16:55:50.220

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

zagrimsan

Posted 2013-08-26T03:06:09.163

Reputation: 995

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! ;) – Joshua Merriman – 2013-08-26T13:17:41.577

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.

Doktoro Reichard

Posted 2013-08-26T03:06:09.163

Reputation: 4 896

-1

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.

Keltari

Posted 2013-08-26T03:06:09.163

Reputation: 57 019

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 – 2018-04-05T09:27:56.837

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! :) – Joshua Merriman – 2013-08-26T08:09:27.417