How to modify the resolution of Linux and FreeBSD (xfree86)

Source: Internet
Author: User

Several steps are required to configure X11. The first step is to create an initial configuration file as a Super User:

# Xorg-configure

When xfree86 is used, type:

# Xfree86-configure

This will generate a configuration file named Xorg. conf. New in/root (whether you use SU (1) or log on directly, the default $ home directory variable will be changed ). For xfree86, the configuration file name is xf86config. New. X11ProgramAn attempt will be made to detect the graphics hardware in the system and write a configuration file containing the detected hardware to load the correct driver.

The next step is to test the existing configuration file to confirm that Xorg can work properly with the graphics devices on the system. To complete this task, you only need:

# Xorg-config Xorg. conf. New

Xfree86 users should:

# Xfree86-xf86config xf86config. New

If you see a black and gray grid and an X-shaped mouse pointer, the configuration is successful. To exit the test, press CTRL + ALT + backspace at the same time.

Note: If the mouse is abnormal, configure it first. See section 2.9.10 of FreeBSD installation.

Next, adjust the Xorg. conf. New (or xf86config. New, if xfree86 is run) configuration file and perform a test. Open the file in a text editor such as Emacs (1) or EE (1. The first thing to do is to set the update rate for the current system's display. These values include the vertical and horizontal synchronization frequencies. Add them to the "Monitor" section of Xorg. conf. New:

Section "Monitor"
Identifier "monitor0"
Vendorname "monitor vendor"
Modelname "Monitor Model"
Horizsync 30-107
Vertrefresh 48-120
Endsection

Horizsync and vertrefresh may not exist in the configuration file. If so, you need to add them and set appropriate values after horizsync and vertrefresh. In the preceding example, the corresponding parameters are displayed.

X can use the dpms (Energy Star) function supported by the display. The xset (1) program can control the timeout time and force standby, suspension, or shutdown. To enable the dpms function of the monitor, add the following settings to the monitor section:

Option "dpms"

Select the default resolution and color depth before disabling Xorg. conf. New (or xf86config. New. This is defined in the "screen" section:

section "screen"
identifier "screen0"
device "card0"
monitor "monitor0"
defaultdepth 24
subsection "display"
viewport 0 0
depth 24
Modes "1024x768"
endsubsection
endsection

The defaultdepth keyword describes the default color depth for running. You can use the-depth command line switch of Xorg (1) (or xfree86 (1) to replace the settings in the configuration file. The modes keyword describes the screen resolution at a given color depth. It should be noted that the graphic hardware of the target system only supports the standard mode defined by Vesa. In the preceding example, the default color depth is 24 bits. When this color is used, the allowable resolution is 1024x768.

Finally, save the configuration file to the disk and test it in the test mode described above.

Note: One of the tools that can help you find and solve problems is the X11 log file, which contains information about each device related to the X11 server. The Xorg log file name is in the format of Ar/log/xorg.0.log (xfree86 log file name is in the format of xfree86.0.log ). Accurate log names can be changed from xorg.0.log to xorg.8.log.

If you are about to stop, you can put the configuration file in a public directory. You can find the specific location in Xorg (1) (or xfree86 (1. This location is usually/etc/X11/Xorg. conf or/usr/x11r6/etc/X11/Xorg. conf (for xfree86, it should be/etc/X11/xf86config or/usr/x11r6/etc/X11/xf86config ).

# Cp Xorg. conf. New/etc/X11/Xorg. conf

For xfree86:

# Cp xf86config. New/etc/X11/xf86config

Now the entire X11 configuration process has been completed. To use startx (1) to start xfree86 4.x, you need to install the X11/wrapper port. Xorg already contains wrapperCodeTherefore, you do not need to install the wrapper port. The X11 server can also be started with xdm (1.

Note: There is a graphical Configuration tool, xorgcfg (1) (xf86cfg (1) for xfree86), installed with the X11 software package. It can define the configuration interactively by selecting the appropriate driver and setting. This program can be directly started from the console by running the xorgcfg-textmode command. For more information, see the xorgcfg (1) and xf86cfg (1) online manuals.

There is also a text interface configuration tool named xorgconfig (1) (xf86config (1) for xfree86), which is a console tool and is not very friendly to users, however, when other tools cannot work, they can still be used.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.