/[gentoo]/xml/htdocs/doc/en/xorg-config.xml
Gentoo

Contents of /xml/htdocs/doc/en/xorg-config.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download) (as text)
Mon Jul 5 19:53:36 2004 UTC (9 years, 9 months ago) by swift
Branch: MAIN
Changes since 1.3: +12 -3 lines
File MIME type: application/xml
Add note about possible masked xorg (for the time being, should be unmasked soon(ish))

1 swift 1.1 <?xml version='1.0' encoding='UTF-8'?>
2    
3 swift 1.4 <!-- $Header: /home/cvsroot/gentoo/xml/htdocs/doc/en/xorg-config.xml,v 1.3 2004/05/29 08:52:16 swift Exp $ -->
4 swift 1.1
5     <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
6    
7     <guide link="/doc/en/xorg-config.xml">
8    
9     <title>The X Server Configuration HOWTO</title>
10    
11     <author title="Author">
12     <mail link="swift@gentoo.org">Sven Vermeulen</mail>
13     </author>
14    
15     <abstract>
16     Xorg is the X Window server which allows users to have a graphical
17     environment at their fingertips. This HOWTO explains what Xorg is, how to
18     install it and what the various configuration options are.
19     </abstract>
20    
21     <!-- The content of this document is licensed under the CC-BY-SA license -->
22     <!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
23     <license/>
24    
25 swift 1.4 <version>1.3</version>
26     <date>July 05, 2004</date>
27 swift 1.1
28     <chapter>
29     <title>What is the X Window Server?</title>
30     <section>
31     <title>Graphical vs Command-Line</title>
32     <body>
33    
34     <p>
35     The average user may be frightened at the thought of having to type in commands.
36     Why wouldn't he be able to point and click his way through the freedom provided
37     by Gentoo (and Linux in general)? Well, *big smile*, of course you are able to
38     do this :-) Linux offers a wide variety of flashy user interfaces and
39     environments which you can install on top of your existing installation.
40     </p>
41    
42     <p>
43     This is one of the biggest surprises new users come across: a graphical user
44     interface is nothing more than an application which runs on your system. It is
45     <e>not</e> part of the Linux kernel or any other internals of the system. It is
46     a powerful tool that fully enables the graphical abilities of your workstation.
47     </p>
48    
49     <p>
50     As standards are important, a standard for drawing and moving windows on a
51     screen, interacting with the user through mouse and keyboard and other basic yet
52     important aspects has been created and named the <e>X Window System</e>,
53     commonly abbreviated as <e>X11</e> or just <e>X</e>. It is used on Unix, Linux
54     and Unix-like operating systems throughout the world.
55     </p>
56    
57     <p>
58     The application that provides Linux users with the ability to run graphical
59     user interfaces and that uses the X11 standard is Xorg-X11, a fork of
60     the XFree86 project. XFree86 has decided to use a license that might not be
61     compatible with the GPL license; the use of Xorg is therefore recommended. Note
62     though that the differences between Xorg and XFree86 are currently very slim; if
63     you know one, you know the other. XFree86 versions prior to 4.4 are available
64     through Portage as well.
65     </p>
66    
67     </body>
68     </section>
69     <section>
70     <title>The X.org Project</title>
71     <body>
72    
73     <p>
74     The <uri link="http://www.x.org">X.org</uri> project created and
75     maintains a freely redistributable open-source implementation of the X11 system.
76     It is an open source X11-based desktop infrastructure.
77     </p>
78    
79     <p>
80     Xorg provides an interface between your hardware and the graphical software
81     you want to run. Besides that, Xorg is also fully network-aware, meaning you
82     are able to run an application on one system while viewing it on a different
83     one.
84     </p>
85    
86     </body>
87     </section>
88     </chapter>
89     <chapter>
90     <title>Installing Xorg</title>
91     <section>
92     <title>Using emerge</title>
93     <body>
94    
95     <p>
96     Enough chitchat, let's get to business shall we? To install Xorg, you just
97     need to run <c>emerge xorg-x11</c>. Installing Xorg does take a while
98     though, so you might want to grab a snack while you are waiting.
99     </p>
100    
101     <pre caption="Installing Xorg">
102     # <i>emerge xorg-x11</i>
103     </pre>
104    
105 swift 1.4 <note>
106     For some architectures, Xorg hasn't been found bugfree for a certain period of
107     time, making it linger in the <path>~ARCH</path> tree. If the above emerge
108     command errors out with a notice about "masked package", please inform yourself
109     about <uri
110     link="/doc/en/handbook/handbook-x86.xml?part=2&amp;chap=2#doc_chap4">Software
111     Availability</uri>. We hope to get Xorg in the stable branch soon though.
112     </note>
113    
114 swift 1.1 <p>
115     When the installation is finished, you might need to reinitialise some
116     environment variables before you continue. Just run <c>env-update</c> followed
117     by <c>source /etc/profile</c> and you're all set. This doesn't harm your system
118     in any way.
119     </p>
120    
121     <pre caption="Reinitialising the environment variables">
122     # <i>env-update</i>
123     # <i>source /etc/profile</i>
124     </pre>
125    
126     </body>
127     </section>
128     </chapter>
129     <chapter>
130     <title>Configuring Xorg</title>
131     <section>
132     <title>The xorg.conf File</title>
133     <body>
134    
135     <p>
136 neysx 1.2 The configuration file of Xorg is called <path>xorg.conf</path> and it
137 swift 1.1 resides in <path>/etc/X11</path>. The Xorg-X11 package provides an example
138     configuration as <path>/etc/X11/xorg.conf.example</path> which you can use to
139     create your own configuration. It is heavily commented, but if you are in need
140     of more documentation regarding the syntax, don't hesitate to read the man page:
141     </p>
142    
143     <pre caption="Reading the xorg.conf man page">
144     # <i>man 5 xorg.conf</i>
145     </pre>
146    
147     <p>
148     Happy reading for those of you willing to. We surely don't so we'll continue
149     with checking out how we can create the file automatically.
150     </p>
151    
152     </body>
153     </section>
154     <section>
155     <title>Default: Automatic Generation of xorg.conf</title>
156     <body>
157    
158     <p>
159     Xorg itself is able to guess most parameters for you. In most cases, you
160     will only have to change some lines to get the resolution you want up and
161     running. If you are interested in more in-depth tweaking, be sure to check the
162     resources at the end of this chapter. But first, let us generate a (hopefully
163     working) Xorg configuration file.
164     </p>
165    
166     <pre caption="Generating an xorg.conf file">
167     # <i>Xorg -configure</i>
168     </pre>
169    
170     <p>
171     Be sure to read the last lines printed on your screen when Xorg has finished
172     probing your hardware. If it tells you it failed at some point, you're forced to
173     manually write an <path>xorg.conf</path> file. Assuming that it didn't fail, it
174     will have told you that it has written <path>/root/xorg.conf.new</path> ready
175     for you to test. So let's test :)
176     </p>
177    
178     <pre caption="Testing the xorg.conf.new file">
179     # <i>Xorg -config /root/xorg.conf.new</i>
180     </pre>
181    
182     <p>
183     If all goes well, you should see an ugly, loathsome, repulsive, deformed
184     window manager called <c>twm</c>, probably the smallest window manager
185     available. Try moving your mouse and see if your keyboard and such is working.
186     In the next section we will optimize our <path>xorg.conf</path> so it fits your
187     hardware. Now go into one of the terminals you see on your screen and type in
188     <c>exit</c> (or press Ctrl-D) until Xorg shuts down. If you are unable to
189     use your mouse to focus the terminals, you can also press Ctrl-Alt-Backspace to
190     kill the X server.
191     </p>
192    
193     </body>
194     </section>
195     <section>
196     <title>Alternative: Semi-Automatic Generation of xorg.conf</title>
197     <body>
198    
199     <p>
200     Xorg provides a tool called <c>xorgconfig</c> which will ask you for various
201     information regarding your system (graphical adapter, keyboard, ...). Based on
202     your input it will create a <path>xorg.conf</path> file.
203     </p>
204    
205     <pre caption="Semi-Automatic Generation of xorg.conf">
206     # <i>xorgconfig</i>
207     </pre>
208    
209     </body>
210     </section>
211     </chapter>
212     <chapter>
213     <title>Tweaking xorg.conf</title>
214     <section>
215     <title>Copying over xorg.conf</title>
216     <body>
217    
218     <p>
219     Let us first copy over the <path>xorg.conf.new</path> to
220     <path>/etc/X11/xorg.conf</path> so we won't have to continuously run <c>Xorg
221     -config</c> -- typing <c>startx</c> is far more easy :)
222     </p>
223    
224     <pre caption="Copying over xorg.conf">
225     # <i>cp /root/xorg.conf.new /etc/X11/xorg.conf</i>
226     </pre>
227    
228     <p>
229     Now run <c>startx</c> to start up your X server. It will use the freshly copied
230     file as its configuration file. To finish the X session, type in <c>exit</c> or
231     Ctrl-D in the upcoming xterms. You can also kill the X session using the
232     Ctrl-Alt-Backspace combination. This will however make X exit disgracefully -
233     something that you might not always want. It doesn't hurt though :)
234     </p>
235    
236     <pre caption="Starting X">
237     # <i>startx</i>
238     </pre>
239    
240     </body>
241     </section>
242     <section>
243     <title>Setting your Resolution</title>
244     <body>
245    
246     <p>
247     If you feel that the screen resolution is wrong, you will need to check two
248     sections in your configuration. First of all, you have the <e>Screen</e> section
249     which lists the resolutions - if any - that your X server will run at. By
250     default, this section might not list any resolutions at all. If this is the
251     case, Xorg will estimate the resolutions based on the information in the
252     second section, <e>Monitor</e>.
253     </p>
254    
255     <p>
256     What happens is that Xorg checks the settings of <c>HorizSync</c> and
257     <c>VertRefresh</c> in the <e>Monitor</e> section to compute valid resolutions.
258     For now, leave these settings as-is. Only when the changes to the <e>Screen</e>
259     section (which we will describe in a minute) don't work, then you will need to
260     look up the specs for your monitor and fill in the correct values. You can also
261     use a tool that searches for your monitor's specs, such as
262     <c>sys-apps/ddcxinfo-knoppix</c>.
263     </p>
264    
265     <warn>
266     Do <b>not</b> "just" change the values of these two monitor-related variables
267     without consulting the technical specifications of your monitor. Setting
268     incorrect values lead to out-of-sync errors at best and smoked up screens at
269     worst.
270     </warn>
271    
272     <p>
273     Now let us change the resolutions. In the next example from
274     <path>/etc/X11/xorg.conf</path> we add the <c>Modes</c> lines and the
275     <c>DefaultDepth</c> so that our X server starts with 24 bits at 1024x768 by
276     default. Don't mind the given strings - they are examples and will most likely
277     differ from the settings on your system.
278     </p>
279    
280     <pre caption="Changing the Screen section in /etc/X11/xorg.conf">
281     Section "Screen"
282     Identifier "Default Screen"
283     Device "S3 Inc. ProSavage KN133 [Twister K]"
284     Monitor "Generic Monitor"
285     <i>DefaultDepth 24</i>
286     <comment># Skipping some text to improve readability</comment>
287     SubSection "Display"
288     Depth 24
289     <i>Modes "1024x768"</i>
290     EndSubSection
291     EndSection
292     </pre>
293    
294     <p>
295     Run X (<c>startx</c>) to discover it uses the resolution you want :)
296     </p>
297    
298     </body>
299     </section>
300     <section>
301     <title>Configuring your Keyboard</title>
302     <body>
303    
304     <p>
305     To setup X to use an international keyboard, search for the <e>InputDevice</e>
306     section that configures the keyboard and add the <c>XkbLayout</c> option to
307     point to the keyboard layout you want. As an example, we show you how to apply
308     for the Belgian layout. Just substitute the country-keycode with yours:
309     </p>
310    
311     <pre caption="Changing the keyboard layout">
312     Section "InputDevice"
313     Identifier "Generic Keyboard"
314     Driver "keyboard"
315     Option "CoreKeyboard"
316 swift 1.3 Option "XkbRules" "xorg"
317 swift 1.1 Option "XkbModel" "pc105"
318     <i>Option "XkbLayout" "be"</i>
319     EndSection
320     </pre>
321    
322     </body>
323     </section>
324     <section>
325     <title>Configuring your Mouse</title>
326     <body>
327    
328     <p>
329     If your mouse isn't working, you will first need to find out if it is detected
330 neysx 1.2 by the kernel at all. PS/2 mice are (device-wise) seen as
331     <path>/dev/psaux</path>. Other mice (like USBs) are seen as
332 swift 1.1 <path>/dev/input</path> (or <path>/dev/input/mice</path>). In either case you
333     can check if the devices do represent your mouse by checking the output of those
334     files when you move your mouse. To end the session press <c>Ctrl-C</c>.
335     </p>
336    
337     <pre caption="Checking the device files">
338     # <i>cat /dev/input</i>
339     <comment>(Don't forget to press Ctrl-C to end this)</comment>
340     </pre>
341    
342     <p>
343     If your mouse isn't detected, verify if all the necessary modules are loaded.
344     </p>
345    
346     <p>
347     If your mouse is detected, fill in the device in the appropriate
348     <e>InputDevice</e> section. In the next example you'll see we also set two other
349     options: <c>Protocol</c> (which lists the mouse protocol to be used - most users
350     will use PS/2 or IMPS/2) and <c>ZAxisMapping</c> (which allows for the
351     mousewheel (if applicable) to be used).
352     </p>
353    
354     <pre caption="Changing the mouse settings in Xorg">
355     Section "InputDevice"
356     Identifier "TouchPad Mouse"
357     Driver "mouse"
358     Option "CorePointer"
359     <i>Option "Device" "/dev/psaux"</i>
360     <i>Option "Protocol" "IMPS/2"</i>
361     <i>Option "ZAxisMapping" "4 5"</i>
362     EndSection
363     </pre>
364    
365     <p>
366     Run <c>startx</c> and be happy about the result :) Congratulations, you now
367     (hopefully) have a working Xorg on your system. The next step is to remove this
368     ugly lightweight window manager and use a high-feature one (or even a desktop
369     environment) such as KDE or GNOME, but that's not part of this guide :)
370     </p>
371    
372     </body>
373     </section>
374     </chapter>
375     <chapter>
376     <title>Resources</title>
377     <section>
378     <title>Creating and Tweaking xorg.conf</title>
379     <body>
380    
381     <p>
382     First of all, <c>man 5 xorg.conf</c> provides a quick yet complete reference
383     about the syntaxis used by the configuration file. Be sure to have it open on a
384     terminal near you when you edit your configuration file!
385     </p>
386    
387     <p>
388     A second point of resources on your system is the
389     <path>/usr/X11R6/lib/X11/doc</path> directory with various <path>README</path>'s
390     for individual graphical chipsets.
391     </p>
392    
393     <p>
394     There are also many online resources on editing <path>xorg.conf</path>. We only
395     list few of them here, be sure to <uri link="http://www.google.com">Google</uri>
396     for more :) As <path>xorg.conf</path> and <path>XF86Config</path> (the
397     configuration file for the XFree86 project) use the
398     same syntaxis for most configuration options and more information about
399     <path>XF86Config</path> is available, we'll list those resources as well.
400     </p>
401    
402     <ul>
403     <li>
404     <uri link="http://tldp.org/HOWTO/XFree-Local-multi-user-HOWTO/">The XFree
405     Local Multi-User HOWTO</uri>
406     </li>
407     <li>
408     <uri
409     link="http://www-106.ibm.com/developerworks/edu/os-dw-linuxxwin-i.html">An
410     Introduction to XFree 4.x</uri> by Chris Houser
411     </li>
412     </ul>
413    
414     </body>
415     </section>
416     </chapter>
417     </guide>

  ViewVC Help
Powered by ViewVC 1.1.20