--- doc/en/books/handbook/x11/chapter.sgml 2006/07/14 20:30:27 1.8 +++ doc/en/books/handbook/x11/chapter.sgml 2006/08/09 03:52:13 1.9 @@ -1,31 +1,56 @@ + + + + Ken + Tom + Updated for X.Org's X11 server by + + + Marc + Fonvieille + + + + + Víctor + Balada Díaz + Updated for DragonFly by + + + + The X Window System Synopsis - &os; uses &xfree86; to provide users with - a powerful graphical user interface. &xfree86; - is an open-source implementation of the X Window System. This chapter - will cover installation and configuration of - &xfree86; on a &os; system. For more - information on &xfree86; and video hardware that - it supports, check the &xfree86; web site. - - - This chapter contains a number of outdated - references to the FreeBSD ports collection. Most instructions - still apply to pkgsrc, but proceed with caution until this - chapter is updated. - + &os; uses X11 to provide users with + a powerful graphical user interface. X11 + is an open-source implementation of the X Window System that + includes both &xorg; and + &xfree86;. &os; default official + flavor is &xorg;, the X11 + server developed by the X.Org Foundation. + + This chapter will cover the installation and configuration + of X11 with emphasis on + &xorg;. + + For more information on the video hardware that X11 + supports, check either the &xorg; or &xfree86; web + sites. After reading this chapter, you will know: @@ -36,8 +61,7 @@ - How to install and configure - &xfree86;. + How to install and configure X11. @@ -45,8 +69,7 @@ - How to use &truetype; fonts in - &xfree86;. + How to use &truetype; fonts in X11. @@ -61,6 +84,17 @@ Know how to install additional third-party software (). + + + This chapter covers the installation and the configuration + of both &xorg; and + &xfree86; X11 servers. For the most + part, configuration files, commands and syntaxes are identical. + In the case where there are differences, both + &xorg; and + &xfree86; syntaxes will be + shown. + @@ -70,32 +104,35 @@ familiar with other graphical environments, such as µsoft.windows; or &macos;. - It is not necessary to understand all of the details of various - X components and how they interact; however, some basic knowledge makes + While it is not necessary to understand all of the details of various + X components and how they interact, some basic knowledge makes it possible to take advantage of X's strengths. Why X? X is not the first window system written for &unix;, but it is the - most popular. X's original development team had worked on another - window system before writing X. That system's name was - W (for Window). X is just the next + most popular of them. X's original development team had worked on another + window system prior to writing X. That system's name was + W (for Window). X was just the next letter in the Roman alphabet. X can be called X, X Window System, - X11, and other terms. Calling X11 - X Windows can offend some people; - see &man.X.7; for a bit more insight on this. + X11, and a number of other terms. You may find + that using the term X Windows to describe X11 + can be offensive to some people; for a bit more insight on + this, see &man.X.7;. The X Client/Server Model X was designed from the beginning to be network-centric, and - adopts a client-server model. In the X model, the + adopts a client-server model. + + In the X model, the X server runs on the computer that has the keyboard, - monitor, and mouse attached. The server is responsible for managing + monitor, and mouse attached. The server's responsibility includes tasks such as managing the display, handling input from the keyboard and mouse, and so on. Each X application (such as XTerm, or &netscape;) is a client. A @@ -104,8 +141,8 @@ messages such as The user just clicked on the OK button. - If there is only one computer involved, such as in a home or small - office environment, the X server and the X clients will be running on + In a home or small + office environment, the X server and the X clients commonly run on the same computer. However, it is perfectly possible to run the X server on a less powerful desktop computer, and run X applications (the clients) on, say, the powerful and expensive machine that serves @@ -117,7 +154,7 @@ server to be the big powerful machine down the hall, and the X client to be the machine on their desk. - Remember that the X server is the machine with the monitor and + It is important to remember that the X server is the machine with the monitor and keyboard, and the X clients are the programs that display the windows. @@ -128,11 +165,10 @@ various free and commercial applications available that do exactly that. - The X server that ships with &os; is called - &xfree86;, and is available for free, under a - license very similar to the &os; license. Commercial X servers for - FreeBSD are also available, and ought to work with &os; . - (Unconfirmed as of this writing.) + &os; will use by default + &xorg; + server. &xorg; is available for + free, under a license very similar to the DragonFly license. @@ -168,7 +204,7 @@ button or similar device; some are themeable, allowing a complete change of look-and-feel by applying a new theme. These window managers, and many more, are available in the - wm category of &pkgsrc;. + x11-wm category of the Ports Collection. In addition, the KDE and GNOME desktop environments both have their @@ -177,7 +213,7 @@ Each window manager also has a different configuration mechanism; some expect configuration file written by hand, others feature GUI tools for most of the configuration tasks; at least one - (sawfish) has a configuration file written + (Sawfish) has a configuration file written in a dialect of the Lisp language. @@ -272,7 +308,7 @@ Most newer X applications today will use a modern-looking widget set, either Qt, used by KDE, or - GTK, used by the + GTK+, used by the GNOME project. In this respect, there is some convergence in look-and-feel of the &unix; desktop, which certainly makes things @@ -281,41 +317,67 @@ - Installing &xfree86; + Installing X11 - - This section is out of date; please consult the - DragonFly BSD wiki or mailing lists for recent discussion. - - - - A binary - package to use with &man.pkg.add.1; tool is also available for - &xfree86; 4.X. When the remote fetching - feature of &man.pkg.add.1; is used, the version number of the - package must be removed. &man.pkg.add.1; will automatically fetch - the latest version of the application. So to fetch and install the - package of &xfree86; 4.X, simply type: + &xorg; or + &xfree86; may be installed on &os;. + &os; doesn't force a default implementation, but recommends + &xorg;. &xorg; is + the X server of the open source X Window System implementation + released by the X.Org Foundation. &xorg; + is based on the code of + &xfree86 4.4RC2 and X11R6.6. + The X.Org Foundation released X11R6.7 in April 2004 and + X11R6.8.2 in February 2005, this latter is the version + currently available in the &os; pkgsrc framework. + + To build and install &xorg; from the + Ports Collection: + + &prompt.root; cd /usr/pkgsrc/meta-pkgs/xorg +&prompt.root; bmake install clean + + + To build &xorg; in its + entirety, be sure to have at least 4 GB of free space + available. + + + To build and install &xfree86; + from the pkgsrc framework: + + &prompt.root; echo "X11_TYPE=XFree86" >> /etc/mk.conf + + &prompt.root; cd /usr/pkgsrc/meta-pkgs/XFree86 +&prompt.root; bmake install clean + + Alternatively, X11 + can be installed directly from packages. + Binary packages to use with &man.pkg.add.1; tool are also available for + X11. If you have configured PKG_PATH the remote + fetching feature of &man.pkg.add.1; is used, the version number of the + package is not required. &man.pkg.add.1; will automatically fetch + the latest version of the application. - &prompt.root; pkg_add XFree86 + So to fetch and install the package of + &xorg;, simply type: - You can also use the ports collection to install - &xfree86; 4.X, for that you simply need - to type the following commands: + &prompt.root; pkg_add xorg - &prompt.root; cd /usr/ports/x11/XFree86-4 -&prompt.root; make install clean + The &xfree86; 4.X package can be + installed by typing: + + &prompt.root; pkg_add XFree86 The examples above will install the complete - &xfree86; distribution including the - servers, clients, fonts etc. Separate packages for - different parts of &xfree86; 4.X are also + X11 distribution including the + servers, clients, fonts etc. Separate packages and ports of X11 + are also available. The rest of this chapter will explain how to configure - &xfree86;, and how to set up a productive desktop + X11, and how to set up a productive desktop environment. - @@ -329,16 +391,18 @@ - &xfree86; Configuration + X11 Configuration - XFree86 4.X - XFree86 + &xfree86; 4.X + &xfree86; + &xorg; + X11 Before Starting - Before configuration of &xfree86; 4.X, + Before configuration of X11 the following information about the target system is needed: @@ -351,7 +415,7 @@ vertical scan rate The specifications for the monitor are used by - &xfree86; to determine the resolution and + X11 to determine the resolution and refresh rate to run at. These specifications can usually be obtained from the documentation that came with the monitor or from the manufacturer's website. There are two ranges of numbers that @@ -359,7 +423,7 @@ rate. The video adapter's chipset defines what driver module - &xfree86; uses to talk to the graphics + X11 uses to talk to the graphics hardware. With most chipsets, this can be automatically determined, but it is still useful to know in case the automatic detection does not work correctly. @@ -372,32 +436,43 @@ - Configuring &xfree86; 4.X + Configuring X11 - Configuration of &xfree86; 4.X is + Configuration of X11 is a multi-step process. The first step is to build an initial - configuration file with the option to - &xfree86;. As the super user, simply + configuration file. + As the super user, simply run: + &prompt.root; Xorg -configure + + In the case of &xfree86; + type: + &prompt.root; XFree86 -configure - This will generate a skeleton - &xfree86; configuration file in the + This will generate an + X11 configuration skeleton file in the /root directory called - XF86Config.new (in fact the directory used - is the one covered by the environment variable $HOME, - and it will depend from the way you got the superuser rights). The - &xfree86; program will attempt to probe - the graphics hardware on the system and will write a + xorg.conf.new (whether you &man.su.1; or + do a direct login affects the inherited supervisor + $HOME directory variable). + For &xfree86;, this configuration + file is called XF86Config.new. The + X11 program will attempt to probe + the graphics hardware on the system and write a configuration file to load the proper drivers for the detected hardware on the target system. The next step is to test the existing - configuration to verify that &xfree86; + configuration to verify that &xorg; can work with the graphics - hardware on the target system. To perform this task, the user - needs to run: + hardware on the target system. To perform this task, + type: + + &prompt.root; Xorg -config xorg.conf.new + + &xfree86; users will type: &prompt.root; XFree86 -xf86config XF86Config.new @@ -409,17 +484,20 @@ Backspace simultaneously. - If the mouse does not work, be sure the device - has been configured. See &man.moused.8 for more information + If the mouse does not work, you will need to first + configure it before proceeding. + + + - XFree86 4 Tuning + X11 tuning - Next, tune the XF86Config.new + Next, tune the xorg.conf.new (or XF86Config.new if you are running &xfree86;) configuration file to taste. Open the file in a text editor such as &man.emacs.1; or &man.ee.1;. First, add the frequencies for the target system's monitor. These are usually expressed as a horizontal and vertical synchronization rate. These - values are added to the XF86Config.new file + values are added to the xorg.conf.new file under the "Monitor" section: Section "Monitor" @@ -430,12 +508,12 @@ VertRefresh 48-120 EndSection - The HorizSync and - VertRefresh keywords may not exist in the - configuration file. If they do not, they need to be added, with + The HorizSync and + VertRefresh 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 - HorizSync keyword and the vertical - synchronization rate after the VertRefresh + HorizSync keyword and the vertical + synchronization rate after the VertRefresh keyword. In the example above the target monitor's rates were entered. @@ -449,10 +527,13 @@ EndSection Option "DPMS" - XF86Config + xorg.conf + + + XF86Config - While the XF86Config.new + While the xorg.conf.new (or XF86Config.new) configuration file is still open in an editor, select the default resolution and color depth desired. This is defined in the "Screen" section: @@ -463,47 +544,74 @@ EndSection Monitor "Monitor0" DefaultDepth 24 SubSection "Display" + Viewport 0 0 Depth 24 Modes "1024x768" EndSubSection EndSection - The DefaultDepth keyword describes + The DefaultDepth keyword describes the color depth to run at by default. This can be overridden - with the -bpp command line switch to - &man.XFree86.1;. - The Modes keyword + with the command line switch to + &man.Xorg.1; (or &man.XFree86.1;). + The Modes keyword describes the resolution to run at for the given color depth. Note that only VESA standard modes are supported as defined by the target system's graphics hardware. In the example above, the default color depth is twenty-four bits per pixel. At this color depth, the accepted resolution is - one thousand twenty-four pixels by seven hundred and sixty-eight + 1024 by 768 pixels. Finally, write the configuration file and test it using - the test mode given above. If all is well, the configuration + the test mode given above. + + + One of the tools available to assist you during + troubleshooting process are the X11 log files, which contain + information on each device that the X11 server attaches to. + &xorg; log file names are in the format + of /var/log/Xorg.0.log + (&xfree86; log file names follow the + format of XFree86.0.log). The exact name + of the log can vary from Xorg.0.log to + Xorg.8.log and so forth. + + + If all is well, the configuration file needs to be installed in a common location where - &man.XFree86.1; + &man.Xorg.1; (or &man.XFree86.1;) can find it. - This is typically /etc/X11/XF86Config or - /usr/X11R6/etc/X11/XF86Config. + This is typically /etc/X11/xorg.conf or + /usr/pkg/xorg/lib/X11/xorg.conf (for + &xfree86; it is called + /etc/X11/XF86Config or + /usr/pkg/XFree86/lib/X11/XF86Config). + + &prompt.root; cp xorg.conf.new /etc/X11/xorg.conf + + For &xfree86;: &prompt.root; cp XF86Config.new /etc/X11/XF86Config - Once the configuration file has been placed in a common - location, configuration is complete. In order to start - &xfree86; 4.X with &man.startx.1;, - install the x11/wrapper port. - &xfree86; 4.X can also be started with - &man.xdm.1;. - - There is also a graphical tool for configuration, - &man.xf86cfg.1;, that comes with the - &xfree86; 4.X distribution. It - allows to interactively define your configuration by choosing - the appropriate drivers and settings. This program can be used under console as well, just use the command xf86cfg -textmode. For more details, - refer to the &man.xf86cfg.1; manual page. + The X11 configuration process is now + complete. You can start + &xfree86; 4.X or + &xorg; with &man.startx.1;. The + X11 server may also be started with the use of &man.xdm.1;. + + There is also a graphical configuration tool, + &man.xorgcfg.1; (&man.xf86cfg.1; for &xfree86;), that comes with the + X11 distribution. It + allows you to interactively define your configuration by choosing + the appropriate drivers and settings. This program can be invoked from the console, by typing the command xorgcfg -textmode. For more details, + refer to the &man.xorgcfg.1; and &man.xf86cfg.1; manual pages. + + Alternatively, there is also a tool called &man.xorgconfig.1; + (&man.xf86config.1; for &xfree86;), + this program is a console utility that is less user friendly, + but it may work in situations where the other tools do + not. @@ -517,31 +625,9 @@ EndSection Configuration with &intel; i810 integrated chipsets requires the agpgart - AGP programming interface for &xfree86; - to drive the card. The &man.agp.4; driver is in the - GENERIC kernel since releases - 4.8-RELEASE and 5.0-RELEASE. On prior releases, you will - have to add the following line: - - device agp - - in your kernel configuration file and rebuild a new - kernel. Instead, you may want to load - the agp.ko kernel module - automatically with the &man.loader.8; at boot time. - For that, simply add this line to - /boot/loader.conf: - - agp_load="YES" - - Next, a - device node needs to be created for the - programming interface. To create the AGP device node, run - &man.MAKEDEV.8; in the /dev - directory: - - &prompt.root; cd /dev -&prompt.root; sh MAKEDEV agpgart + AGP programming interface for X11 + to drive the card. See the &man.agp.4; driver manual page + for more information. This will allow configuration of the hardware as any other graphics board. Note on systems without the &man.agp.4; @@ -550,11 +636,11 @@ EndSection in the kernel at boot time through being compiled in or using /boot/loader.conf. - If you are using &xfree86; 4.1.0 (or + If you are using &xfree86; 4.1.0 (or later) and messages about unresolved symbols like fbPictureInit appear, try adding the following line after Driver "i810" in the - &xfree86; configuration file: + X11 configuration file: Option "NoDDC" @@ -570,48 +656,47 @@ EndSection - Using Fonts in &xfree86; + Using Fonts in X11 Type1 Fonts The default fonts that ship with - &xfree86; are less than ideal for typical + X11 are less than ideal for typical desktop publishing applications. Large presentation fonts show up jagged and unprofessional looking, and small fonts in &netscape; are almost completely unintelligible. However, there are several free, high quality Type1 (&postscript;) fonts available which can be readily used - with &xfree86;, either version 3.X or - version 4.X. For instance, the URW font collection - (x11-fonts/urwfonts) includes - high quality versions of standard type1 fonts (Times Roman, - Helvetica, Palatino and others). The Freefonts collection - (x11-fonts/freefonts) includes - many more fonts, but most of them are intended for use in + with X11. For instance, the Freefonts collection + (fonts/freefonts) includes + a lot of fonts, but most of them are intended for use in graphics software such as the Gimp, and are not complete enough to serve as screen fonts. In addition, - &xfree86; can be configured to use - &truetype; fonts with a minimum of effort: see the - section on &truetype; fonts later. - - To install the above Type1 font collections from the ports - collection, run the following commands: - - &prompt.root; cd /usr/ports/x11-fonts/urwfonts -&prompt.root; make install clean - - And likewise with the freefont or other collections. To tell the X - server that these fonts exist, add an appropriate line to the - XF86Config file (in /etc/ for - &xfree86; version 3, or in - /etc/X11/ for version 4), which reads: + X11 can be configured to use + &truetype; fonts with a minimum of effort. For more details on + this, see the &man.X.7; manual page or the + section on &truetype; fonts. + + To install the Freefonts font collection from the pkgsrc + framework, run the following commands: + + &prompt.root; cd /usr/pkgsrc/fonts/freefonts +&prompt.root; bmake install clean + + And likewise with the other collections. To have the X + server detect these fonts, add an appropriate line to the + X server configuration file in /etc/X11/ + (xorg.conf for + &xorg; and + XF86Config for + &xfree86;), which reads: - FontPath "/usr/X11R6/lib/X11/fonts/URW/" + FontPath "/usr/pkg/lib/X11/fonts/freefont/" Alternatively, at the command line in the X session run: - &prompt.user; xset fp+ /usr/X11R6/lib/X11/fonts/URW + &prompt.user; xset fp+ /usr/pkg/lib/X11/fonts/freefont/ &prompt.user; xset fp rehash This will work but will be lost when the X session is closed, @@ -620,7 +705,8 @@ EndSection or ~/.xsession when logging in through a graphical login manager like XDM). A third way is to use the new - XftConfig file: see the + /usr/pkg/xorg/etc/fonts/local.conf file: see the + section on anti-aliasing. @@ -633,51 +719,49 @@ EndSection TrueType - &xfree86; 4.X has built in support + Both &xfree86; 4.X and &xorg; have built in support for rendering &truetype; fonts. There are two different modules that can enable this functionality. The freetype module is used in this example because it is more consistent with the other font rendering back-ends. To enable the freetype module just add the following line to the "Module" section of the + /etc/X11/xorg.conf or /etc/X11/XF86Config file. Load "freetype" - For &xfree86; 3.3.X, a separate + For &xfree86; 3.3.X, a separate &truetype; font server is needed. Xfstt is commonly used for this purpose. To install Xfstt, simply install the port - x11-servers/Xfstt. + x11/xfstt. Now make a directory for the &truetype; fonts (for example, - /usr/X11R6/lib/X11/fonts/TrueType) + /usr/pkg/xorg/lib/X11/fonts/TrueType) and copy all of the &truetype; fonts into this directory. Keep in mind that &truetype; fonts cannot be directly taken from a - &macintosh;; they must be in &unix;/DOS/&windows; format for use by - &xfree86;. Once the files have been + &macintosh;; they must be in &unix;/&ms-dos;/&windows; format for use by + X11. Once the files have been copied into this directory, use ttmkfdir to create a fonts.dir file, so that the X font renderer knows that these new files have been installed. - ttmkfdir is available from the FreeBSD - Ports Collection as - x11-fonts/ttmkfdir - or the &pkgsrc; collection at + ttmkfdir is available from the pkgsrc framework as fonts/ttmkfdir2. - &prompt.root; cd /usr/X11R6/lib/X11/fonts/TrueType -&prompt.root; ttmkfdir > fonts.dir + &prompt.root; cd /usr/pkg/xorg/lib/X11/fonts/TrueType +&prompt.root; ttmkfdir > fonts.dir Now add the &truetype; directory to the font path. This is just the same as described above for Type1 fonts, that is, use - &prompt.user; xset fp+ /usr/X11R6/lib/X11/fonts/TrueType + &prompt.user; xset fp+ /usr/pkg/xorg/lib/X11/fonts/TrueType &prompt.user; xset fp rehash - or add a line to the - XF86Config file. + or add a FontPath line to the + xorg.conf (or XF86Config) file. That's it. Now &netscape;, Gimp, @@ -695,7 +779,7 @@ EndSection Joe Marcus Clarke - Updated for &xfree86; 4.3 by + Updated by @@ -706,17 +790,20 @@ EndSection fonts anti-aliased - Anti-aliasing has been available in - &xfree86; since 4.0.2. However, font + Anti-aliasing has been available in X11 since + &xfree86; 4.0.2. However, font configuration was cumbersome before the introduction of - &xfree86; 4.3.0. Starting in version 4.3.0, - all fonts in /usr/X11R6/lib/X11/fonts/ and + &xfree86; 4.3.0. + Beginning with + &xfree86; 4.3.0, all fonts in X11 + that are found + in /usr/pkg/xorg/lib/X11/fonts/ and ~/.fonts/ are automatically made available for anti-aliasing to Xft-aware applications. Not - all applications are Xft-aware yet, but many have received Xft support. + all applications are Xft-aware, but many have received Xft support. Examples of Xft-aware applications include Qt 2.3 and higher (the toolkit for the KDE desktop), - Gtk+ 2.0 and higher (the toolkit for the + GTK+ 2.0 and higher (the toolkit for the GNOME desktop), and Mozilla 1.2 and higher. @@ -724,7 +811,7 @@ EndSection In order to control which fonts are anti-aliased, or to configure anti-aliasing properties, create (or edit, if it already exists) the file - /usr/X11R6/etc/fonts/local.conf. Several + /usr/pkg/xorg/lib/etc/fonts/local.conf. Several advanced features of the Xft font system can be tuned using this file; this section describes only some simple possibilities. For more details, please see @@ -744,12 +831,12 @@ EndSection As previously stated, all fonts in - /usr/X11R6/lib/X11/fonts/ as well as + /usr/pkg/xorg/lib/X11/fonts/ as well as ~/.fonts/ are already made available to Xft-aware applications. If you wish to add another directory outside of these two directory trees, add a line similar to the following to - /usr/X11R6/etc/fonts/local.conf: + /usr/pkg/lib/etc/fonts/local.conf: <dir>/path/to/my/fonts</dir> @@ -762,7 +849,7 @@ EndSection Anti-aliasing makes borders slightly fuzzy, which makes very small text more readable and removes staircases from large text, but can cause eyestrain if applied to normal text. To - exclude point sizes smaller than 14 point from anti-aliasing, include + exclude font sizes smaller than 14 point from anti-aliasing, include these lines: <match target="font"> @@ -772,6 +859,14 @@ EndSection <edit name="antialias" mode="assign"> <bool>false</bool> </edit> + </match> + <match target="font"> + <test name="pixelsize" compare="less" qual="any"> + <double>14</double> + </test> + <edit mode="assign" name="antialias"> + <bool>false</bool> + </edit> </match> fonts @@ -834,18 +929,18 @@ EndSection your changes to be ignored. The default font set that comes with - &xfree86; is not very + X11 is not very desirable when it comes to anti-aliasing. A much better set of default fonts can be found in the - x11-fonts/bitstream-vera + fonts/vera-ttf port. This port will install a - /usr/X11R6/etc/fonts/local.conf file + /usr/pkg/lib/etc/fonts/local.conf file if one does not exist already. If the file does exist, - the port will create a /usr/X11R6/etc/fonts/local.conf-vera + the port will create a /usr/pkg/lib/etc/fonts/local.conf-vera file. Merge the contents of this file into - /usr/X11R6/etc/fonts/local.conf, and the + /usr/pkg/lib/etc/fonts/local.conf, and the Bitstream fonts will automatically replace the default - &xfree86; Serif, Sans Serif, and Monospaced + X11 Serif, Sans Serif, and Monospaced fonts. Finally, users can add their own settings via their personal @@ -879,18 +974,17 @@ EndSection vrgb or vbgr: experiment and see which works best. - Mozilla - web browsers - Mozilla - Mozilla + + Mozilla + disabling anti-aliased fonts + Anti-aliasing should be enabled the next time the X server is started. However, programs must know how to take advantage of it. At present, the Qt toolkit does, so the entire KDE environment can - use anti-aliased fonts (see on - KDE for details). Gtk+ and + use anti-aliased fonts. + GTK+ and GNOME can also be made to use anti-aliasing via the Font capplet (see for details). By default, @@ -946,7 +1040,7 @@ EndSection Using XDM The XDM daemon program is - located in /usr/X11R6/bin/xdm. This program + located in /usr/pkg/xorg/bin/xdm. This program can be run at any time as root and it will start managing the X display on the local machine. If XDM is to be run every @@ -957,10 +1051,10 @@ EndSection /etc/ttys file for running the XDM daemon on a virtual terminal: - ttyv8 "/usr/X11R6/bin/xdm -nodaemon" xterm off secure + ttyv8 "/usr/pkg/xorg/bin/xdm -nodaemon" xterm off secure By default this entry is disabled; in order to enable it - change the fifth field from off to + change field 5 from off to on and restart &man.init.8; using the directions in . The first field, the name of the terminal this program will manage, is @@ -972,14 +1066,17 @@ EndSection Configuring XDM + The XDM configuration directory - is located in /usr/X11R6/lib/X11/xdm. In - this directory there are several files used to change the + is located in /var/lib/xdm. The sample + configuration files are in + /usr/pkg/share/examples/xorg/xdm/, + in this directory there are several files used to change the behavior and appearance of XDM. Typically these files will be found: - + @@ -1054,9 +1151,9 @@ EndSection XDM controlled displays is called the X Display Manager Connection Protocol (XDMCP). This file is a ruleset for controlling XDMCP connections from remote - machines. By default, it allows any client to connect, but - that does not matter unless the xdm-config - is changed to listen for remote connections. + machines. It is ignored unless the xdm-config + is changed to listen for remote connections. By default, it does + not allow any clients to connect. @@ -1065,7 +1162,7 @@ EndSection chooser and the login screens. This is where the appearance of the login program can be modified. The format is identical to the app-defaults file described in the - &xfree86; documentation. + X11 documentation. @@ -1140,9 +1237,9 @@ DisplayManager.requestPort: 0Several replacements for the default XDM program exist. One of them, - KDM (bundled with + kdm (bundled with KDE) is described later in this - chapter. KDM offers many visual + chapter. The kdm display manager offers many visual improvements and cosmetic frills, as well as the functionality to allow users to choose their window manager of choice at login time. @@ -1164,7 +1261,7 @@ DisplayManager.requestPort: 0Desktop Environments This section describes the different desktop environments - available for X on &os; . A desktop environment + available for X on FreeBSD. A desktop environment can mean anything ranging from a simple window manager to a complete suite of desktop applications, such as KDE or GNOME. @@ -1187,15 +1284,14 @@ DisplayManager.requestPort: 0GNOME provides. + GNOME provides. Installing GNOME - The easiest way to install - GNOME is with a package or - through the ports collection: + GNOME can be easily + installed from a package or from the pkgsrc framework: To install the GNOME package from the network, simply type: @@ -1205,38 +1301,56 @@ DisplayManager.requestPort: 0To build GNOME from source, use the ports tree: - &prompt.root; cd /usr/ports/x11/gnome2 -&prompt.root; make install clean + &prompt.root; cd /usr/pkgsrc/meta-pkgs/gnome +&prompt.root; bmake install clean Once GNOME is installed, the X server must be told to start GNOME instead of a default window - manager. If a custom .xinitrc is already in + manager. + + + The easiest way to start + GNOME is with + GDM, the GNOME Display Manager. + GDM, which is installed as a part + of the GNOME desktop (but is + disabled by default), can be enabled by adding + gdm_enable="YES" to + /etc/rc.conf. Once you have rebooted, + GNOME will start automatically + once you log in — no further configuration is + necessary. + + GNOME may also be started + from the command-line by properly configuring a file named + .xinitrc. + If a custom .xinitrc is already in place, simply replace the line that starts the current window manager with one that starts - /usr/X11R6/bin/gnome-session instead. - If nothing special has been done to configuration file, - then it is enough to simply type: + /usr/pkg/bin/gnome-session instead. + If nothing special has been done to the configuration file, + then it is enough simply to type: - &prompt.user; echo "/usr/X11R6/bin/gnome-session" > ~/.xinitrc + &prompt.user; echo "/usr/pkg/bin/gnome-session" > ~/.xinitrc Next, type startx, and the GNOME desktop environment will be started. - If a display manager, like + If an older display manager, like XDM, is being used, this will not work. Instead, create an executable .xsession file with the same command in it. To do this, edit the file and replace the existing window manager command with - /usr/X11R6/bin/gnome-session: + /usr/pkg/bin/gnome-session: - &prompt.user; echo "#!/bin/sh" > ~/.xsession -&prompt.user; echo "/usr/X11R6/bin/gnome-session" >> ~/.xsession + &prompt.user; echo "#!/bin/sh" > ~/.xsession +&prompt.user; echo "/usr/pkg/bin/gnome-session" >> ~/.xsession &prompt.user; chmod +x ~/.xsession - Another option is to configure the display manager to + Yet another option is to configure the display manager to allow choosing the window manager at login time; the section on KDE details explains how to do this for kdm, the @@ -1248,9 +1362,9 @@ DisplayManager.requestPort: 0GNOME anti-aliased fonts - Starting with version 4.0.2, &xfree86; + X11 supports anti-aliasing via its RENDER extension. - Gtk+ 2.0 and greater (the toolkit used by + GTK+ 2.0 and greater (the toolkit used by GNOME) can make use of this functionality. Configuring anti-aliasing is described in . So, with up-to-date software, @@ -1263,7 +1377,7 @@ DisplayManager.requestPort: 0Best shapes, Best contrast, or Subpixel smoothing (LCDs). For a - Gtk+ application that is not part of the + GTK+ application that is not part of the GNOME desktop, set the environment variable GDK_USE_XFT to 1 before launching the program. @@ -1323,17 +1437,12 @@ DisplayManager.requestPort: 0 - KDE has an office application - suite based on KDE's - KParts technology consisting - of a spread-sheet, a presentation application, an organizer, a - news client and more. KDE also - comes with a web browser called + KDE comes with a web browser called Konqueror, which represents a solid competitor to other existing web browsers on &unix; systems. More information on KDE can be found on the KDE - website. + website. @@ -1341,13 +1450,13 @@ DisplayManager.requestPort: 0Just as with GNOME or any other desktop environment, the easiest way to install - KDE is from a package - or from the ports collection: + KDE is through the pkgsrc + framework or from a package: To install the KDE package from the network, simply type: - &prompt.root; pkg_add kde3 + &prompt.root; pkg_add kde &man.pkg.add.1; will automatically fetch the latest version of the application. @@ -1355,8 +1464,8 @@ DisplayManager.requestPort: 0To build KDE from source, use the ports tree: - &prompt.root; cd /usr/ports/x11/kde3 -&prompt.root; make install clean + &prompt.root; cd /usr/pkgsrc/meta-pkgs/kde3 +&prompt.root; bmake install clean After KDE has been installed, the X server must be told to launch this application @@ -1370,7 +1479,7 @@ DisplayManager.requestPort: 0KDE will be the desktop. If a display manager such as - xdm is being used, the + XDM is being used, the configuration is slightly different. Edit the .xsession file instead. Instructions for kdm are described later in @@ -1401,7 +1510,7 @@ DisplayManager.requestPort: 0display manager An administrator of a multi-user system may wish to have a graphical login screen to welcome users. - xdm can be + XDM can be used, as described earlier. However, KDE includes an alternative, kdm, which is designed @@ -1411,121 +1520,13 @@ DisplayManager.requestPort: 0GNOME, or something else) to run after logging on. - To begin with, run the KDE - control panel, kcontrol, as - root. It is generally considered - unsafe to run the entire X environment as - root. Instead, run the window manager - as a normal user, open a terminal window (such as - xterm or KDE's - konsole), become root - with su (the user must be in the - wheel - group in /etc/group for this), and then - type kcontrol. - - Click on the icon on the left marked - System, then on Login - manager. On the right there are - various configurable options, which the - KDE manual will explain in greater - detail. Click on sessions on the right. - Click New type to add various window - managers and desktop environments. These are just labels, - so they can say KDE and - GNOME rather than - startkde or - gnome-session. - Include a label failsafe. - - Play with the other menus as well, they are mainly - cosmetic and self-explanatory. When you are done, click on - Apply at the bottom, and quit the - control center. - - To make sure kdm understands - what the labels (KDE, - GNOME etc) mean, edit the files used - by xdm. - In KDE 2.2 this has - changed: kdm now uses its own - configuration files. Please see the KDE - 2.2 documentation for details. - - In a terminal window, as root, - edit the file - /usr/X11R6/lib/X11/xdm/Xsession. There is - a section in the middle like this: - - case $# in -1) - case $1 in - failsafe) - exec xterm -geometry 80x24-0-0 - ;; - esac -esac - - A few lines need to be added to this section. - Assuming the labels from used were KDE and - GNOME, - use the following: - - case $# in -1) - case $1 in - kde) - exec /usr/local/bin/startkde - ;; - GNOME) - exec /usr/X11R6/bin/gnome-session - ;; - failsafe) - exec xterm -geometry 80x24-0-0 - ;; - esac -esac - - For the KDE - login-time desktop background to be honored, - the following line needs to be added to - /usr/X11R6/lib/X11/xdm/Xsetup_0: - - /usr/local/bin/kdmdesktop - - Now, make sure kdm is listed in - /etc/ttys to be started at the next bootup. - To do this, simply follow the instructions from the previous - section on xdm and replace - references to the /usr/X11R6/bin/xdm - program with /usr/local/bin/kdm. - - - - Anti-aliased Fonts + To enable kdm, the + ttyv8 entry in /etc/ttys + has to be adapted. The line should look as follows: - KDE - anti-aliased fonts - Starting with version 4.0.2, - &xfree86; supports anti-aliasing via - its RENDER extension, and starting with version 2.3, - Qt (the toolkit used by KDE) supports - this extension. Configuring this is described in on antialiasing X11 fonts. So, with - up-to-date software, anti-aliasing is possible on a - KDE desktop. Just go to the KDE - menu, go to - - Preferences - Look and Feel - Fonts, and click on the check box - Use Anti-Aliasing for Fonts and Icons. - For a Qt application which is not part of - KDE, the environment variable - QT_XFT needs to be set to true - before starting the program. + ttyv8 "/usr/pkg/bin/kdm -nodaemon" xterm on secure + - @@ -1534,7 +1535,7 @@ esac About XFce XFce is a desktop environment - based on the GTK + based on the GTK+ toolkit used by GNOME, but is much more lightweight and meant for those who want a simple, efficient desktop which is nevertheless easy to use and @@ -1565,7 +1566,7 @@ esac - Themeable (since it uses GTK) + Themeable (since it uses GTK+) @@ -1585,27 +1586,27 @@ esac A binary package for XFce exists (at the time of writing). To install, simply type: - &prompt.root; pkg_add xfce4 + &prompt.root; pkg_add -r xfce4 - Alternatively, to build from source, use the ports - collection: + Alternatively, to build from source, use the pkgsrc + framework: - &prompt.root; cd /usr/ports/x11-wm/xfce4 + &prompt.root; cd /usr/pkgsrc/meta-pkgs/xfce4 &prompt.root; make install clean Now, tell the X server to launch XFce the next time X is started. Simply type this: - &prompt.user; echo "/usr/X11R6/bin/startxfce4" > ~/.xinitrc + &prompt.user; echo "/usr/pkgsrc/bin/startxfce4" > ~/.xinitrc The next time X is started, XFce will be the desktop. As before, if a display manager like - xdm is being used, create an + XDM is being used, create an .xsession, as described in the section on GNOME, but - with the /usr/X11R6/bin/startxfce4 + with the /usr/pkg/bin/startxfce4 command; or, configure the display manager to allow choosing a desktop at login time, as explained in the section on kdm.