วันพุธที่ 7 กรกฎาคม พ.ศ. 2553

การเปลี่ยนค่า screen resolution ของ ubuntu

ในการ install ubuntu บางครั้ง resolution ใน monitor ได้ค่าไม่ตรงกับค่าที่เคยเซ็ตใน windows ทำให้จอไม่ชัดหรือเบลอ สามารถแก้ไขได้ตามวิธีการดังนี้

1. เปิด terminal พิมพ์คำสั่ง

xrandr

2. จะได้ข้อความดังนี้
Screen 0: minimum 320 x 200, current 2464 x 900, maximum 8192 x 8192
VGA1 connected 1440x900+1024+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1360x768       59.8  *
   1024x768       60.0  
   800x600        60.3     56.2  
   848x480        60.0  
   640x480        59.9     59.9  
LVDS1 connected 1024x768+0+132 (normal left inverted right x axis y axis) 304mm x 228mm
   1024x768       60.0*+   85.0     75.0     70.1     60.0*    50.0  
   832x624        74.6  
   800x600        85.1     72.2     75.0     60.3     56.2  
   640x480        85.0     72.8     75.0     60.0     59.9  
   720x400        85.0  
   640x400        85.1  
   640x350        85.1  
TV1 disconnected (normal left inverted right x axis y axis)

* หมายเหตุ VGA1 คือ Acer monitor 17" ที่ต่อเพิ่ม ส่วน LVDS1 คือ monitor ของ Thinkpad R61

3. สิ่งที่ต้องการคือ ต้องการเพิ่มความละเอียด 1440x900 ในมอนิเตอร์ VGA1 ให้ทำการเช็ค modeline โดยใช้คำสั่ง

cvt 1440 900

*หมายเหตุ 1440 900 คือความละเอียด 1440x900 พิกเซล

4. จะแสดงผลดังนี้

# 1440x900 59.89 Hz (CVT 1.30MA) hsync: 55.93 kHz; pclk: 106.50 MHz
Modeline "1440x900_60.00"  106.50  1440 1528 1672 1904  900 903 909 934 -hsync +vsync

โดยเราจะใช้โค้ดที่ต่อจาก modeline คือ
"1440x900_60.00"  106.50  1440 1528 1672 1904  900 903 909 934 -hsync +vsync
ในการเซ็ตค่าที่ไฟล์ /etc/gdm/Init/Default

5. เปิดไฟล์ /etc/gdm/Init/Default โดยใช้คำสั่ง

sudo gedit /etc/gdm/Init/Default

6. ค้นหาบรรทัดดังนี้
PATH=/usr/bin:$PATH
OLD_IFS=$IFS

7. เพิ่มโค้ดต่อท้ายดังนี้
xrandr --newmode "1440x900_60.00"  106.50  1440 1528 1672 1904  900 903 909 934 -hsync +vsync
xrandr --addmode VGA1 1440x900_60.00
xrandr --output VGA1 --mode 1440x900_60.00
โดยค่าที่ใส่ในบรรทัด newmode คือค่าที่ได้จากการเช็ค modeline

8. restart ubuntu และเช็คค่าที่ System > Preference > Monitor จะพบ resolution ใหม่ที่เพิ่มเข้าไปแล้ว

Reference: http://www.ubuntugeek.com/how-change-display-resolution-settings-using-xrandr.html

ไม่มีความคิดเห็น:

แสดงความคิดเห็น