old-www/LDP/intro-linux/html/sect_07_03.html

494 lines
12 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>The graphical environment</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Introduction to Linux"
HREF="index.html"><LINK
REL="UP"
TITLE="Home sweet /home"
HREF="chap_07.html"><LINK
REL="PREVIOUS"
TITLE="Your text environment"
HREF="sect_07_02.html"><LINK
REL="NEXT"
TITLE="Region specific settings"
HREF="sect_07_05.html"></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"
>Introduction to Linux: </TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sect_07_02.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 7. Home sweet /home</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sect_07_05.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="sect_07_03"
></A
>7.3. The graphical environment</H1
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="sect_07_03_01"
></A
>7.3.1. Introduction</H2
><P
>The average user may not care too much about his login settings, but Linux offers a wide variety of flashy window and desktop managers for use under X, the graphical environment. The use and configuration of window managers and desktops is straightforward and may even resemble the standard MS Windows, Apple or UNIX CDE environment, although many Linux users prefer flashier desktops and fancier window managers. We won't discuss the user specific configuration here. Just experiment and read the documentation using the built-in Help functions these managers provide and you will get along fine.</P
><P
>We will, however, take a closer look at the underlying system.</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="sect_07_03_02"
></A
>7.3.2. The X Window System</H2
><P
>The X Window System is a network-transparent window system which runs on a wide range of computing and graphics machines. X Window System servers run on computers with bitmap displays. The X server distributes user input to and accepts output requests from several client programs through a variety of different interprocess communication channels. Although the most common case is for the client programs to be running on the same machine as the server, clients can be run transparently from other machines (including machines with different architectures and operating systems) as well. We will learn how to do this in <A
HREF="chap_10.html"
>Chapter 10</A
> on networking and remote applications.</P
><P
>X supports overlapping hierarchical sub-windows and text and graphics operations, on both monochrome and color displays. The number of X client programs that use the X server is quite large. Some of the programs provided in the core X Consortium distribution include:</P
><P
></P
><UL
><LI
><P
><B
CLASS="command"
>xterm</B
>: a terminal emulator</P
></LI
><LI
><P
><B
CLASS="command"
>twm</B
>: a minimalistic window manager</P
></LI
><LI
><P
><B
CLASS="command"
>xdm</B
>: a display manager</P
></LI
><LI
><P
><B
CLASS="command"
>xconsole</B
>: a console redirect program</P
></LI
><LI
><P
><B
CLASS="command"
>bitmap</B
>: a bitmap editor</P
></LI
><LI
><P
><B
CLASS="command"
>xauth</B
>, <B
CLASS="command"
>xhost</B
> and <B
CLASS="command"
>iceauth</B
>: access control programs</P
></LI
><LI
><P
><B
CLASS="command"
>xset</B
>, <B
CLASS="command"
>xmodmap</B
> and many others: user preference setting programs</P
></LI
><LI
><P
><B
CLASS="command"
>xclock</B
>: a clock</P
></LI
><LI
><P
><B
CLASS="command"
>xlsfonts</B
> and others: a font displayer, utilities for listing information about fonts, windows and displays</P
></LI
><LI
><P
><B
CLASS="command"
>xfs</B
>: a font server</P
></LI
><LI
><P
>...</P
></LI
></UL
><P
>We refer again to the man pages of these commands for detailed information. More explanations on available functions can be found in the <EM
>Xlib - C language X Interface</EM
> manual that comes with your X distribution, the <EM
>X Window System Protocol</EM
> specification, and the various manuals and documentation of X toolkits. The <TT
CLASS="filename"
>/usr/share/doc</TT
> directory contains references to these documents and many others.</P
><P
>Many other utilities, window managers, games, toolkits and gadgets are included as user-contributed software in the X Consortium distribution, or are available using anonymous FTP on the Internet. Good places to start are <A
HREF="http://www.x.org"
TARGET="_top"
>http://www.x.org</A
> and <A
HREF="http://www.xfree.org"
TARGET="_top"
>http://www.xfree.org</A
>.</P
><P
>Furthermore, all your graphical applications, such as your browser, your E-mail program, your image viewing programs, sound playing tools and so on, are all clients to your X server. Note that in normal operation, that is in graphical mode, X clients and the X server on Linux run on the same machine.</P
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="sect_07_03_02_01"
></A
>7.3.2.1. Display names</H3
><P
>From the user's perspective, every X server has a <EM
>display name</EM
> in the form of:</P
><P
><B
CLASS="command"
><TT
CLASS="parameter"
><I
>hostname</I
></TT
>:<TT
CLASS="parameter"
><I
>displaynumber</I
></TT
>.<TT
CLASS="parameter"
><I
>screennumber</I
></TT
></B
> </P
><P
>This information is used by the application to determine how it should connect to the X server and which screen it should use by default (on displays with multiple monitors):</P
><P
></P
><UL
><LI
><P
><EM
>hostname</EM
>: The host name specifies the name of the client machine to which the display is physically connected. If the host name is not given, the most efficient way of communicating to a server on the same machine will be used.</P
></LI
><LI
><P
><EM
>displaynumber</EM
>: The phrase <SPAN
CLASS="QUOTE"
>"display"</SPAN
> is usually used to refer to a collection of monitors that share a common key board and pointer (mouse, tablet, etc.). Most workstations tend to only have one keyboard, and therefore, only one display. Larger, multi-user systems, however, frequently have several displays so that more than one person can be doing graphics work at once. To avoid confusion, each display on a machine is assigned a <EM
>display number</EM
> (beginning at 0) when the X server for that display is started. The display number must always be given in a display name.</P
></LI
><LI
><P
><EM
>screen number</EM
>: Some displays share a single keyboard and pointer among two or more monitors. Since each monitor has its own set of windows, each screen is assigned a <EM
>screen number</EM
> (beginning at 0) when the X server for that display is started. If the screen number is not given, screen 0 will be used.</P
></LI
></UL
><P
>On POSIX systems, the default display name is stored in your <TT
CLASS="varname"
>DISPLAY</TT
> environment variable. This variable is set automatically by the <B
CLASS="command"
>xterm</B
> terminal emulator. However, when you log into another machine on a network, you might need to set <TT
CLASS="varname"
>DISPLAY</TT
> by hand to point to your display, see <A
HREF="sect_10_05.html#sect_10_05_03_02"
>Section 10.4.3.2</A
>.</P
><P
>More information can be found in the X man pages.</P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="sect_07_03_02_02"
></A
>7.3.2.2. Window and desktop managers</H3
><P
>The layout of windows on the screen is controlled by special programs called <EM
>window managers</EM
>. Although many window managers will honor geometry specifications as given, others may choose to ignore them (requiring the user to explicitly draw the window's region on the screen with the pointer, for example).</P
><P
>Since window managers are regular (albeit complex) client programs, a variety of different user interfaces can be built. The X Consortium distribution comes with a window manager named <B
CLASS="command"
>twm</B
>, but most users prefer something more fancy when system resources permit. Sawfish and Enlightenment are popular examples which allow each user to have a desktop according to mood and style.</P
><P
>A desktop manager makes use of one window manager or another for arranging your graphical desktop in a convenient way, with menubars, drop-down menus, informative messages, a clock, a program manager, a file manager and so on. Among the most popular desktop managers are <SPAN
CLASS="application"
>Gnome</SPAN
> and <SPAN
CLASS="application"
>KDE</SPAN
>, which both run on almost any Linux distribution and many other UNIX systems.</P
><DIV
CLASS="tip"
><P
></P
><TABLE
CLASS="tip"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="../images/tip.gif"
HSPACE="5"
ALT="Tip"></TD
><TH
ALIGN="LEFT"
VALIGN="CENTER"
><B
>KDE applications in Gnome/Gnome applications in KDE</B
></TH
></TR
><TR
><TD
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>You don't need to start your desktop in <SPAN
CLASS="application"
>KDE</SPAN
> in order to be able to run <SPAN
CLASS="application"
>KDE</SPAN
> applications. If you have the <SPAN
CLASS="application"
>KDE</SPAN
> libraries installed (the <SPAN
CLASS="application"
>kdelibs</SPAN
> package), you can run these applications from the <SPAN
CLASS="application"
>Gnome</SPAN
> menus or start them from a <SPAN
CLASS="application"
>Gnome</SPAN
> terminal.</P
><P
>Running <SPAN
CLASS="application"
>Gnome</SPAN
> applications in a <SPAN
CLASS="application"
>KDE</SPAN
> environment is a bit more tricky, because there is no single set of base-libraries in <SPAN
CLASS="application"
>Gnome</SPAN
>. However, the dependencies and thus extra packages you might have to install will become clear when running or installing such an application.</P
></TD
></TR
></TABLE
></DIV
></DIV
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="sect_07_03_03"
></A
>7.3.3. X server configuration</H2
><P
>The X distribution that used to come with Linux, <EM
>XFree86</EM
>, uses the configuration file <TT
CLASS="filename"
>XF86Config</TT
> for its initial setup. This file configures your video card and is searched for in a number of locations, although it is usually in <TT
CLASS="filename"
>/etc/X11</TT
>.</P
><P
>If you see that the file <TT
CLASS="filename"
>/etc/X11/XF86Config</TT
> is present on your system, a full description can be found in the <SPAN
CLASS="application"
>Info</SPAN
> or man pages about <TT
CLASS="filename"
>XF86Config</TT
>.</P
><P
>Because of licensing issues with XFree86, newer systems usually come with the <EM
>X.Org</EM
> distribution of the X server and tools. The main configuration file here is <TT
CLASS="filename"
>xorg.conf</TT
>, usually also in <TT
CLASS="filename"
>/etc/X11</TT
>. The file consists of a number of sections that may occur in any order. The sections contain information about your monitor, your video adaptor, the screen configuration, your keyboard etcetera. As a user, you needn't worry too much about what is in this file, since everything is normally determined at the time the system is installed.</P
><P
>Should you need to change graphical server settings, however, you can run the configuration tools or edit the configuration files that set up the infrastructure to use the XFree86 server. See the man pages for more information; your distribution might have its own tools. Since misconfiguration may result in unreadable garbage in graphical mode, you may want to make a backup copy of the configuration file before attempting to change it, just to be on the safe side.</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sect_07_02.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sect_07_05.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Your text environment</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="chap_07.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Region specific settings</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>