📄 x-config.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>X11 Configuration</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD Handbook" href="index.html" /><link rel="UP" title="The X Window System" href="x11.html" /><link rel="PREVIOUS" title="Installing X11" href="x-install.html" /><link rel="NEXT" title="Using Fonts in X11" href="x-fonts.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD Handbook</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="x-install.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 5 The X Window System</td><td width="10%" align="right" valign="bottom"><a href="x-fonts.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="X-CONFIG" name="X-CONFIG">5.4 X11 Configuration</a></h1><i class="AUTHORGROUP"><span class="CONTRIB">Contributed by</span> ChristopherShumway.</i> <div class="SECT2"><h2 class="SECT2"><a id="AEN6266" name="AEN6266">5.4.1 Before Starting</a></h2><p>Before configuration of X11 the following information about the target system isneeded:</p><ul><li><p>Monitor specifications</p></li><li><p>Video Adapter chipset</p></li><li><p>Video Adapter memory</p></li></ul><p>The specifications for the monitor are used by X11 to determine the resolution andrefresh rate to run at. These specifications can usually be obtained from thedocumentation that came with the monitor or from the manufacturer's website. There aretwo ranges of numbers that are needed, the horizontal scan rate and the verticalsynchronization rate.</p><p>The video adapter's chipset defines what driver module X11 uses to talk to thegraphics hardware. With most chipsets, this can be automatically determined, but it isstill useful to know in case the automatic detection does not work correctly.</p><p>Video memory on the graphic adapter determines the resolution and color depth whichthe system can run at. This is important to know so the user knows the limitations of thesystem.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN6283" name="AEN6283">5.4.2 Configuring X11</a></h2><p>Configuration of X11 is a multi-step process. The first step is to build an initialconfiguration file. As the super user, simply run:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">Xorg -configure</kbd></pre><p>In the case of <b class="APPLICATION"><span class="TRADEMARK">XFree86</span></b>type:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">XFree86 -configure</kbd></pre><p>This will generate an X11 configuration skeleton file in the <ttclass="FILENAME">/root</tt> directory called <tt class="FILENAME">xorg.conf.new</tt>(whether you <a href="http://www.FreeBSD.org/cgi/man.cgi?query=su&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">su</span>(1)</span></a> or do a directlogin affects the inherited supervisor <tt class="ENVAR">$HOME</tt> directory variable).For <b class="APPLICATION"><span class="TRADEMARK">XFree86</span></b>, this configurationfile is called <tt class="FILENAME">XF86Config.new</tt>. The X11 program will attempt toprobe the graphics hardware on the system and write a configuration file to load theproper drivers for the detected hardware on the target system.</p><p>The next step is to test the existing configuration to verify that <bclass="APPLICATION">Xorg</b> can work with the graphics hardware on the target system. Toperform this task, type:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">Xorg -config xorg.conf.new</kbd></pre><p><b class="APPLICATION"><span class="TRADEMARK">XFree86</span></b> users will type:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">XFree86 -xf86config XF86Config.new</kbd></pre><p>If a black and grey grid and an X mouse cursor appear, the configuration wassuccessful. To exit the test, just press <b class="KEYCAP">Ctrl</b>+<bclass="KEYCAP">Alt</b>+<b class="KEYCAP">Backspace</b> simultaneously.</p><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> If the mouse does not work, you will need to first configure it beforeproceeding. See <a href="install-post.html#MOUSE">Section 2.9.10</a> in the FreeBSDinstall chapter.</p></blockquote></div><p>Next, tune the <tt class="FILENAME">xorg.conf.new</tt> (or <ttclass="FILENAME">XF86Config.new</tt> if you are running <b class="APPLICATION"><spanclass="TRADEMARK">XFree86</span></b>) configuration file to taste. Open the file in atext editor such as <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=emacs&sektion=1&manpath=FreeBSD+Ports"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">emacs</span>(1)</span></a> or <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=ee&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">ee</span>(1)</span></a>. First, add thefrequencies for the target system's monitor. These are usually expressed as a horizontaland vertical synchronization rate. These values are added to the <ttclass="FILENAME">xorg.conf.new</tt> file under the <var class="LITERAL">"Monitor"</var>section:</p><pre class="PROGRAMLISTING">Section "Monitor" Identifier "Monitor0" VendorName "Monitor Vendor" ModelName "Monitor Model" HorizSync 30-107 VertRefresh 48-120EndSection</pre><p>The <var class="LITERAL">HorizSync</var> and <var class="LITERAL">VertRefresh</var>keywords may be missing in the configuration file. If they are, they need to be added,with the correct horizontal synchronization rate placed after the <varclass="LITERAL">HorizSync</var> keyword and the vertical synchronization rate after the<var class="LITERAL">VertRefresh</var> keyword. In the example above the target monitor'srates were entered.</p><p>X allows DPMS (Energy Star) features to be used with capable monitors. The <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=xset&sektion=1&manpath=XFree86+4.4.0"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">xset</span>(1)</span></a> programcontrols the time-outs and can force standby, suspend, or off modes. If you wish toenable DPMS features for your monitor, you must add the following line to the monitorsection:</p><pre class="PROGRAMLISTING"> Option "DPMS"</pre><p>While the <tt class="FILENAME">xorg.conf.new</tt> (or <ttclass="FILENAME">XF86Config.new</tt>) configuration file is still open in an editor,select the default resolution and color depth desired. This is defined in the <varclass="LITERAL">"Screen"</var> section:</p><pre class="PROGRAMLISTING">Section "Screen" Identifier "Screen0" Device "Card0" Monitor "Monitor0" DefaultDepth 24 SubSection "Display" Viewport 0 0 Depth 24 Modes "1024x768" EndSubSectionEndSection</pre><p>The <var class="LITERAL">DefaultDepth</var> keyword describes the color depth to runat by default. This can be overridden with the <var class="OPTION">-depth</var> commandline switch to <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=Xorg&sektion=1&manpath=X11R6.7.0"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">Xorg</span>(1)</span></a> (or <a
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -