/[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.10 - (hide annotations) (download) (as text)
Sat Apr 9 11:30:48 2005 UTC (9 years, 8 months ago) by swift
Branch: MAIN
Changes since 1.9: +13 -3 lines
File MIME type: application/xml
Add info on xorgcfg

1 swift 1.1 <?xml version='1.0' encoding='UTF-8'?>
2    
3 swift 1.10 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/xorg-config.xml,v 1.9 2005/03/25 15:55:32 swift Exp $ -->
4 swift 1.1
5     <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
6    
7 swift 1.7 <guide link="xorg-config.xml">
8 swift 1.1
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 swift 1.7 <!-- See http://creativecommons.org/licenses/by-sa/2.0 -->
23 swift 1.1 <license/>
24    
25 swift 1.10 <version>1.9</version>
26     <date>2005-04-09</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 swift 1.8 compatible with the GPL license; the use of Xorg is therefore recommended.
62     The official Portage tree does not provide an XFree86 package anymore.
63 swift 1.1 </p>
64    
65     </body>
66     </section>
67     <section>
68     <title>The X.org Project</title>
69     <body>
70    
71     <p>
72     The <uri link="http://www.x.org">X.org</uri> project created and
73     maintains a freely redistributable open-source implementation of the X11 system.
74     It is an open source X11-based desktop infrastructure.
75     </p>
76    
77     <p>
78     Xorg provides an interface between your hardware and the graphical software
79     you want to run. Besides that, Xorg is also fully network-aware, meaning you
80     are able to run an application on one system while viewing it on a different
81     one.
82     </p>
83    
84     </body>
85     </section>
86     </chapter>
87     <chapter>
88     <title>Installing Xorg</title>
89     <section>
90     <title>Using emerge</title>
91     <body>
92    
93     <p>
94     Enough chitchat, let's get to business shall we? To install Xorg, you just
95     need to run <c>emerge xorg-x11</c>. Installing Xorg does take a while
96     though, so you might want to grab a snack while you are waiting.
97     </p>
98    
99     <pre caption="Installing Xorg">
100     # <i>emerge xorg-x11</i>
101     </pre>
102    
103     <p>
104     When the installation is finished, you might need to reinitialise some
105     environment variables before you continue. Just run <c>env-update</c> followed
106     by <c>source /etc/profile</c> and you're all set. This doesn't harm your system
107     in any way.
108     </p>
109    
110     <pre caption="Reinitialising the environment variables">
111     # <i>env-update</i>
112     # <i>source /etc/profile</i>
113     </pre>
114    
115     </body>
116     </section>
117     </chapter>
118     <chapter>
119     <title>Configuring Xorg</title>
120     <section>
121     <title>The xorg.conf File</title>
122     <body>
123    
124     <p>
125 neysx 1.2 The configuration file of Xorg is called <path>xorg.conf</path> and it
126 swift 1.1 resides in <path>/etc/X11</path>. The Xorg-X11 package provides an example
127     configuration as <path>/etc/X11/xorg.conf.example</path> which you can use to
128     create your own configuration. It is heavily commented, but if you are in need
129     of more documentation regarding the syntax, don't hesitate to read the man page:
130     </p>
131    
132     <pre caption="Reading the xorg.conf man page">
133     # <i>man 5 xorg.conf</i>
134     </pre>
135    
136     <p>
137     Happy reading for those of you willing to. We surely don't so we'll continue
138     with checking out how we can create the file automatically.
139     </p>
140    
141     </body>
142     </section>
143     <section>
144     <title>Default: Automatic Generation of xorg.conf</title>
145     <body>
146    
147     <p>
148     Xorg itself is able to guess most parameters for you. In most cases, you
149     will only have to change some lines to get the resolution you want up and
150     running. If you are interested in more in-depth tweaking, be sure to check the
151     resources at the end of this chapter. But first, let us generate a (hopefully
152     working) Xorg configuration file.
153     </p>
154    
155     <pre caption="Generating an xorg.conf file">
156     # <i>Xorg -configure</i>
157     </pre>
158    
159     <p>
160     Be sure to read the last lines printed on your screen when Xorg has finished
161     probing your hardware. If it tells you it failed at some point, you're forced to
162     manually write an <path>xorg.conf</path> file. Assuming that it didn't fail, it
163     will have told you that it has written <path>/root/xorg.conf.new</path> ready
164     for you to test. So let's test :)
165     </p>
166    
167     <pre caption="Testing the xorg.conf.new file">
168 swift 1.6 # <i>X -config /root/xorg.conf.new</i>
169 swift 1.1 </pre>
170    
171     <p>
172 swift 1.9 If all goes well, you should see a simple black and white pattern. Verify if
173     your mouse works correctly and if the resolution is good. You might not be able
174     to deduce the exact resolution, but you should be able to see if it's too low.
175     You can exit any time by pressing Ctrl-Alt-Backspace.
176 swift 1.7 </p>
177    
178 swift 1.1 </body>
179     </section>
180     <section>
181     <title>Alternative: Semi-Automatic Generation of xorg.conf</title>
182     <body>
183    
184     <p>
185     Xorg provides a tool called <c>xorgconfig</c> which will ask you for various
186     information regarding your system (graphical adapter, keyboard, ...). Based on
187     your input it will create a <path>xorg.conf</path> file.
188     </p>
189    
190     <pre caption="Semi-Automatic Generation of xorg.conf">
191     # <i>xorgconfig</i>
192     </pre>
193    
194 swift 1.10 <p>
195     Another tool, also provided by Xorg, is <c>xorgcfg</c>, which will first
196     attempts to run <c>Xorg -configure</c> and then start the X server for more
197     final tweaking.
198     </p>
199    
200     <pre caption="Using xorgcfg">
201     # <i>xorgcfg</i>
202     </pre>
203    
204 swift 1.1 </body>
205     </section>
206     <section>
207     <title>Copying over xorg.conf</title>
208     <body>
209    
210     <p>
211 swift 1.9 Let us copy over the <path>xorg.conf.new</path> to
212     <path>/etc/X11/xorg.conf</path> now, so we won't have to continuously run
213     <c>X -config</c> -- typing just <c>X</c> or <c>startx</c> is far more easy :)
214 swift 1.1 </p>
215    
216     <pre caption="Copying over xorg.conf">
217     # <i>cp /root/xorg.conf.new /etc/X11/xorg.conf</i>
218     </pre>
219    
220 swift 1.9 </body>
221     </section>
222     <section id="using_startx">
223     <title>Using startx</title>
224     <body>
225    
226 swift 1.1 <p>
227 swift 1.9 Now try <c>startx</c> to start up your X server. <c>startx</c> is a script
228     that executes an <e>X session</e>, that is, it starts the X servers and some
229     graphical applications on top of it. It decides which applications to run
230     using the following logic:
231 swift 1.1 </p>
232    
233 swift 1.9 <ul>
234     <li>
235     If a file named <path>.xinitrc</path> exists in the home directory, it will
236     execute the commands listed there.
237     </li>
238     <li>
239     Otherwise, it will read the value of the XSESSION variable and will execute
240     one of the sessions available in <path>/etc/X11/Sessions/</path>
241     accordingly (you can set the value of XSESSION in <path>/etc/rc.conf</path>
242     to make it a default for all the users on the system).
243     </li>
244     <li>
245     If all of the above fail, it will fall back to a simple window manager,
246     usually <c>twm</c>.
247     </li>
248     </ul>
249    
250 swift 1.1 <pre caption="Starting X">
251     # <i>startx</i>
252     </pre>
253    
254 swift 1.9 <p>
255     If you see an ugly, loathsome, repulsive, deformed window manager, that's
256     <c>twm</c>. To finish the twm session, type in <c>exit</c> or Ctrl-D in the
257     upcoming xterms. You can also kill the X session using the Ctrl-Alt-Backspace
258     combination. This will however make X exit disgracefully - something that you
259     might not always want. It doesn't hurt though :)
260     </p>
261    
262 swift 1.1 </body>
263     </section>
264 swift 1.9 </chapter>
265     <chapter>
266     <title>Tweaking xorg.conf</title>
267 swift 1.1 <section>
268     <title>Setting your Resolution</title>
269     <body>
270    
271     <p>
272     If you feel that the screen resolution is wrong, you will need to check two
273     sections in your configuration. First of all, you have the <e>Screen</e> section
274     which lists the resolutions - if any - that your X server will run at. By
275     default, this section might not list any resolutions at all. If this is the
276     case, Xorg will estimate the resolutions based on the information in the
277     second section, <e>Monitor</e>.
278     </p>
279    
280     <p>
281     What happens is that Xorg checks the settings of <c>HorizSync</c> and
282     <c>VertRefresh</c> in the <e>Monitor</e> section to compute valid resolutions.
283     For now, leave these settings as-is. Only when the changes to the <e>Screen</e>
284     section (which we will describe in a minute) don't work, then you will need to
285     look up the specs for your monitor and fill in the correct values. You can also
286     use a tool that searches for your monitor's specs, such as
287     <c>sys-apps/ddcxinfo-knoppix</c>.
288     </p>
289    
290     <warn>
291     Do <b>not</b> "just" change the values of these two monitor-related variables
292     without consulting the technical specifications of your monitor. Setting
293     incorrect values lead to out-of-sync errors at best and smoked up screens at
294     worst.
295     </warn>
296    
297     <p>
298     Now let us change the resolutions. In the next example from
299     <path>/etc/X11/xorg.conf</path> we add the <c>Modes</c> lines and the
300     <c>DefaultDepth</c> so that our X server starts with 24 bits at 1024x768 by
301     default. Don't mind the given strings - they are examples and will most likely
302     differ from the settings on your system.
303     </p>
304    
305     <pre caption="Changing the Screen section in /etc/X11/xorg.conf">
306     Section "Screen"
307     Identifier "Default Screen"
308     Device "S3 Inc. ProSavage KN133 [Twister K]"
309     Monitor "Generic Monitor"
310     <i>DefaultDepth 24</i>
311     <comment># Skipping some text to improve readability</comment>
312     SubSection "Display"
313     Depth 24
314     <i>Modes "1024x768"</i>
315     EndSubSection
316     EndSection
317     </pre>
318    
319     <p>
320     Run X (<c>startx</c>) to discover it uses the resolution you want :)
321     </p>
322    
323     </body>
324     </section>
325     <section>
326     <title>Configuring your Keyboard</title>
327     <body>
328    
329     <p>
330     To setup X to use an international keyboard, search for the <e>InputDevice</e>
331     section that configures the keyboard and add the <c>XkbLayout</c> option to
332     point to the keyboard layout you want. As an example, we show you how to apply
333     for the Belgian layout. Just substitute the country-keycode with yours:
334     </p>
335    
336     <pre caption="Changing the keyboard layout">
337     Section "InputDevice"
338     Identifier "Generic Keyboard"
339     Driver "keyboard"
340     Option "CoreKeyboard"
341 swift 1.3 Option "XkbRules" "xorg"
342 swift 1.1 Option "XkbModel" "pc105"
343     <i>Option "XkbLayout" "be"</i>
344     EndSection
345     </pre>
346    
347     </body>
348     </section>
349     <section>
350     <title>Configuring your Mouse</title>
351     <body>
352    
353     <p>
354     If your mouse isn't working, you will first need to find out if it is detected
355 neysx 1.2 by the kernel at all. PS/2 mice are (device-wise) seen as
356     <path>/dev/psaux</path>. Other mice (like USBs) are seen as
357 swift 1.1 <path>/dev/input</path> (or <path>/dev/input/mice</path>). In either case you
358     can check if the devices do represent your mouse by checking the output of those
359     files when you move your mouse. To end the session press <c>Ctrl-C</c>.
360     </p>
361    
362     <pre caption="Checking the device files">
363     # <i>cat /dev/input</i>
364     <comment>(Don't forget to press Ctrl-C to end this)</comment>
365     </pre>
366    
367     <p>
368     If your mouse isn't detected, verify if all the necessary modules are loaded.
369     </p>
370    
371     <p>
372     If your mouse is detected, fill in the device in the appropriate
373     <e>InputDevice</e> section. In the next example you'll see we also set two other
374     options: <c>Protocol</c> (which lists the mouse protocol to be used - most users
375     will use PS/2 or IMPS/2) and <c>ZAxisMapping</c> (which allows for the
376     mousewheel (if applicable) to be used).
377     </p>
378    
379     <pre caption="Changing the mouse settings in Xorg">
380     Section "InputDevice"
381     Identifier "TouchPad Mouse"
382     Driver "mouse"
383     Option "CorePointer"
384     <i>Option "Device" "/dev/psaux"</i>
385     <i>Option "Protocol" "IMPS/2"</i>
386     <i>Option "ZAxisMapping" "4 5"</i>
387     EndSection
388     </pre>
389    
390     <p>
391     Run <c>startx</c> and be happy about the result :) Congratulations, you now
392     (hopefully) have a working Xorg on your system. The next step is to remove this
393     ugly lightweight window manager and use a high-feature one (or even a desktop
394     environment) such as KDE or GNOME, but that's not part of this guide :)
395     </p>
396    
397     </body>
398     </section>
399     </chapter>
400     <chapter>
401     <title>Resources</title>
402     <section>
403     <title>Creating and Tweaking xorg.conf</title>
404     <body>
405    
406     <p>
407     First of all, <c>man 5 xorg.conf</c> provides a quick yet complete reference
408     about the syntaxis used by the configuration file. Be sure to have it open on a
409     terminal near you when you edit your configuration file!
410     </p>
411    
412     <p>
413     A second point of resources on your system is the
414     <path>/usr/X11R6/lib/X11/doc</path> directory with various <path>README</path>'s
415     for individual graphical chipsets.
416     </p>
417    
418     <p>
419     There are also many online resources on editing <path>xorg.conf</path>. We only
420     list few of them here, be sure to <uri link="http://www.google.com">Google</uri>
421     for more :) As <path>xorg.conf</path> and <path>XF86Config</path> (the
422     configuration file for the XFree86 project) use the
423     same syntaxis for most configuration options and more information about
424     <path>XF86Config</path> is available, we'll list those resources as well.
425     </p>
426    
427     <ul>
428     <li>
429     <uri link="http://tldp.org/HOWTO/XFree-Local-multi-user-HOWTO/">The XFree
430     Local Multi-User HOWTO</uri>
431     </li>
432     <li>
433     <uri
434     link="http://www-106.ibm.com/developerworks/edu/os-dw-linuxxwin-i.html">An
435     Introduction to XFree 4.x</uri> by Chris Houser
436     </li>
437     </ul>
438    
439     </body>
440     </section>
441     </chapter>
442     </guide>

  ViewVC Help
Powered by ViewVC 1.1.20