sh 在GDM启动时设置监视器分辨率

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 在GDM启动时设置监视器分辨率相关的知识,希望对你有一定的参考价值。

As root:
--------------------------------------------------------------------------------  
Generate monitor resolution string:

cvt 1680 1050 60

Sample output:
# 1680x1050 59.95 Hz (CVT 1.76MA) hsync: 65.29 kHz; pclk: 146.25 MHz
Modeline "1680x1050_60.00"  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
--------------------------------------------------------------------------------  
Find the outputs:

xrandr

Sample output:
DVI-I-1 connected primary 1680x1050+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
VGA-1 connected 1680x1050+1680+0 (normal left inverted right x axis y axis) 474mm x 296mm
HDMI-1 disconnected (normal left inverted right x axis y axis)
--------------------------------------------------------------------------------  
Copy the Modeline to clipboard and paste it as follows:

xrandr --newmode "1680x1050_60.00"  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
--------------------------------------------------------------------------------  
Setup the resolutions for outputs:
  
xrandr --addmode VGA-1 "1680x1050_60.00"
xrandr --output VGA-1 --mode "1680x1050_60.00"
xrandr --addmode DVI-I-1 "1680x1050_60.00"
xrandr --output DVI-I-1 --mode "1680x1050_60.00"
--------------------------------------------------------------------------------  

To set resolution on GDM start:
  
cp .config/monitors.xml /var/lib/gdm/.config/

vi /etc/mdm/Init/Default

Look for the following lines:

PATH=/usr/bin:$PATH
OLD_IFS=$IFS

Add the following lines below them (depending on resolution):
  
xrandr --newmode "1680x1050_60.00"  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
xrandr --addmode VGA-1 "1680x1050_60.00"
xrandr --output VGA-1 --mode "1680x1050_60.00"
xrandr --addmode DVI-I-1 "1680x1050_60.00"
xrandr --output DVI-I-1 --mode "1680x1050_60.00"
--------------------------------------------------------------------------------  

以上是关于sh 在GDM启动时设置监视器分辨率的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu gdm 设置

Vbox中Ubuntu10.10如何设置分辨率

sh 事件监视器启动/停止,获取

sh change_gdm_background

ubuntu不识别显示器要怎么设置高分辨率

sh 启动和监视OpenVpn连接以隐藏IP的脚本