summaryrefslogtreecommitdiffstats
path: root/chapter_07.xml
blob: 4bb9c3c116da11a8d20bb0eec142c715ba7c36f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "/usr/share/xml/docbook/xml-dtd-4.5/docbookx.dtd">

<chapter>
<title>The X Window System</title>

<section>
<title>What Is (And Isn't) X</title>

<para>
Eons ago computer terminals came with a screen and a keyboard and not
much else. Mice hadn't come into common use and everything was menu
driven. Then came the Graphical User Interface (GUI) and the world was
changed. Today users are accustomed to moving a mouse around a screen,
clicking on icons and running tasks with fancy images and animation,
but UNIX systems predated this and so GUIs were added almost as an
afterthought. For many years, Linux and its UNIX brethren were
primarily used without graphics of any sort, but today it is perhaps
more common than not for users to prefer their Linux computers come
with shiney, flashy, clickable GUIs, and all these GUIs run on
<application>X</application>(7).
</para>

<para>
So what is X? Is it the desktop with the icons? Is it the menus? Is it
the window manager? Does it mark the spot? The answer to all these is a
resounding "no". There are many parts to a GUI, but X is the most
fundamental. X is that application that receives input from the mouse,
keyboard, and possibly other devices. X is that application that tells
the graphics card what to do. In short, X is the application that talks
to your computer's hardware for graphical purposes; all other
graphical applications simply talk to X.
</para>

<para>
Let's stop for a moment and talk about nomenclature. X is just one of a
dozen names that you may encounter. It is also called X11, xorg, the X Window
System, X Window, X11R6, X Version 11, and several others. Whatever
you hear it called, simply understand that the speakers are referring
to X.
</para>

</section>

<section>
<title>Configuring the X Server</title>

<para>
Once upon a time, configuring X was a difficult and painful process
that caused the magic smoke to come gushing out of hundreds of
monitors. Today X is a lot more user friendly. In fact, most users will
not need to configure X at all, Slackware will simply figure out all
the proper settings on its own. There are, however, still some
computers that X can't properly auto-configure and will need a little
bit of work on your part.
</para>

<para>
Once upon a time, the X configuration file was located at
<filename>/etc/X11/xorg.conf</filename>, and if you create a file
there, X will honor whatever settings you place within it.
Fortunately, with <application>X.Org 1.6.3</application> an
<filename>/etc/X11/xorg.conf</filename> does not even need to be
present for <application>X</application> to generate a working display.
If for whatever reason, you need to make configuration changes to X,
try to avoid using this file; it's antiquated and inflexible. Rather,
the <filename>/etc/X11/xorg.conf.d/</filename> directory is where you
should put such tweaks. Any file you place within that directory will
be read when X starts up. This allows you to split-up your
configuration into more easily manageable parts. For example, here's
my <filename>/etc/X11/xorg.conf.d/synaptics.conf</filename> file for my
laptop.
</para>

<screen><prompt>darkstar:~$ </prompt><userinput>cat /etc/X11/xorg.conf.d/synaptics.conf</userinput>
Section "InputDevice"
    Identifier      "Synaptics Touchpad"
    Driver          "synaptics"
    Option          "SendCoreEvents"        "true"
    Option          "Device"                "/dev/psaux"
    Option          "Protocol"              "auto-dev"
    Option          "SHMConfig"             "on"
    Option          "LeftEdge"              "100"
    Option          "RightEdge"             "1120"
    Option          "TopEdge"               "50"
    Option          "BottomEdge"            "310"
    Option          "FingerLow"             "25"
    Option          "FingerHigh"            "30"
    Option          "VertScrollDelta"       "20"
    Option          "HorizScrollDelta"      "50"
    Option          "MinSpeed"              "0.79"
    Option          "MaxSpeed"              "0.88"
    Option          "AccelFactor"           "0.0015"
    Option          "TapButton1"            "1"
    Option          "TapButton2"            "2"
    Option          "TapButton3"            "3"
    Option          "MaxTapMove"            "100"
    Option          "HorizScrollDelta"      "0"
    Option          "HorizEdgeScroll"       "0"
    Option          "VertEdgeScroll"        "1"
    Option          "VertTwoFingerScroll"   "0"
EndSection
</screen>

<para>
By placing such options in individual files, you can easily manage your
X configuration by sections.
</para>

</section>

<section>
<title>Choosing a Window Manager</title>

<para>
Slackware Linux includes many different window managers and desktop
environments. Window managers are the applications responsible for
painting application windows on the screen, resizing these windows, and
similar tasks. Desktop environments include a window manager, but also
add task bars, menus, icons, and more. Slackware includes both the KDE
and XFCE desktop environments and several additional window managers.
Which you use is entirely your own decision, but in general, window
managers tend to be faster than desktop environments and more suitable
to older systems with less memory and slower processors. Desktop
environments will be more comfortable for users accustomed to Microsoft
Windows.
</para>

<para>
The easiest way to choose a window manager is
<application>xwmconfig</application>(1), included with Slackware Linux.
This application allows a user to choose what window manager to run
with <application>startx</application>. 
</para>

<imagedata fileref="img/xwmconfig.png" format="PNG"/>

</section>

<section>
<title>Setting Up A Graphical Login</title>

<para>
By default, when you boot your Slackware Linux system you are presented
with a login prompt on a virtual terminal. This is more than adequate
for most people's needs. If you need to run commandline applications,
you may login and do so right away. If you want to run X, simply executing
<application>startx</application> will do that for you nicely.
But suppose you almost exclusively
use your system for graphical duties like many laptop owners? Wouldn't
it be nice for Slackware to take you straight into a GUI? Fortunately,
there's an easy way to do just that.
</para>

<para>
Slackware uses the System V init system which allows the administrator
to boot into or change to different runlevels, which are really just
different "states" the computer can be in. In fact, shutting down the
computer is really only a case of changing to a runlevel which
accomplishes just that. Runlevels can be rather complicated, so we
won't delve into them any further than necessary.
</para>

<para>
Runlevels are configured in <filename>inittab</filename>(5).
The most common ones are
runlevel 3 (Slackware's default) and runlevel 4 (GUI). In order to tell
Slackware to boot to a GUI screen, simply open
<filename>/etc/inittab</filename> with your
favorite editor of choice. (You may wish to refer to one of the
chapters on <application>vi</application> or
<application>emacs</application> at this point.) Near the top, you'll
see the relevant entries. 
</para>

<screen>
# These are the default runlevels in Slackware:
#   0 = halt
#   1 = single user mode
#   2 = unused (but configured the same as runlevel 3)
#   3 = multiuser mode (default Slackware runlevel)
#   4 = X11 with KDM/GDM/XDM (session managers)
#   5 = unused (but configured the same as runlevel 3)
#   6 = reboot

# Default runlevel. (Do not set to 0 or 6)
id:3:initdefault:
</screen>

<para>
In this file (along with most configuration files) anything following a
hash symbol # is a comment and not interpreted by init(8). Don't worry
if you don't understand everything about inittab, as many veteran users
don't either. The only line we are interested in is the last on above.
Simply change the 3 to a 4 and reboot.
</para>

<screen>
# These are the default runlevels in Slackware:
#   0 = halt
#   1 = single user mode
#   2 = unused (but configured the same as runlevel 3)
#   3 = multiuser mode (default Slackware runlevel)
#   4 = X11 with KDM/GDM/XDM (session managers)
#   5 = unused (but configured the same as runlevel 3)
#   6 = reboot

# Default runlevel. (Do not set to 0 or 6)
id:4:initdefault:
</screen>

</section>

</chapter>