- Table of Contents
- Copyright
- About the Author
- Acknowledgments
- Tell Us What You Think!
- Introduction
- Part I: Introduction to Mac OS X
- Chapter 1. Mac OS X Component Architecture
- Chapter 2. Installing Mac OS X
- Chapter 3. Mac OS X Basics
- Chapter 4. The Finder: Working with Files and Applications
- Chapter 5. Running Classic Mac OS Applications
- Part II: Inside Mac OS X
- Chapter 6. Native Utilities and Applications
- Chapter 7. Internet Communications
- Chapter 8. Installing Third-Party Applications
- Part III: User-Level OS X Configuration
- Chapter 9. Network Setup
- Chapter 10. Printer and Font Management
- Chapter 11. Additional System Components
- Part IV: Introduction to BSD Applications
- Chapter 12. Introducing the BSD Subsystem
- Chapter 13. Common Unix Shell Commands: File Operations
- Part V: Advanced Command-Line Concepts
- Chapter 14. Advanced Shell Concepts and Commands
- Chapter 15. Command-Line Applications and Application Suites
- Chapter 16. Command-Line Software Installation
- Chapter 17. Troubleshooting Software Installs, and Compiling and Debugging Manually
- Chapter 18. Advanced Unix Shell Use: Configuration and Programming (Shell Scripting)
- Part VI: Server/Network Administration
- Chapter 19. X Window System Applications
- Chapter 20. Command-Line Configuration and Administration
- Chapter 21. AppleScript
- Chapter 22. Perl Scripting and SQL Connectivity
- Chapter 23. File and Resource Sharing with NetInfo
- Chapter 24. User Management and Machine Clustering
- Chapter 25. FTP Serving
- Chapter 26. Remote Access and Administration
- Chapter 27. Web Serving
- Part VII: Server Health
- Chapter 28. Web Programming
- Chapter 29. Creating a Mail Server
- Chapter 30. Accessing and Serving a Windows Network
- Chapter 31. Server Security and Advanced Network Configuration
- Chapter 32. System Maintenance
- Appendix A. Command-Line Reference
- Appendix B. Administration Reference
Using XFree86
After you have XFree86 installed, starting it up is simply a matter of running the command from the shell. The XonX port of the XFree86 distribution suggests that you might be able to start it with startx — -aqua, but as of the version available on April 17th, 2001, this feature does not work. Instead, the software currently appears to require the invocation startx — -quartz. When started, you will shortly be presented with a dialog box like that shown in Figure 19.5. Pay attention to what the dialog box has to say. Remember, the current XFree86 implementation runs X11R6 as a completely separate windowing system; you will need to know how to switch between them, and that information is shown in this dialog box.
Figure 19.5 The Startup dialog for the XFree86 X Window System server gives you the information you need to know to switch back to the Aqua interface.
The look and feel of the X Window System is mostly the responsibility of the particular window manager you've chosen to run (you'll learn more about window managers in the immediately following section). But in the general operation of the environment, you'll find that there are a number of constants to the way the X Window System works, regardless of what the interface looks like. Some of these will be familiar to anyone who has previously used a computer with a mouse. A few, however, are likely to be new even to users who have been happily using a mouse since the earliest days of the Mac. The significant things to remember are described in the next section.
Common X11 Interface Features
The X Window System is designed for a three-button mouse. Most X software makes use of the left button for pointing, clicking, and selection. X uses the center button for general functions such as moving or resizing windows, and the right button for application-specific functions such as opening in-application pop-up windows. Of course, any application is capable of modifying these uses, so examination of a program's documentation is always in order.
X also uses its three-button mouse for selection, copying, and pasting in a way that won't be familiar, but that you will probably come to appreciate quickly. Unlike the Mac and Windows, there is no separate command to perform copy functions. Instead, X functions as though whatever has been most recently selected has been placed on the clipboard and can be pasted. The left mouse button allows click-and-drag type selection, and picking the start of a selection region. The right mouse button functions like Shift-clicking on the Mac; that is, it extends the selection. And clicking the center mouse button pastes whatever is selected—or has been most recently selected—into whichever window the cursor is in when clicked. This different paradigm for selection, copying, and pasting turns out to be a wonderfully efficient way of allowing you to work with text with the mouse, as it requires no coordinated use of a second hand.
The Mac of course, has no middle or right mouse buttons by default. XFree86 deals with this by allowing you to use keyboard modifiers to emulate the middle and right mouse buttons. To enable this mode, add the argument -fakebuttons to the startx invocation. This allows clicking while holding the left Command key to emulate the middle mouse button, and the left Option key to emulate the right mouse button. So, that benefit of not needing the second hand goes away again, at least on the Mac currently. It might be time to put away that cool pro mouse and buy one with multiple buttons, or petition Apple to get with the X program! For more information on compensatory changes of this nature that the XonX group have had to make to get X running on X, see the XonX FAQ (Frequently Asked Questions list) at http://mrcla.com/XonX/FAQ.html.
X has the concept of focused input. On the Macintosh and Windows platforms, if you type on the keyboard, you generally expect the typing to appear in whatever window or dialog box is in front. On the Mac and Windows, the window in front is the active window. In X, the window manager has the option of directing your input where it chooses. The location into which your input is directed is called the input focus. Most window managers can be configured to focus input on the frontmost window; focus input on a selected window (which, on X, does not have to be the front window); or focus input on whichever window the cursor is over. These are usually called, respectively, Focus to Front, Click to Focus, and Focus Follows Cursor modes. The last of these, although most unlike the interface you are probably familiar with, is usually considered to be the most powerful. With the window manager configured in Focus Follows Cursor mode, you can direct typing into a mostly hidden window (for example, to start a noninteractive program) by simply moving the cursor over any visible part of the mostly hidden window and typing. There is no need to waste time bringing a rear window to the front, typing the command, and then shuffling the window back underneath the window that you really wanted to be working in. Figures 19.6 though 19.8 show several examples of working in the different X11 focus modes. Configuration methods for the different window managers vary; we'll cover the options for several in the next section.
Figure 19.6 Focus-Follows-Cursor mode, with work being done in the frontmost window—this looks like the type of interaction with which you're probably familiar. Note that both the mouse pointer (the I-bar text cursor) and the text-insertion point (the dark filled rectangle in the emacs window) are inside the same window.
Figure 19.8 Click-to-Focus mode, with a window selected other than the one that the cursor is in—this does not have to be the front window. Note how the mouse pointer and active text cursor are not in the same window. After input has been focused into a window in this mode, it will not leave until the mouse is clicked elsewhere.
Figure 19.7 Focus-Follows-Cursor mode, with work being done in a window that is behind the front window. Notice that the in-window cursor of the emacs window (frontmost) has gone hollow, to indicate that it is no longer active. The dark active cursor has followed the mouse pointer to indicate that a different window is active. The window border also changes colors, but that probably doesn't show up well in a black-and-white printed image.
In the X Window System, the window manager or any other program can attach arbitrary commands to arbitrary user actions. For example, a program can attach the action of displaying a menu when a user right-clicks on the title bar. The window manager could pop up a variety of menus when the user left-, right-, or center-clicks in the empty background (root window or desktop) of the windowing system. Or it could happen when the user Shift-left-clicks, Shift-right-clicks, or Shift-center-clicks—the possibilities are endless. One popular terminal program, xterm, pops up its configuration menus when the user holds down the Control key and left-, right-, or center-clicks in the window. Some window managers attach a standard menu with common commands such as close and resize to icons in each window's title bar. Others attach these functions to pop-up menus in the title bar. You'll find variations in program behavior even among different installations of X11 on the same version of Unix because local configuration options can exert a significant influence over the interface. Don't be too surprised if your installation of X11 doesn't look or behave quite like what is shown here. With the short generation times for open source software, there is plenty of time for the software to be updated a dozen times between typing this and you reading it. Also, don't be afraid to read the documentation and the FAQ to find out how things work today, regardless of when today happens to be.
Most window managers can iconize windows. Because the actual display of a client's windows isn't handled by the client, but by the server at the request of the client, the X server and window manager are free to make some useful contributions to the user experience. One of these contributions is that when a client requests a window with particular characteristics, the server isn't obliged to represent the window that way to the user. The server is only obliged to treat it as though it had those characteristics. This enables the server, for example, to scale the window arbitrarily, or to shrink it down and display it as an icon. You're familiar with the concept of files and folders being represented with icons. X11 doesn't know a thing about files or folders. It knows about drawing pictures on the screen (there are file browser applications for X11, much like the OS X Finder, and we'll talk about them later in this chapter), and it knows that you don't always want all those pictures fighting for display space. So, X11 includes the notion that a window can be turned into an icon displayed in the root window, if you don't care to have it taking up space. This is sort of like OS X's capability to minimize a running application into the Dock, but you aren't limited to just placing things in one location on the screen. Likewise, some applications can be dynamically resized to provide different functionality than you are familiar with from Mac OS. The xterm terminal window, for example, interacts dynamically with the size of the font it's using. Increase the size of the font, and the window will increase to show the same data. You can also decrease the font size to a single point—in which case, the terminal will shrink to icon size, while remaining a usable terminal and continuing to display output.
Configuring the X Window System | Next Section

Account Sign In
View your cart