Linux下禁用笔记本屏幕,启动外接VGA
来源:互联网 发布:知乎 quant 编辑:程序博客网 时间:2024/06/07 02:38
公司某款产品使用了atom n2600。结果不知道是设计有问题,还是这款产品天生有缺陷。首先,居然无linux下显卡驱动xf86-video-intel驱动到2015年Q4也没有支持。
后来只好使用VGA做输出测试,当要使用1920x1080时根本启动不起来。
当然在Linux下可以查到有LVDS,VGA两个显示器,好吧,度娘可以告诉我LVDS就是笔记本的LCD显示器,laptop。那VGA才是我们现在使用的显示器,明明LVDS根本没有外接,为什么他一定要探测到有显示器呢,硬件BUG不表了。那么有没有什么办法可以让他的默认输出为VGA,而不是LVDS呢,度娘反正是告诉我,她不知道。
度娘不知道了,只能找谷哥了,想不到谷哥的回答果然有好多。于是暂时记录下此解决方法,再验证此方法,但是人家说的有道理,应该不会错。
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 grub-update
.
This disabled the laptop's LCD on boot, and allowed the external monitor to automatically set its resolution, which worked without a hitch.
其实这原理也比较简单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.txthttp://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>: resolutionM: compute a CVT mode?R: reduced blanking?-<bpp>: color depth@<refresh>: refresh ratei: interlaced (non-CVT mode)m: margins?e: output forced to ond: output forced to offD: 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
实际操作中,自己操作系统中的显露器名称具体是什么,要自己查看才知道。
命令如下
xrandr
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 2048 x 768
VGA-0 disconnected (normal left inverted right x axis y axis)
LVDS connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
代表两个显示器分别是VGA-0,LVDS。那么在GRUB中就要使用此名称禁用。对于双屏问题,xrandr可以做更多。
xrandr --output VGA1 --right-of LVDS1 --auto
xrandr --output LVDS1 off
xrandr --output VGA1 auto
原文地址:
http://superuser.com/questions/636617/disabling-laptop-monitor-on-boot
Halox answer didn't fix the issue, as GDM3 configures the X server on it's own and re-enables the disabled monitor (silly).
After reading the docs I added xrandr --output LVDS1 --off
at the top of /etc/gdm/Init/Default
and finally got it to work.
This makes linux ignore the LVDS output altogether. That way it will not be used by all login managers, and won't appear in display configuration dialogs.
Create a file /usr/share/X11/xorg.conf.d/50-disable-lvds.conf
and write there:
Section "Monitor" Identifier "lvds monitor" Option "ignore" "true"EndSectionSection "Device" Identifier "onboard" Option "Monitor-LVDS1" "lvds monitor"EndSection
http://superuser.com/questions/626482/permanently-disable-second-screen更有一个大神写的脚本,网页为:
http://ubuntuforums.org/showthread.php?t=1243541
- Linux下禁用笔记本屏幕,启动外接VGA
- Linux下笔记本禁用触摸板
- Ubuntu 下外接扩展屏幕
- linux下禁用笔记本自带键盘和touchpad
- linux下禁用笔记本自带键盘和touchpad
- ubuntu linux下笔记本禁用touch pad的方法
- Linux操作系统,笔记本如何配置外接显示器
- Linux系统VGA启动模式下设置分辨率
- linux 笔记本禁用触摸板
- linux下如何保存笔记本屏幕亮度设置(背光亮度)
- 在Ubuntu下设置笔记本外接显示器(双显示器)
- Ubuntu下禁用/开启笔记本触摸板
- ubuntu下开启/禁用笔记本触摸板
- 笔记本外接显示器
- 在Linux下禁用键盘、鼠标、触摸板(笔记本)等输入设备
- 禁用 IBM笔记本 Fn+空格键的屏幕放大功能
- linux下设置vga显示模式方法
- linux下设置vga显示模式方法
- Android自定义View
- 详细讲解transform,一看就懂了!
- Windows上安装Redis
- linux 信号 可重入函数
- HDOJ 2057 A + B Again
- Linux下禁用笔记本屏幕,启动外接VGA
- Bus System
- 机器学习中的规则化范数(L0, L1, L2, 核范数)
- 性能优化过度绘制
- 图片压缩尺寸,本地沙盒缓存,上传服务器
- Pass an array/vector into a function
- VS2010 C++ 操作Excel表格的编程实现
- LeetCode 80. Remove Duplicates from Sorted Array II
- Docker Registry V1 与 V2 的区别解析以及灵雀云的实时同步迁移实践