- Table of Contents
- Copyright
- About the Lead Authors
- About the Contributing Authors
- Acknowledgments
- Tell Us What You Think!
- Introduction
- I. Red Hat Linux Installation and User Services
- Chapter 1. Introduction to Red Hat Linux
- Chapter 2. Installation of Your Red Hat System
- Chapter 3. LILO and Other Boot Managers
- Chapter 4. Configuring the X Window System, Version 11
- Chapter 5. Window Managers
- Chapter 6. Connecting to the Internet
- Chapter 7. IRC, ICQ, and Chat Clients
- Chapter 8. Using Multimedia and Graphics Clients
- II. Configuring Services
- Chapter 9. System Startup and Shutdown
- Chapter 10. SMTP and Protocols
- Chapter 11. FTP
- Chapter 12. Apache Server
- Chapter 13. Internet News
- Chapter 14. Domain Name Service and Dynamic Host Configuration Protocol
- Chapter 15. NIS: Network Information Service
- Chapter 16. NFS: Network Filesystem
- Chapter 17. Samba
- III. System Administration and Management
- Chapter 18. Linux Filesystems, Disks, and Other Devices
- Chapter 19. Printing with Linux
- Chapter 20. TCP/IP Network Management
- Chapter 21. Linux System Administration
- Chapter 22. Backup and Restore
- Chapter 23. System Security
- IV. Red Hat Development and Productivity
- Chapter 24. Linux C/C++ Programming Tools
- Chapter 25. Shell Scripting
- Chapter 26. Automating Tasks
- Chapter 27. Configuring and Building Kernels
- Chapter 28. Emulators, Tools, and Window Clients
- V. Appendixes
- A. The Linux Documentation Project
- B. Top Linux Commands and Utilities
- C. The GNU General Public License
- D. Red Hat Linux RPM Package Listings
The twm Window Manager
The twm, or Tab window manager (shown in Figure 5.25), comes with the XFree86 X Window distribution. Installed under the /usr/X11R6/bin directory, this window manager provides the basics of window management for X:
- Custom keyboard commands
- Custom mouse commands
- Icon dock
- Icons
- Resizable windows
- Window titles
Figure 5.25 The twm provides basic window operations for your X sessions.
You'll find twm's system-wide configuration file, system.twmrc, under the /etc/X11/twm directory. This file contains default definitions you can change and use for yourself. Copy system.twmrc to your home directory as .twmrc to make your changes. You can use twm by inserting the twm command in your .xinitrc file.
twm's default startup file, which defines twm's root menu (accessed by pressing the left mouse button in a blank area of the desktop) now includes a menu item definition for a terminal. You'll certainly want to customize this menu to add other clients. Before using twm, open your copy of .twmrc in your favorite text editor, such as pico (the -w option disables line wrapping):
# pico -w .twmrc
Look for the section defining the root menu:
menu "defops"
{
"Twm" f.title
"Iconify" f.iconify
"Resize" f.resize
"Move" f.move
"Raise" f.raise
"Lower" f.lower
"------------" f.nop
"Focus" f.focus
"Unfocus" f.unfocus
"Show Iconmgr" f.showiconmgr
"Hide Iconmgr" f.hideiconmgr
"------------" f.nop
"Xterm" f.exec "exec xterm &"
"------------" f.nop
"Kill" f.destroy
"Delete" f.delete
"------------" f.nop
"Restart" f.restart
"Exit" f.quit
}
This section of .twmrc contains root menu labels, followed by an appropriate command for the twm window manager. For example, to "kill" a window, you press your left mouse button on the desktop, drag down to select the Kill menu item, and then press your mouse button over the top of a desired window—twm then removes the selected window. Now insert a menu definition to create and display a calendar of the current month, like this:
menu "defops"
{
"Twm" f.title
"Iconify" f.iconify
"Resize" f.resize
"Move" f.move
"Raise" f.raise
"Lower" f.lower
"------------" f.nop
"Focus" f.focus
"Unfocus" f.unfocus
"Show Iconmgr" f.showiconmgr
"Hide Iconmgr" f.hideiconmgr
"------------" f.nop
"Xterm" f.exec "exec xterm &"
"Calendar" f.exec "cal | xmessage -file - &"
"------------" f.nop
"Kill" f.destroy
"Delete" f.delete
"------------" f.nop
"Restart" f.restart
"Exit" f.quit
}
The example menu item uses the cal command to pipe its output into the xmessage client for display, resulting in a small floating-window calendar for the desktop. After making your changes, save the new .twmrc file. If you're running twm, press your left mouse button and drag down to select the Restart menu item (which restarts twm) using the newly defined menu. This is how you can customize not only twm, but also the fvwm2 window manager discussed in this chapter.
Summary | Next Section

Account Sign In
View your cart