The Defiitive Gides
to the X Wido System
Volume Three
X Window System
User's Guide
ly Valcric Qucrcia
and "l'i O'Rcilly
O'Reilly & Associates, Inc.
X Window System
User's Guide
Volume Three
X Window System
User's Guide
for Xll R3 and R4 of the
X Window System
by Valerie Quercia and Tim O'Reilly
O'Reilly & Associates, Inc.
Table of Contents
Page
Preface ...................................................................................................................................... xxi
Assumptions ................................................................................................................................ xxi
Organization .............................................................................................................................. xxii
Bulk Sales Information ............................................................................................................ xxiv
xshowfonts.c ............................................................................................................................. xxiv
Acknowlegements .................................................................................................................... xxiv
Font and Character Conventions .............................................................................................. xxv
PART ONE: Using X .......................................................................................................... l
1 An Introduction to the X Window System ........................................................... 5
Anatomy of an X Display .............................................................................................................. 5
X Architecture Overview ............................................................................................................ 10
The X Display Server .................................................................................................................. 11
Clients ........................................................................................................................................... 12
The Window Manager ............................................................................................................. 13
The xterm Terminal Emulator ................................................................................................. 14
The Display Manager .............................................................................................................. 14
Other X Clients ........................................................................................................................ 14
Customizing Clients ................................................................................................................ 15
2 Getting Started ............................................................................................................... 19
If X is Being Started Automatically ........................................................................................... 19
Starting X Manually .................................................................................................................... 22
Starting the First xterm Window ............................................................................................ 22
Bringing Up the Window Manager ........................................................................................ 23
Starting a Second xterm Window ............................................................................................... 23
Exiting from an xterm Window .................................................................................................. 25
Special Keys ................................................................................................................................. 26
How a Client Looks and Behaves: Application Defaults ........................................................ 26
Starting Other Clients .................................................................................................................. 27
Running a Client on Another Machine ...................................................................................... 28
Where to Go From Here .............................................................................................................. 30
3 Using the twm Window Manager .......................................................................... 33
Starting the Window Manager .................................................................................................... 34
Titlebars ........................................................................................................................................ 34
The Twm Menu ............................................................................................................................ 35
Displaying Windows as Icons ................................................................................................. 36
Resizing Windows ................................................................................................................... 38
Moving Windows and Icons ................................................................................................... 39
Shuffling the Window Stack: Raise and Lower .................................................................... 40
Raising Windows (bringing in front of others) .................................................................... 41
Lowering Windows (sending behind others) ....................................................................... 42
Changing Keyboard Focus ...................................................................................................... 43
Removing a Window: Delete and Kill ................................................................................... 43
Restarting the Window Manager ............................................................................................ 44
Exiting the Window Manager ................................................................................................. 44
Button Control of Window Manager Functions ........................................................................ 45
Using twm to Place Other Clients .............................................................................................. 45
Customizing twm ......................................................................................................................... 46
Some of My Keystrokes are Missing ......................................................................................... 46
4 The xterm Terminal Emulator ................................................................................ 49
The Release 4 xterm Menus ........................................................................................................ 50
The xterm Menus at a Glance ................................................................................................. 50
The Main Options Menu ......................................................................................................... 52
VT Options Menu .................................................................................................................... 55
VT Fonts Menu ........................................................................................................................ 57
Tek Options Menu .................................................................................................................... 58
Using the Scrollbar ...................................................................................................................... 59
Copying and Pasting Text Selections ......................................................................................... 61
Selecting Text to Copy ............................................................................................................ 62
Pasting Text Selections ............................................................................................................ 64
Manipulating Text Selections ..................................................................................................... 65
Copying and Pasting between Release 2 and 3 Clients: xcutsel ......................................... 66
Saving Multiple Selections: xclipboard (Release 4 Version) ............................................. 68
Problems with Large Selections ........................................................................................... 71
Editing Text Saved in the xclipboard ................................................................................... 71
Release 3 xclipboard ............................................................................................................. 72
Terminal Emulation and the xterm Terminal Type .................................................................... 73
Resizing an xterm Window ......................................................................................................... 74
Running a Program in a Temporary xterm Window ................................................................. 75
5 Font Specification .......................................................................................................... 79
Font Naming Conventions .......................................................................................................... 80
Font Families ............................................................................................................................ 81
Stroke Weight and Slant .......................................................................................................... 84
Font Sizes ................................................................................................................................. 84
Other Information in the Font Name ...................................................................................... 87
Font Name Wildcarding .............................................................................................................. 88
The Font Search Path ................................................................................................................... 90
The fonts.dir Files .................................................................................................................... 91
Font Name Aliasing ..................................................................................................................... 93
Making the Server Aware of Aliases ................................................................................... 95
Utilities for Displaying Information about Fonts ...................................................................... 95
The Font Displayer: xfd ......................................................................................................... 95
Release 3 xfd .......................................................................................................................... 97
Previewing and Selecting Fonts: xfontsel ............................................................................. 98
Previewing Fonts with the xfontsel Menus .......................................................................... 98
Selecting a Font Name ........................................................................................................ 102
Changing Fonts in xterm Windows .......................................................................................... 102
The Great Escape ................................................................................................................. 102
The Selection Menu Item .................................................................................................... 104
Release 2 versus Subsequent Release Fonts ............................................................................ 104
Font Specification in Release 2 ............................................................................................ 104
6 Graphics Utilities ......................................................................................................... 109
Creating Icons and Other Bitmaps ........................................................................................... 109
Bitmap Editing Commands ................................................................................................... 111
Pointer Commands ............................................................................................................... 112
Bitmap Command Boxes .................................................................................................... 112
Acting on the Entire Grid: Clear All, Set All, Invert All ................................................. 112
Acting on an Area: Clear Area, Set Area, Invert Area .................................................... 114
Copy Area, Move Area, Overlay Area ............................................................................... 115
Drawing: Line, Circle, Filled Circle ................................................................................. 116
Filling in a Shape: Flood Fill ............................................................................................. 117
Hot Spots: Set Hot Spot, Clear Hot Spot .......................................................................... 117
Saving and Quitting: Write Output, Quit .......................................................................... 117
Creating a Bitmap from a Cursor ......................................................................................... 119
Magnifying Portions of the Screen: xmag .......................................................................... 122
Quitting xmag ...................................................................................................................... 123
What xmag Shows You ....................................................................................................... 123
Dynamically Choosing a Different Source Area ............................................................... 125
7 Other Clients .................................................................................................................. 129
Desk Accessories ....................................................................................................................... 129
Clock Programs: xclock and oclock .................................................................................... 130
A Scientific Calculator: xcalc .............................................................................................. 132
Terminating the calculator .................................................................................................. 133
Mail Notification Client: xbiff ............................................................................................. 133
Monitoring System Load Average: xload ........................................................................... 134
Browsing Reference Pages: xman ....................................................................................... 135
Release 3 xman .................................................................................................................... 138
Printing Utilities: xwd, xpr, xdpr ............................................................................................. 140
Killing a Client Window with xkill .......................................................................................... 141
Problems with Killing a Client ............................................................................................. 142
Window and Display Information Clients ............................................................................... 144
Displaying Information about a Window: xwininfo .......................................................... 144
Listing the Window Tree: xlswins ....................................................................................... 146
Listing the Currently Running Clients: xlsclients .............................................................. 148
Generating Information about the Display: xdpyinfo ........................................................ 149
User-contributed Clients ........................................................................................................... 150
X Toolkit Applications .............................................................................................................. 150
Dialog Boxes and Command Buttons .................................................................................. 151
Scrollbars ................................................................................................................................ 152
Selecting Information for Copying and Pasting .................................................................. 152
Vertical Panes ......................................................................................................................... 153
Viewports ............................................................................................................................... 154
Text Editing Widget ............................................................................................................... 154
PART TWO: Customizing X ...................................................................................... 159
8 Command Line Options ........................................................................................... 163
Which Display to Run On ......................................................................................................... 164
Title and Name ........................................................................................................................... 165
Window Geometry ..................................................................................................................... 166
Border Width .............................................................................................................................. 168
Color Specification .................................................................................................................... 169
The rgb.txt File ....................................................................................................................... 169
Release 4 Color Names ......................................................................................................... 170
Release 3 Color Names ......................................................................................................... 172
Alternative Release 4 Color Databases ................................................................................ 172
Hexadecimal Color Specification ......................................................................................... 172
The RGB Color Model ........................................................................................................ 173
How Many Colors are Available? ...................................................................................... 174
Starting a Client Window as an Icon ........................................................................................ 176
Specifying Fonts on the Command Line .................................................................................. 176
Reverse Video ............................................................................................................................ 177
9 Setting Resources ......................................................................................................... 181
Resource Naming Syntax .......................................................................................................... 182
Syntax of Toolkit Client Resources ...................................................................................... 183
Tight Bindings and Loose Bindings ..................................................................................... 184
Instances and Classes ............................................................................................................ 184
ooo
VIII
Precedence Rules for Resource Specification ..................................................................... 185
Some Common Resources .................................................................................................... 187
Event Translations ..................................................................................................................... 188
The Syntax of Event Translations ......................................................................................... 189
xterm Translations to Use xclipboard ................................................................................. 191
How to Set Resources ................................................................................................................ 192
A Sample Resources File ...................................................................................................... 193
Specifying Resources from the Command Line .................................................................. 194
The-xrm Option .................................................................................................................. 194
The -name Option ............................................................................................................... 194
Setting Resources with xrdb ..................................................................................................... 195
Querying the Resource Database ......................................................................................... 196
Loading New Values into the Resource Database .............................................................. 196
Saving Active Resource Definitions in a File ...................................................................... 197
Removing Resource Definitions ........................................................................................... 197
Listing the Current Resources for a Client: appres ............................................................ 198
Other Sources of Resource Definition .................................................................................. 199
10 Customizing the twm Window Manager ....................................................... 203
Seuing .twmrc Variables ........................................................................................................... 205
Button/Key Bindings ................................................................................................................. 206
Pointer Buttons ...................................................................................................................... 206
Keys ........................................................................................................................................ 207
Context ................................................................................................................................... 207
Function Names ..................................................................................................................... 208
Action ..................................................................................................................................... 208
Defining Menus .......................................................................................................................... 209
Submenus ............................................................................................................................... 210
Executing System Commands from a Menu ........................................................................ 211
Color Menus ........................................................................................................................... 212
A Complete Revamp of twm .................................................................................................... 213
11 Setup Clients ................................................................................................................ 219
xset: Setting Display and Keyboard Preferences ................................................................... 219
Keyboard Bell ...................................................................................................................... 219
Bug Compatibility Mode .................................................................................................... 220
Keyclick Volume ................................................................................................................. 220
Enabling or Disabling Auto-repeat .................................................................................... 221
Changing or Rehashing the Font Path ................................................................................ 221
Keyboard LEDs .................................................................................................................... 221
Pointer Acceleration ............................................................................................................ 222
Screen Saver ......................................................................................................................... 222
Color Definition ................................................................................................................... 223
Help with xset Options ........................................................................................................ 223
xsetroot: Setting Root Window Characteristics ..................................................................... 224
Setting Root Window Patterns .............................................................................................. 224
Foreground, Background Color and Reverse Video ........................................................... 225
Changing the Root Window Pointer .................................................................................... 226
xmodmap: Modifier Key and Pointer Customization ............................................................ 227
Keycodes and Keysyms ......................................................................................................... 229
Procedure to Map Modifier Keys ......................................................................................... 230
Displaying the Current Modifier Key Map .......................................................................... 230
Determining the Default Key Mappings .............................................................................. 231
Matching Keysyms with Physical Keys Using xev ............................................................. 232
Changing the Map with xmodmap ....................................................................................... 233
Expressions to Change the Key Map ................................................................................. 234
Key Mapping Examples ...................................................................................................... 235
Displaying and Changing the Pointer Map .......................................................................... 236
PART THREE: Client Reference Pages ............................................................... 239
PART FOUR: Appendices ........................................................................................... 521
A System Management ................................................................................................. 525
Including X in Your Search Path .............................................................................................. 526
Setting the Terminal Type ......................................................................................................... 526
A Startup Shell Script ................................................................................................................ 527
What Should Go in the Script ............................................................................................... 527
Starting X ................................................................................................................................... 531
Starting X with the Display Manager, xdm (Release 4) ..................................................... 531
Getting Started with xdm on a Single Display .................................................................. 532
Setting Up the Configuration File and Other Special Files .............................................. 532
The Standard Login Session ............................................................................................... 535
Customizing xdm ................................................................................................................... 536
The Xservers File ................................................................................................................. 537
The Xsession File and .xsession Scripts ............................................................................. 538
The Xresources File ............................................................................................................. 538
The Error Log File ............................................................................................................... 539
The xdm-pid File (Release 4 Only) .................................................................................... 539
Xstartup and Xreset ............................................................................................................. 539
Security and the authorize Resource (Release 4 Only) .................................................... 539
Stopping xdm and the Server ................................................................................................ 540
X Terminals and the XDM Control Protocol (Release 4) ................................................... 540
Release 3 xdm ........................................................................................................................ 541
Release 3 Special Files and the Config File ........................................................................ 541
Customizing the Release 3 xdm ........................................................................................... 542
Managing Multiple Displays: the Release 3 Xservers File ............................................. 543
Release 3 .xsession Scripts .................................................................................................. 544
Release 3 Xresources File ................................................................................................... 544
Release 3 Xstartup and Xreset ............................................................................................ 544
Starting X with xinit .............................................................................................................. 545
An Older Method of Starting X: /etc/ttys ........................................................................... 545
Server Access Control ............................................................................................................... 547
Host-based Access and the xhost Client .............................................................................. 547
User-based Access: xdm and the .Xauthority File (Release 4) ......................................... 548
Font Management ...................................................................................................................... 549
Console Messages ...................................................................................................................... 550
Log Files ..................................................................................................................................... 550
Changing the Color Name Database ........................................................................................ 550
B The uwm Window Manager .................................................................................. 555
Starting the Window Manager .................................................................................................. 556
The WindowOps Menu ............................................................................................................. 556
Creating New Terminal Windows ........................................................................................ 558
C The OSF/Motif Window Manager ..................................................................... 591
Getting Started with mwm ........................................................................................................ 591
Starting mwm ............................................................................................................................. 592
Selecting the Window to Receive Input .................................................................................. 592
Manipulating Windows with the mwm Window Frame ......................................................... 594
Moving a Window: The Title Area ..................................................................................... 594
Minimizing (Iconifying) and Maximizing a Window ........................................................ 596
The Minimize Button .......................................................................................................... 596
The Maximize Button .......................................................................................................... 597
Raising a Window .................................................................................................................. 598
Resizing a Window ................................................................................................................ 599
The Window Menu Button: Display a Menu or Close the Window .................................. 602
Manipulating Windows Using the Window Menu .............................................................. 602
Changing the Window Location: Move ............................................................................ 604
Resizing the Window: Size ................................................................................................ 605
Iconifying the Window: Minimize .................................................................................... 605
Changing to the Maximum Size: Maximize ..................................................................... 606
Moving a Window to the Bottom of the Stack: Lower .................................................... 606
Removing a Window: Close .............................................................................................. 606
Restoring a Maximized Window or an Icon: Restore ...................................................... 607
Manipulating Icons .................................................................................................................... 607
Manipulating Icons Using the Window Menu .................................................................... 607
The Root Menu .......................................................................................................................... 608
Customizing mwm ..................................................................................................................... 610
Activating Changes to the Window Manager ..................................................................... 611
The system.mwmrc File ........................................................................................................ 612
mwm Functions .................................................................................................................... 614
xi
Menu Specifications ............................................................................................................ 615
Key Bindings ........................................................................................................................ 616
Button Bindings ................................................................................................................... 617
Customizing the Root Menu ............................................................................................... 619
Creating New Menus ........................................................................................................... 620
Cascading Menus ................................................................................................................. 620
Setting mwm Resources ........................................................................................................ 622
Component Appearance Resources .................................................................................... 623
mwm-Specific Appearance and Behavior Resources ....................................................... 624
Client-Specific Resources ................................................................................................... 624
Setting the Focus Policy ...................................................................................................... 625
Using an Icon Box ............................................................................................................... 626
D Standard Cursors ....................................................................................................... 633
E Release 3 and 4 Standard Fonts ........................................................................... 639
F xterm Control Sequences ........................................................................................ 681
xterm Control Sequences .......................................................................................................... 681
Definitions .............................................................................................................................. 681
VT102 Mode .......................................................................................................................... 681
Tektronix 4014 Mode ............................................................................................................ 688
G Standard Bitmaps ...................................................................................................... 693
H Translation Table Syntax ........................................................................................ 697
Event Types and Modifiers ........................................................................................................ 697
Detail Field ............................................................................................................................. 699
Modifiers ................................................................................................................................ 700
Complex Translation Examples ............................................................................................ 700
Glossary ................................................................................................................................. 705
Index ......................................................................................................................................... 711
Figures
1-1
1-2
1-3
1-4
1-5
1-6
2-1
2-2
2-3
2-4
2-5
2-6
2-7
3-1
3-2
3-3
3-4
3-5
3-6
3-7
3-8
4-1
4-2
4-3
4-4
4-5
4-6
4-7
4-8
Page
X display with five windows and an icon ............................................................................ 6
Some standard cursors .......................................................................................................... 8
Focus on an xterm window ................................................................................................... 9
Twm menu on the root window .......................................................................................... 10
A display made up of two physical screens ...................................................................... 11
A sample X Window System configuration ...................................................................... 12
Workstation with login xterm window on the root window ............................................. 20
xdm login window ............................................................................................................... 21
xterm window with login prompt ....................................................................................... 21
Placing a second xterm window ......................................................................................... 24
Two xterm windows ............................................................................................................ 24
The oclock display .............................................................................................................. 28
Monitoring activity on two systems with xload ................................................................ 29
Anatomy of a twm titlebar .................................................................................................. 35
Twm menu ........................................................................................................................... 36
The login window is about to become an icon .................................................................. 37
The login window is about to be deiconified .................................................................... 37
Resizing a window .............................................................................................................. 39
Moving windows or icons .................................................................................................. 40
One xterm window overlapping another ........................................................................... 41
Raising a window ................................................................................................................ 42
The Release 4 xterm menus ................................................................................................ 51
The Main Options menu ..................................................................................................... 52
Reverse video is enabled when the keyboard is secure .................................................... 54
The VT Options menu ......................................................................................................... 56
VT Fonts menu .................................................................................................................... 57
The Tek Options menu ........................................................................................................ 59
An xterm window with a scrollbar ..................................................................................... 60
Highlighted text saved as the PRIMARY selection ........................................................... 63
4-9 Pasting text into an open file .............................................................................................. 64
4-10 An xcutsel window ............................................................................................................ 67
4-11 The xclipboard window .................................................................................................... 68
4-12 Selected text appears automatically in the xclipboard window .................................... 69
4-13 xclipboard with scrollbars to view large text selection .................................................. 71
4-14 The Release 3 xclipboard window ................................................................................... 72
5-1 Font name, Releases 3 and 4 .............................................................................................. 81
5-2 The major commercial font families available in the standard X distribution ............... 82
5-3 Miscellaneous fonts for xterm text .................................................................................... 83
5-4 The same fonts in different weights and slants ................................................................. 85
5-5 The same font in six different point sizes .......................................................................... 85
5-6 The 100-dpi version of a 24-point font appears larger on a 75-dpi monitor ................... 86
5-7 Fixed font, 6x13 pixels ....................................................................................................... 96
5-8 xfontsel window displaying 7x13 bold font ...................................................................... 99
ooo
XIII
5-9 xfontsel window with foundry menu displayed .............................................................. 100
5-10 xfontsel after choosing Adobe from the foundry menu ............................................... 100
5-11 Default font, fixed ........................................................................................................... 106
6-1 Bitmap window ................................................................................................................. 110
6-2 Gumby bitmap ................................................................................................................... 111
6-3 Clearing all ........................................................................................................................ 112
6-4 Setting all ........................................................................................................................... 113
6-5 Inverting all ....................................................................................................................... 113
6-6 Selecting an area to clear, set, or invert ........................................................................... 114
6-7 Selecting an area to copy, move, or overlay ................................................................... 115
6-8 Selecting center and radius of circle ................................................................................ 116
6-9 Bitmap window with quit dialog box .............................................................................. 118
6-10 ASCII array representing the pound sign ...................................................................... 119
6-11 /tmp/gumby.array ............................................................................................................ 120
6-12 Bitmap of the Gumby cursor .......................................................................................... 121
6-13 gumby.array padded by hyphens .................................................................................... 121
6-14 xmag window displaying magnified screen area .......................................................... 123
6-15 Displaying pixel statistics with xmag ............................................................................ 124
7-1 Two xclock displays: analog clock above digital clock ................................................. 130
7-2 oclock display .................................................................................................................... 131
7-3 Oblong oclock display ...................................................................................................... 131
7-4 The default xcalc (TI-30 mode) on the screen ................................................................ 132
7-5 xbiff before and after mail is received ............................................................................. 134
7-6 A sample xload window ................................................................................................... 134
7-7 Initial xman window ......................................................................................................... 135
7-8 Xman Options menu ......................................................................................................... 136
7-9 cd reference page displayed in xman window ................................................................ 137
7-10 Xman Sections menu ...................................................................................................... 138
7-11 Release 3 Xman Options menu ...................................................................................... 139
7-12 Selecting the window to be removed ............................................................................. 142
7-13 Window information displayed by xwininfo ................................................................ 145
7-14 Window tree displayed by xlswins ................................................................................ 147
7-15 Window tree with geometry specifications ................................................................... 147
7-16 Long xlsclients listing ..................................................................................................... 149
7-17 A dialog box with Yes, No, and Cancel command buttons .......................................... 151
7-18 An xterm window with scrollbar ................................................................................... 153
7-19 Vertical panes and grips in the xmh client .................................................................... 154
7-20 xman uses a viewport widget ......................................................................................... 155
8-1 Window offsets .................................................................................................................. 167
8-2 Multiple planes used to index a colormap ....................................................................... 175
9-1 Selected text appears automatically in the xclipboard window .................................... 192
9-2 A sample resources file ..................................................................................................... 193
11-1 Partial keymap table ....................................................................................................... 232
11-2 xev window ..................................................................................................................... 233
11-3 Pointer map ...................................................................................................................... 237
A-1 Display after running sample script ................................................................................ 530
A-2 Default xdm-config file, Release 4 .................................................................................. 533
A-3 Default xdm-config file, Release 3 .................................................................................. 542
A-4
B-I
B-2
B-3
B-4
B-5
B-6
B-7
B-8
Typical Xservers file for a workstation, Release 3 ........................................................ 542
WindowOps menu ............................................................................................................ 557
A default-size xterm window .......................................................................................... 558
A custom-size xterm window .......................................................................................... 559
A maximum-height xterm window ................................................................................. 560
Moving windows or icons ................................................................................................ 561
Resizing a window ........................................................................................................... 562
One xterm window overlapping another ........................................................................ 563
Raising a window ............................................................................................................. 564
B-9 The login window is about to become an icon ............................................................... 566
B-10 The login window is about to be deiconified ................................................................ 567
B- 11 Preferences menu ............................................................................................................ 571
C-1 mwm is running on the display ........................................................................................ 593
C-2 An xterm window running with the OSF/Motif window manager ............................... 594
C-3 Moving a window by dragging the title area .................................................................. 595
C-4 Converting a window to an icon with the Minimize button .......................................... 596
C-5 xterm window icon under mwm ...................................................................................... 597
C-6 Maximizing a window ..................................................................................................... 598
C-7 The outer frame is divided into four long borders and four corners ............................. 599
C-8 Window with resizing pointer ......................................................................................... 600
C-9 Resizing pointer symbols ................................................................................................. 600
C-10 Dragging the corner to make a window larger ............................................................. 601
C-I 1 The Window Menu ......................................................................................................... 603
C-12 The mwm Root Menu .................................................................................................... 609
C-13 An arrow pointing to the right indicates a submenu .................................................... 621
C-14 Utilities submenu of the Root Menu ............................................................................. 622
C-15 An icon box ..................................................................................................................... 626
C-16 In the resized icon box, only three icons are visible .................................................... 628
C-17 Packlcons menu item rearranges icons in resized box ................................................ 628
D-1 The Standard Cursors ....................................................................................................... 635
G-1 The Standard Bitmaps ...................................................................................................... 694
Examples
5-1
5-2
9-1
10-1
10-2
10-3
10-4
10-5
10-6
10-7
A-1
C-1
E-1
Page
Subsection of the Release 4 fonts.dir file in/usr/lib/X11/fonts/100dpi .......................... 92
Sample fonts.alias file entries ............................................................................................. 93
Sample resources ............................................................................................................... 187
The system.twmrc file from the MIT distribution ........................................................ 203
The Utilities menu ........................................................................................................... 209
The Preferences menu ..................................................................................................... 210
Window operations divided into three menus .............................................................. 210
A Useful Commands menu ............................................................................................. 211
A menu with color definitions ........................................................................................ 212
Modified .twmrc file ........................................................................................................ 214
Startup Bourne shell script .............................................................................................. 528
The system.mwmrc file, Release 1.0 ............................................................................... 612
xshowfont source listing .................................................................................................. 674
xv/
Tables
3-1.
4-1.
4-2.
4-3.
5-1.
5-2.
5-3.
5-4.
8-1.
8-2.
9-1.
A-1.
C-1.
C-2.
D-1.
E-1.
E-2.
E-3.
E-4.
E-5.
E-6.
G-1.
H-1.
H-2.
H-3.
Page
Keyboard Shortcuts for Window Manager Functions ................................................... 45
VT Fonts Menu Defaults ................................................................................................. 58
Button Combinations to Select Text for Copying .......................................................... 62
Command Buttons and Functions ................................................................................... 69
Fixed Font Aliases and Font Names ............................................................................... 83
Essential Elements of a Font Name ................................................................................ 90
Standard Font Directories, Releases 3 and 4 .................................................................. 91
Fonts in the Standard Distribution, Release 2 .............................................................. 105
Standard Options ............................................................................................................ 163
Geometry specification x and y offsets ........................................................................ 166
Core Toolkit Resources .................................................................................................. 187
xdm Special Files .......................................................................................................... 533
Window Menu Actions on an Icon .............................................................................. 608
Resource Names Corresponding to mwm Components ............................................. 623
Standard Cursor Symbols ............................................................................................. 634
Fonts in the misc Directory, Release 4 ......................................................................... 640
Fonts in the 75dpi Directory, Release 4 ....................................................................... 64 1
Fonts in the 100dpi Directory, Release 4 ..................................................................... 646
Fonts in the misc Directory, Release 3 ......................................................................... 651
Fonts in the 75dpi Directory, Release 3 ....................................................................... 651
Fonts in the 100dpi Directory, Release 3 ..................................................................... 654
Standard Bitmaps Available as of Release 4 .............................................................. 693
Event Types and Their Abbreviations ......................................................................... 697
Key Modifiers ................................................................................................................ 699
Event Modifiers and their Meanings ............................................................................ 700
xv//
Preface
By convention, a preface introduces the book itself, while the introduction
starts in on the subject matter. You should read through the preface to get
an idea of how the book is organized, the conventions it follows, and so on.
In The Preface:
Assumptions ......................................................................................... xxi
Organization ......................................................................................... xxii
Bulk Sales Information ......................................................................... xxiv
xshowfonts.c ....................................................................................... xxiv
Acknowledgements ............................................................................. xxiv
Font and Character Conventions .......................................................... xxv
Organization
The book contains the following parts:
Part One: Using X
Preface
Describes the book's assumptions, audience, organization, and conventions.
Chapter 1: An Introduction to the X Window System
Describes the basic terminology associated with the X Window System: server,
client, window, etc. The most important X clients are described.
Chapter 2: Getting Started
Shows the basics of using X: starting the server and creating the first terminal
window; starting the window manager; adding additional windows; exiting.
This chapter is tutorial in nature: you can follow along at a workstation as you
read.
Chapter 3: Using the twm Window Manager
Describes how to use the twm window manager. This client is used to manipu-
late windows on the screen.
Chapter 4: The xterm Terminal Emulator
Describes how to use the xterm terminal emulator, the most frequently-used cli-
ent. Certain aspects of xterm operation described in this chapter, such as scrol-
ling and "copy and paste," are common to other applications as well.
Chapter 5: Font Specification
Describes the somewhat complicated font naming conventions and ways to sim-
plify font specification, including wildcarding and aliasing. Describes how to
use the xlsfonts, xfd, and xfontsel clients to list, display, and select available dis-
play fonts. Since the available fonts and font naming conventions changed radi-
cally from Release 2 to Release 3, this chapter also reviews these changes.
Chapter 6: Graphics Utilities
Explains how to use the major graphics clients included with X, notably the bit-
map editor.
Chapter 7: Other Clients
Gives an overview of other clients available with X, including window and dis-
play information clients, the x.kill program, and several "desk accessories."
Part Two: Customizing X
Chapter 8: Command Line Options
Discusses some of the command line options that are common to most clients.
xxii X Window System User's Guide
Chapter 9: Setting Resources
Tells how to use create an .Xresources file, or other file, to set resources for client
applications. This chapter also describes how to use xrdb, which saves you hav-
ing to maintain multiple .Xresources files if you run clients on multiple
machines.
Chapter 10: Customizing the tan Window Manager
Describes the .twmrc file by showing the default file shipped by MIT, and then
examining the purpose and syntax of entries. Explains various techniques for
revising the .twmrc file to modify existing menus and create new ones. A
revised .twmrc file is also offered for users to copy.
Chapter 11: Setup Clients
Describes how to set display and keyboard preferences using xset and how to set
root window preferences using xsetroot. Demonstrates how to redefine the logi-
cal keynames and pointer commands recognized by X using xmodmap.
Part Three: Client Reference Pages
Extended reference pages for all clients.
Part Four: Appendices
Appendix A: System Management
Appendix B: The uwm Window Manager
Appendix C: The OSF/MotifWindow Manager
Appendix D: Standard Cursors
Appendix E: Release 3 and 4 Standard Fonts
Appendix F: xterm Control Sequences
Appendix G: Standard Bitmaps
Appendix H: Translation Table Syntax
Glossary
Index
Preface xxiii
Courier italics are used within examples or explanations of command syntax to
show a parameter to a command that requres context-dependent
substitution (such as a variable). For example, fil ename means
to use some appropriate filename; opti on (s) means to use some
appropriate option(s) to the command.
Helvetica
is used to show menu titles and options.
The following symbols are used within the X Window System User's Guide:
[]
$
%
name(l)
surround an optional field in a command line or file entry.
is the standard prompt from the Bourne shell, sh(1).
is the standard prompt from the C shell, csh(1).
is a reference to a command called name in Section 1 of the UNIX
Reference Manual (which may have a different name depending on
the version of UNIX you use).
xxvi X Window System User's Guide
Part One:
Using X
Part One provides an overview of the X Window System and concepts, and
describes how to use the most important programs avaTable in the X
environment.
An Introduction to the X Window System
Getting Started
Using the twm Window Manager
The xterm Terminal Emulator
Font Specification
Graphics Utilities
Other Clients
1
An Introduction to the
X Window System
This chapter describes the features of a typical X display, while introducing
some basic window system concepts. It also provides an overview of the X
Window System's client-server architecture and briefly describes the most
commonly used clients.
In This Chapter:
Anatomy of an X Display ......................................................................... 5
X Architecture Overview ........................................................................ 10
The X Display Server ............................................................................. 11
Clients ................................................................................................... 12
The Window Manager ........................................................................ 13
The xterm Terminal Emulator ............................................................. 14
The Display Manager ......................................................................... 14
Other X Clients .................................................................................. 14
Customizing Clients ........................................................................... 15
1
An Introduction
to the X Window System
The X Window System, called X for short, is a network-based graphics window system that
was developed at MIT in 1984. Several versions of X have been developed, the most recent
of which is X Version 11 (X11), first released in 1987.
X 11 has been adopted as an industry-standard windowing system. X is supported by a con-
sortium of industry leaders such as DEC, Hewleu-Packard, Sun, IBM, and AT&T that have
united to direct, contribute to, and fund its continuing development. In addition to the system
software development directed by the X Consortium, many independent developers are pro-
ducing application software specifically for use with X. Because X11 is a relatively new
standard, much of this application software has yet to be released.
First, we'll take a look at a typical X display and consider some general system features.
Then we'll discuss what distinguishes the X Window System from other window systems.
We'll also briefly consider some of the more important programs included in the standard
distribution of X.
Anatomy of an X Display
X is typically run on a workstation with a large screen (although it also runs on PCs and spe-
cial X terminals, as well as on many larger systems). X allows you to work with multiple
programs simultaneously, each in a separate window. The display in Figure 1-1 includes five
windows.
The operations performed within a window can vary gready, depending on the type of pro-
gram running it. Certain windows accept input from the user. they may function as termi-
nals, allow you to create graphics, etc. Other windows simply display information, such as
the time of day or a picture of the characters in a particular font, etc.
The windows you will probably use most frequently are terminal emulators, windows that
function as standard terminals. The terminal emulator included with the standard release of
X is called xterm. Figure 1-1 depicts three xterm windows. In an xterm window, you can do
anything you might do in a regular terminal: enter commands, run editing sessions, compile
programs, etc.
An Introduction to the X Window System 5
r--
X cursor which appears in the root window.
I-beam cursor, which appears within xterm
windows.
Menu arrow cursor, which points at menu items
currently selected.
Upper left and lower right corner cursors,
which allow interactive placement of client
windows when using twm.
Filled circle, which allows targeting of window to
be acted on by twm for certain functions (setting
focus, raising, lowering, etc.)
Cross cursor, which is used to resize and move
windows via twin.
Skull and crossbones cursor, which is used to
select the window to be removed with the Delete
and Kill commands on the Twm menu.
Figure 1-2. Some standard cursors
You use the pointer to manipulate windows and icons, to make selections in menus, and to
sclect the window in which you want to input. You can't type in an xterm window unless you
place the pointer in that window, as in Figure 1-3.
Directing input to a particular window is called focusing. You must be sure that the pointer
rests in the desired window before you begin typing. The window border (if present) and text
cursor are also highlighted when the pointer is in that window. The highlighting is a charac-
teristic ofxterm: other applications may not highlight display features.
The fact that input focus automatically follows the pointer is a default characteristic of the
twm window manager. Other window managers require you to click on a window to focus
input on that window. These two window manager focusing styles are commonly referred to
as "real-estate-driven" (or "pointer focus") and "click-to-type."
The most important thing to recognize is that the position of the pointer is very important to a
real-estate-driven window manager like twm. If something doesn't work the way you expect,
make sure that the pointer is in the right place. After you use X for a while, awareness of
pointer position will come naturally.
Be aware that it may take a moment for the input focus to catch up with the pointer, espe-
cially on slower machines. If you type right away, some keystrokes may end up in the win-
dow you left rather than in the new window. This is really a bug and happens because of the
additional overhead involved in complex window managers like twm or mwm. It doesn't
happen if you are using a simpler window manager like uwm.
8 X Window System User's Guide
%|
Figure 1-3. Focus on an xterm window
The pointer is also often used to display menus. Some X programs, notably twm and xterm,
have menus that are displayed by keystrokes and/or pointer button motions. Unlike some
window systems, which allow you to "pull down" menus from a menu bar that is always
displayed, twm (and most X clients) support "pop-up" menus, which are displayed at the cur-
rent pointer position. In addition to keyboard keys and pointer button motions, the location
of the pointer also plays a role in displaying menus. For example, xterm menus can only be
displayed when the pointer is within an xterm window. Figure 1-4 shows a twm menu called
Twm, which is displayed by placing the pointer on the root window and holding down the
first pointer button.
You generally display this menu by moving the pointer to the root window and pressing and
holding down the first pointer button. In Figure 1-4, the arrow next to the menu title repre-
sents the pointer. As you drag the pointer down the menu, each of the menu selections is
highlighted. Regardless of the program, you generally select a menu item by dragging the
pointer down the menu, highlighting the item you want, and releasing the pointer button.
With other programs, particularly several other window managers, you can display a menu
simply by placing the pointer on a particular part of the window, e.g., a horizontal bar across
the top.
A final note about the X display: in X, the terms display and screen are not equivalent. A
display may consist of more than one screen. This feature might be implemented in several
ways. There might be two physical monitors, linked to form a single display, as shown in
Figure 1-5. Alternatively, two screens might be defined as different ways of using the same
An Introduction to the X Window System 9
Personal Computer
Supercomputer
' Local
Display Server
Large Minicomputer
Figure 1-6. A sample X Window System configuration
Clients
X allows you to run many clients simultaneously. For example, you could be editing a text
file in one window, compiling a program source file in a second window, reading your mail in
a third, all the while displaying the system load average in a fourth window.
While X clients may display their results and take input from a single display server, they
may each be running on a different computer on the network. It is important to note that the
same programs may not look and act the same on different servers since there is no standard
user interface, since users can customize X clients differently on each server, and since the
display hardware on each server may be different.
Several of the more frequently used client programs are discussed in the following
paragraphs.
12 X Window System User's Guide
2
Getting Started
This chapter shows you how to begin working if X is already running on your
system and how to start the X server manually if X is not running. It also pro-
vides preliminary instructions for starting the window manager, twm, and the
xterm terminal emulator.
In This Chapter:
If X is Being Started Automatically ......................................................... 19
Starting X Manually ............................................................................... 22
Starting the First xterm Window ......................................................... 22
Bringing Up the Window Manager ...................................................... 23
Starting a Second xterm Window ........................................................... 23
Exiting from an xterm Window ............................................................... 25
Special Keys .......................................................................................... 26
How a Client Looks and Behaves: Application Defaults ......................... 26
Starting Other Clients ............................................................................ 27
Running a Client on Another Machine .................................................... 28
Where to Go From Here ........................................................................ 30
X
Figure 2-1. Workstation with Iogin xterm window on the root window
If the display manager, xdm, is running X on your system, you may see a window similar to
Figure 2-2 when you turn on your terminal.
Log in just as if you were using a standard alphanumeric terminal. The screen should then
display the first xterm window, as in Figure 2-1.
Without any user customization, the display manager executes a standard login "session,"
providing the first xterm window and starting the window manager. If the window manager
is running, you will see a titlebar on your window, displaying the name of the window
("xterm").
If the twm window manager is running, skip to the section "Starting a Second xterm Win-
dow" later in this chapter for information on starting additional windows and other clients. If
the window manager is not running, skip to the section "Bringing Up the Window Manager"
later in this chapter for instruction on how to start it.
On BSD 4.3 systems, there is another method to bring up X automatically (from the letclttys
system file). This method has been phased out in Release 4. However, if your system is set
up to use this method, when the power is turned on, your workstation should automatically
start the server and open up an xterm window in which you can log in. If this is the case,
your screen should look something like Figure 2-3.
20 X Window System User's Guide
I I
I I
Figure 2-2. xdm Iogin window
__
Figure 2-3. xterm window w#h Iogin prompt
Getting Started 21
Bringing Up the Window Manager
Make sure that the pointer is in the xterm window, so that the I-beam cursor is displayed.
Start the twm window manager by typing:
The screen will momentarily go blank; then the window will be redisplayed, this time with a
titlebar. The titlebar provides a quick and easy way to move, resize, and otherwise manipu-
late windows on the screen. The window manager also allows you to position client win-
dows on the screen, as illustrated by the placement of the xterm window described in the next
section.
Note that it is important to run twm in the background by placing an ampersand (&) at the
end of the command line, so that you can continue to enter additional commands into the
xterm window. If you neglected to do this on a system that supports job control, type
Control-Z to suspend twm, then use the bg command (see csh(1)) to place it in the back-
ground.
If the system you're on does not support job control, interrupt the process with Delete or
Control-C and start over.
Starting a Second xterm Window
If you want to open a second xterm window, type the following command at the prompt in
the first xterm window:
:c...o-"n &
After a few moments, the pointer becomes an upper-left-corner cursor, as shown in Figure
2-4.
This corner cursor represents the upper-left corner of the window you want to place. The
cursor tracks pointer movement as you move the pointer across your screen and allows you to
position the xterm window.
Move the corner cursor to the desired position on your screen and click the left mouse button.
(A click is defined as pressing the mouse button down and releasing it.) A new xterm win-
dow appears on your screen, with a prompt from whatever shell you are using. Figure 2-5
shows how your screen might look now.
Getting Started 23
[] xterm
% twin&
% xterm&
[
Figure 2-4. Placing a second xterm window
[] xterm []
% twin&
% xterm&
%
Figure 2-5. Two xterm windows
24 X Window System User's Guide
Special Keys
Most workstations have a number of "modifier" keys, so called because they modify the ac-
tion of other keys.
Three of these modifier keys should be familiar to any user of a standard ASCII terminal or
personal computer--Shift, Caps Lock, and Control. However, many workstations have addi-
tional modifier keys as well. A PC has an "Alt" key, a Macintosh TM has a "fan" key, a Sony
workstation has keys named "Nfer" and "Xfer," and a Sun workstation has no less than three
additional modifier keys, labeled "Left," "Right," and "Alternate."
Because X clients are designed to run on many different workstations, with different key-
boards, it is difficult to assign functions to special keys on the keyboard. A developer can't
count on the same key always being present!
For this reason, many X clients make use of "logical" modifier keynames, which can be
mapped by the user to any actual key on the keyboard.
Up to eight separate modifier keys can be defined. The most commonly used (after Shift,
Caps Lock, and Control) has the logical keyname "Meta."
We'll talk at length about this subject in Chapter 11, Setup Clients, but we wanted to warn
you here. When we talk later in this book about pressing the "Meta" key, you should be
aware that there is not likely to be a physical key on the keyboard with that name. For ex-
ample, on one workstation, the Meta key might be labeled "Alt" and, on another, "Funct."
And as we'll show in Chapter 11, you can choose any key you want to act as the Meta key.
Unfortunately, X provides no easy way to find out which key on your keyboard has been as-
signed to be the Meta key. You don't need to know this right away.., but when you do,
please turn to the discussion of key mapping in Chapter 11, Setup Clients, for information on
how you can find out.
How a Client Looks and Behaves: Application Defaults
The way the xterm client looks (and, to some extent, behaves) is partially determined by a
system-wide file of application defaults. Several clients have application defaults files that
determine certain of the client's features. Applications defaults files generally reside in the
directory lusrllibIXlllapp-defaults and are named for the client application. For xterm, the
application defaults specify such things as the labels for menu items, the fonts used to display
menu items, and the shape of the pointer when it's in an xterm window.
In describing the appearance and behavior of clients in this guide, we assume all of the stan-
dard application defaults file are present on your system and accessible by the client pro-
grams. If, by some chance, a client's application defaults file has been edited or removed
from your system, the client may not look or behave exactly as we describe it. If a client ap-
plication appears substantially different than it is depicted in this guide, you may be using a
different version of the program or the application defaults may be different. Consult your
system administrator.
26 X Window System User's Guide
Within an application defaults file, defaults are set using variables called resources. Almost
every feature of every client program can be controlled by a resource variable. The resource
variables specified in a client's application defaults files are usually just a subset of a greater
number of resources that can be set.
As we'll see in Chapter 9, Setting Resources, you can override the system-wide defaults and
control additional features of a client by specifying your own resources in a file in your home
directory.
Starting Other Clients
You can start other X clients just like you can start another instance of xterrn. At the com-
mand line prompt in any xterm window, type the name of the client followed by an amper-
sand to make the client run in the background. For example, by typing:
oclock &
you can cause a window displaying a clock to be placed on the screen. (The oclock client is
available as of Release 4. If you are running an earlier release of X, the only clock program
available is xclock.) First an upper-left comer cursor will appear, just as it did when you
created a second xterm window. Move the comer cursor to the position you would like the
clock to appear, and then click the left mouse button. Figure 2-6 shows the oclock display,
placed in the upper-right comer of the screen.
Unfortunately, the developers of oclock neglected to provide an easy way to remove it. One
way to remove the oclock display is to identify and kill the process using the standard UNIX
process control mechanisms. To find the process ID for oclock, go to an xterm window and
type:
% ps-aux I grep oclock
at a system prompt. Under System V, type:
% ps-e I grep oclock
at a system prompt. The resulting display should look something like this:
128 p0 0 : 00 oclock
142 p0 0:00 grep oclock
The number in the first column is the process ID. Type:
% kill process_id
The oclock display will be removed, and you will get the message:
Terminated oclock
You can also remove the oclock display using other methods intended to "kill" the client pro-
cess. These methods and their liabilities are discussed in Chapter 7, Other Clients.
If you are running Release 2 or 3 of X, the xclock client must also be removed using the
UNIX kill command (or another method of killing a client, as described in Chapter 7). As of
Release 4, xclock can also be removed by a gentler method, namely, the Delete item of the
Getting Started 27
[] xterm [] - " ........... ' :.:. ii:.i, "
:! [] oclock []
% twm& ....... :.::-
,o xterm& . .-- ....
_.,
% oclock&
%!
Figure 2-6. The oclock display
Twm menu. See Chapter 3, Using the twm Window Manager, for more information about De-
lete.
Running a Client on Another Machine
Remember that X also allows you to run a client on another machine, while displaying the
client's window on the local machine. A client you may wish to run on another machine is
xload, which is used to keep track of the system load average. By default, xload polls the
system for the load average at five-second intervals and displays the results in a simple histo-
gram.
If you are running processes on more than one machine, it's useful to gauge the level of ac-
tivity on the systems in question. This information should help you judge when to start
processes and monitor how your processes are impacting system resources.
Say you're running clients both on the local machine (let's call it hostl) and on another
machine (host2). On the local display, you can have two xload windows, one showing activ-
ity on hostl and one showing activity on host2.
To create an xload window monitoring activity on hostl, use the command:
% xload &
28 X Window System User's Guide
The cursor changes to an upper-left comer cursor, allowing you to place the window.
Then run an xload process on host2 using a remote shell (rsh), and display the results in a
window on hostl:
% rsh host2 'xload -display hostl:O' &
Again, you place the window using the pointer.
The -diaplay option tells xload to create its window on the local display (host1). The
syntax and use of this option is discussed more fully in Chapter 8, Command Line Options.
Figure 2-7 shows the resulting host1 display: two xload windows, the top window monitor-
ing activity on the local system and the bottom one monitoring activity on the remote system.
[] xterm []
% twm&
% xlerm&
%
ocIock&
xload &
rsh host2 'xload -display host1 :O'&
Figure 2-7. Monitoring activity on two systems with xload
If you frequently need to access a remote system, you may want to run an xterm on that sys-
tem using a remote shell and display the window on the local system. For instance, the fol-
lowing command runs an xterm on a remote Sony NEWS workstation (with the hostname
aony) and displays on the local Sun-3 (with the hostname sun):
% rsh sony 'xterm -display sun:O' &
Getting Started 29
Where to Go From Here
There are many useful client programs supplied with the X Window System. Details of how
to use the two most important of these clients, the twin window manager and the xterm termi-
nal emulator are provided in the next two chapters. Clients to list and display fonts are de-
scribed in Chapter 5. Chapter 6 describes several graphics utilities available with X. An
overview and tutorial for other clients is provided in Chapter 7. All clients are described in
detail in a reference page format in Part Three of this guide.
You should read at least the chapter on twin before starting up any other clients. You can
then go on to read more about xterm in Chapter 4 or about other clients in Chapters 5 through
7.
30 X Window System User's Guide
3
Using the twm Window Manager
This chapter describes twm, the standard window manager distributed with
X. Additional information on customizing the operation oftwm is provided in
Chapter 10.
In This Chapter:
Starting the Window Manager ................................................................ 34
Titlebars ................................................................................................ 34
The Twm Menu ...................................................................................... 35
Displaying Windows as Icons ............................................................. 36
Resizing Windows ............................................................................. 38
Moving Windows and Icons ............................................................... 39
Shuffling the Window Stack: Raise and Lower .................................. 40
Raising Windows (bringing in front of others) ................................... 41
Lowering Windows (sending behind others) ..................................... 42
Changing Keyboard Focus ................................................................. 43
Removing a Window: Delete and Kill .................................................. 43
Restarting the Window Manager ........................................................ 44
Exiting the Window Manager ............................................................. 44
Button Control of Window Manager Functions ........................................ 45
Using twm to Place Other Clients ........................................................... 45
Customizing twm ................................................................................... 46
Some of My Keystrokes are Missing ...................................................... 46
application
title
iconify I- xt
rm
button
I
resize
button
Figure 3- I. Anatomy of a twm titlebar
These functions can also be invoked from a menu and will be discussed more thoroughly in
the next section.
The Twm Menu
twm's Twm menu gives you access to many of the most frequently used window manipulation
functions. In the standard version of twm shipped by MIT, you bring up this menu by moving
the pointer to the root window and holding down the left pointer button. The Twm menu and
the menu pointer appear as shown in Figure 3-2.
The following pages explain the functions of the Twm menu. Remember that all of the win-
dow manager functions are customizable. Items can be added to or deleted from this menu,
and new menus can be defined by modifying the .twmrc window manager startup file, as
described in Chapter 10, Customizing the twm l&indow Manager. The current chapter
describes the window manager as it is shipped with the standard release of the X Window
System from the MIT X Consortium.
To bring up the Twm menu, move the pointer to the root window and hold down the left but-
ton on the pointer. To select a menu item, continue to hold down the left button and move the
pointer to the desired menu item. A horizontal band, or highlighting bar, follows the pointer.
When you've highlighted the desired menu item, release the button. The selected function
will be executed.
o io
Using the twm Window Manager 35
Figure 3-2. Twm menu
Some of the functions on the menus can be invoked simply by pressing a combination of
pointer buttons and keyboard keys. We discuss these "keyboard shortcuts" as appropriate
when discussing each menu function, and summarize them in Table 3-1 later in this Chapter.
Some of these shortcuts make use of the "Meta" modifier key. See Chapter 11, Setup Clients,
for a discussion of how to determine which key on your keyboard serves as the Meta key.
(For the Sun-3 keyboard, for example, Meta is either of the keys labeled "Left" or "Right.")
Displaying Windows as Icons
If you want to make rnore space available on your screen, you can convert a window into an
icon. An icon is a small symbol that represents the application window. You can also con-
vert the icon back into a window, as shown in Figure 3-3 and Figure 3-4.
To convert a window to an icon:
1. Bring up the Twm menu.
2. Select Iconify with the menu pointer. The pointer changes to the target pointer.
3. Move the target pointer to the desired window.
4. Click the left button. The window is converted to an icon.
36 X Window System User's Guide
[] xterm
% lwm&
% ocIock&
%
'i xterm
xterm&
.
Twin
Resze
Move
Raise
Lower
Focus
Un|ocus
Show Iconmgr
Hide Iconmgr
Kill
Delete
Restart
Exit
Figure 3-3. The Iogin window-is about to become an icon
Twin
Reslze
Move
Raise
Lower
Focus
Unfocus
Show Iconmgr
Hide Iconmgr
Kill
Delete
Restart
Exit
..:,
Figure 3-4. The Iogin window is about to be deiconified
Using the twm Window Manager 37
To display an icon as its original window, simply click the left button on the icon. twm has a
couple of advanced techniques for managing icons. One, the Icon Manager, will be dis-
cussed in the next section. The other, the Icon Region, is documented in the twm man page.
The leon Manager
The Show Iconmgr and Hide Iconmgr menu items control a twm feature called the Icon Man-
ager. The Icon Manager is a small, menu-like window that contains one entry for each win-
dow on the screen. An iconified window will have a small X before it; a window can be
iconified and deiconified just by clicking on its entry in the Icon Manager. The Icon Manager
also highlights the window with the current input focus.
By using the Icon Manager in conjunction with the variable IconifyByUnmapping, you
can keep all your icons conveniently in one place, and avoid searching for icons that have
been hidden under other windows. See Chapter 10, Customizing the twm Window Manager,
for information on setting variables in twm.
Resizing Windows
The Resize menu item resizes an existing window. See Figure 3-5. To resize a window:
1. Bring up the Twin menu.
2. Select Resize with the menu pointer. The pointer changes to the cross pointer.
3. Move the cross pointer to the window you want to resize. Place it near the border you
want to move. The opposite border remains in its current position.
4. Hold down any button.
5. Move the pointer across the border you want to change, then move the window's border
to obtain the desired window size. As you resize the window, a digital readout appears
opposite the pointer showing the window size in pixels. (For the xterm client, size is in
characters and lines.) Release the button.
Resizing an xterm window will not change the dimensions of the text currently in the win-
dow. (If you make the window smaller, for instance, some of the text may be obscured.)
However, if the operating system supports terminal resizing capabilities (for example, the
SIGWINCH signal in systems derived from BSD 4.3), xterm will use these facilities to notify
programs running in the window whenever it is resized. As you continue to work, perhaps
starting an editing session, the program will use the entire window. If you resize during an
editing session, the text editing program may not know about the new size, and may operate
incorrecdy. Simply quitting out of the editor and starting another session should solve this
problem.
If your resized xterm window does not seem to know its new size, you may be working with
an operating system that does not support terminal resizing capabilities. Refer to the discus-
sion of the resize client in Chapter 4, The xterm Terminal Emulator, (and to the resize refer-
ence page in Pan Three of this guide) for alternative solutions.
38 X Window System User's Guide
,
[] xterm
oclock&
Figure 3-6. Moving windows or icons
You can also move a window or icon simply by moving the pointer to the window or icon
you want to move, then pressing the right pointer button while holding down the Meta key.
The pointer at first changes to a small image of an icon. You can now let go of the Meta key.
Then, as you drag the pointer while holding down the button, the pointer changes to a cross,
while the window or icon changes to outline form. Drag the outline to the new location, and
let go of the right button. The window will be redrawn in the new location.
Shuffling the Window Stack: Raise and Lower
Under the X Window System, windows can overlap each other. When windows overlap, one
or more windows may be fully or partially hidden behind other windows (see Figure 3-7).
You can think of these windows as being stacked on top of each other much the way papers
are stacked on a desk. twm can control the stacking order of the windows by lowering a par-
ticular window to the bottom of the stack or raising it to the top.
40 X Window System User's Guide
Figure 3-7. One xterm window overlapping another
Raising Windows (bringing in front of others)
The Raise menu item places a window at the top of a window stack. See Figure 3-8. To
bring a window to the front:
1. Bring up the Twm menu.
2. Select Raise with the menu pointer. The pointer changes to the target pointer.
3. Move the target pointer to the desired window.
4. Click any button. The window is raised to the top of the stack.
Using the twm Wtndow Manager 41
Changing Keyboard Focus
Normally, keyboard input goes to whichever window the pointer is currently in. The Focus
option causes keyboard input to go only to a selected window (the focus window) regardless
of the position of the pointer.
Focusing can be useful if you are working in one window for an extended period of time, and
want to move the pointer out of the way. It also prevents the annoying situation in which you
inadvertently knock the pointer out of the window while typing. (This can be very important
for touch typists who look infrequently at the screen while typing!)
To choose a focus window:
1. Bring up the Twm menu.
2. Select Focus with the menu pointer. The pointer changes to the target pointer.
3. Move the target pointer to the window you want to choose as the focus window.
4. Click any button to choose the window.
The titlebar of the focus window will remain highlighted, no matter where you move the
pointer.
In order to take the focus away from the selected window (and reactivate "pointer focus"),
select Unfocus. The keyboard focus will once again follow the pointer into any window.
Removing a Window: Delete and Kill
The Delete and Kill menu items provide two different ways of terminating a client window.
Most windows can be removed in ways that do not harm relevant processes. Delete is one of
these ways. It simply requests that the client close itself down gracefully.
Like other methods of "killing" a program (such as the xkill client), the Kill menu item can
adversely affect underlying processes. Kill is intended to be used primarily after more con-
ventional methods of removing a window have failed.
To remove a window:
1. Bring up the Twm menu.
2. Select Delete with the menu pointer. The pointer changes to the skull and crossbones
pointer.
3. Move the pointer into the window you want to terminate.
4. Click any pointer button.
The window should go away. It may, instead, beep and remain on your screen. You have a
stubborn window, which can be killed in the following way:
Using the twm Window Manager 43
1. Bring up the Twin menu.
2. Select Kill with the menu pointer. The pointer changes to the skull and crossbones pointer.
3. Move the pointer into the window you want to terminate.
4. Click any pointer button.
Th window will go away.
Refer to the section on xkill in Chapter 7, Other Clients, for a more complete discussion of
the hazards of killing a client and a summary of alternatives.
Restarting the Window Manager
The Restart menu item restarts the window manager. This may occasionally become neces-
sary if the window manager functions improperly. To stop and restart the window manager:.
1. Bring up the Twm menu.
2. Select Restart with the menu pointer.
You may also want to restart the window manager if you edit your .twmrc configuration file
to change the functionality of twm. See Chapter 10, Customizing the twm Window Manager,
for more information.
Note that when the window manager is stopped, all icons revert to windows. This happens
because the window manager is what allows windows to be iconified. When the window
manager is restarted, you can iconify the windows again.
Exiting the Window Manager
The Exit menu item stops the window manager. You may want to stop twm in order to start
another window manager. To stop twm:
1. Bring up the Twm menu.
2. Select Exit with the menu pointer.
The window manager is stopped. All icons revert to windows.
44 X Window System User's Guide
Some of My Keystrokes are Missing
If you are running Release 4, especially if you are running on a small or slow system, you
may notice that the system can't keep up with the movement of the pointer. You may move
from one window to another and begin typing, only to find that your first few characters were
entered into the original window, or dropped into intervening windows.
This annoying problem is caused by a subtle interaction between the operating system, the X
server, and the window manager. It is unlikely to be fixed in the near future, but twm pro-
vides a workaround: setting the variable roT].t:l.eFocus in your .twmrc file should keep
the bug from popping up. See Chapter 10 for information on creating a .twmrc file and set-
ting variables.
46 X Window System User's Guide
4
The xterm Terminal Emulator
This chapter describes how to use xterm, the terminal emulator. You use this
client to create multiple terminal windows, each of which can run any pro-
grams available on the underlying operating system.
In This Chapter:
The Release 4 xterm Menus .................................................................. 50
The xterm Menus at a Glance ............................................................ 50
The Main Options Menu ..................................................................... 52
VT Options Menu ............................................................................... 55
VT Fonts Menu .................................................................................. 57
Tek Options Menu .............................................................................. 58
Using the Scrollbar ................................................................................ 59
Copying and Pasting Text Selections ..................................................... 61
Selecting Text to Copy ....................................................................... 62
Pasting Text Selections ...................................................................... 64
Manipulating Text Selections .................................................................. 65
Copying and Pasting between Release 2 and 3 Clients: xcutsel ........ 66
Saving Multiple Selections: xclipboard (Release 4 Version) .............. 68
Problems with Large Selections ....................................................... 71
Editing Text Saved in the xclipboard ................................................ 71
Release 3 xclipboard ....................................................................... 72
Terminal Emulation and the xterm Terminal Type ................................... 73
Resizing an xterm Window ..................................................................... 74
Running a Program in a Temporary xterm Window ................................ 75
4
The xterm Terminal Emulator
xterm provides you with a terminal within a window. Anything you can do using a standard
terminal, you can do in an xterm window. Once you have an xterm window on your screen,
you can use it to run other clients.
You can bring up more than one xterm window at a time. For example, you might want to list
the contents of a directory in one window while you edit a file in another window. Although
you can display output simultaneously in several windows, you can type into only one win-
dow at a time.
Basic operation of xterm should be obvious to anyone familiar with a terminal. You should
be able to work productively immediately.
Among the less obvious features of xterm is a dual functionality. By default, xterm emulates
a DEC VT102 terminal, a common alphanumeric terminal type. However, xterm can also
emulate a Tektronix 4014 terminal, which is used to display graphics. For each xterm pro-
cess, you can switch between these two types of terminal windows. You can display both a
VT102 and a Tektronix window at the same time, but only one of them can be the "active"
window, i.e., the window receiving input and output. Hypothetically, you could be editing in
the VT102 window while looking at graphics in the Tektronix window.
You switch between the VT102 window and the Tektronix window using items from certain
xterm menus. The xterm client has four menus that can be used to manipulate the VT102 and
Tek windows, to select many terminal settings, and to run other commands that affect the
xterm process. We'll take a look at some of the more useful items on each menu as well as
some alternatives to menu items. For more complete information about menus, see the xterm
reference page in Part Three of this guide.
We'll also discuss two of xterrn's more important features: a scrollbar, which allows you to
review text in the window, and a "copy and paste" facility.
Finally, we'll consider problems involved in resizing an xterm window and how to run a pro-
gram in a temporary xterm window.
The xterm Tetminal Emulator 49
Main Options
Secure Keyboard
Allow SendEvents
Log to F=le
Redraw Window
Send STOP Signal
Send CONT Signal
Send INT Signal
Send HUP S0gnal
Send TERM Signal
Send KILL Signal
Quit
V'l" Opt=ons
Enable Scrollbar
Enable Jump Scroll
Enable Reverse Video
Enable Auto Wraparound
Enable Reverse Wraparound
Enable Auto Linefeed
Enable Application Cursor Keys
Enable Appl0cation Keypad
Scroll to Bottom on Key Press
Scroll to Bottom on Tty Output
Allow 80/132 Column Switching
Enable Curses Emulation
Enable Visual Bell
Enable Margin Bell
Show Alternate Screen
Do Soft Reset
Do Full Reset
Show Tek Window
Switch to Tek Mode
Hide VT Window
Tek Options
Large Characters
#2 Size Characters
#3 Size Characters
Small Characters
PAGE
RESET
COPY
Show VT Window
Switch to VT Mode
Hide Tek Window
VT Fonts
Default
Tiny
Small
Medium
Large
Escape Sequence
Selection
Figure 4-1. The Release 4 xterm menus
invoked from the xterm menus. However, some functions can be invoked in other ways:
from a twm menu, on the command line, by a sequence of keystrokes (such as Control-C).
This chapter includes alternatives to some of the menu items, alternatives which in certain
cases may be more convenient. Of course, the xterm menus can be very helpful when other
methods to invoke a function fail.
Menus are displayed by pressing a combination of keyboard keys and pointer buttons. (The
exact combination of keys and buttons is described below with each menu.) When you dis-
play an xterm menu, the pointer becomes the arrow pointer and initially appears in the
menu's title. Once the menu appears, you can release any keyboard key. The menu will
remain visible so long as you continue to hold down the appropriate pointer button.
If you decide not to select a menu item after the menu has appeared, move the pointer off the
menu and release the button. The menu disappears and no action is taken.
In the following discussions of the four xterm menus, we'll consider some of the more useful
items as well as some alternatives to menu items. For more complete information about each
menu, see the xterm reference page in Part Three of this guide.
The xterm Terminal Emulator 51
The Main Options Menu
The Main Options menu, shown in Figure 4-2, (formerly called the xterm menu) allows you to
set certain modes and to send signals (such as SIGHUP) that affect the xterm process.
To bring up the Main Options menu, move the pointer to the xterm window you wish to effect
changes on, hold down the Control key, and press the first (usually the left) pointer button.*
The pointer changes to the menu pointer, and the following menu of three modes and eight
commands appears. (You can release the Control key but must continue to press the first
pointer button to hold the Main Options menu in the window.)
Note that Main Options menu items apply only to the xterm window the pointer is in when
you display the menu. To effect changes in another xterm, you must move the pointer to that
window, display the menu, and specify the items you want.
Main Options
Secure Keyboard
Allow SendEvents
Log to File
Redraw Window
Send STOP Signal
Send CONT Signal
Send INT Signal
Send HUP Signal
Send TERM Signal
Send KILL Signal
Quit
Figure 4-2. The Main Options menu
To select a menu item, move the menu pointer to that item and release the first button. After
you have selected a mode (Secure Keyboard, Allow SendEvents, or Log to File), a check mark
appears before the item to remind you that it is active.-t" The Log to File mode on the Main
Options menu can also be set by a command line option when invoking xterm. In addition,
both Log to File and Allow SendEvents can be set by entries in a resource startup file like
.Xresources (see Chapter 9, Setting Resources). The menu selections enable you to change
your mind once xterm is running. (See the xterm reference page in Part Three of this guide
for more information on these modes.)
*The right button can be made to function as the "first" button. This is especially useful if you are left-handed. See
Chapter 11, Setup Clients, for instructions on how to customize the pointer with xmodmap.
fThe Allow SendEvents mode is available as of Release 4. Log to File is available in Release 3 as Logging. The equiv-
alent Release 3 menu (called xterm) also includes a Visual Bell mode toggle. As of Release 4, this item has been
renamed Enable Visual Bell and moved to the VT Options menu.
52 X Window System User's Guide
The Secure Keyboard mode toggle has been added to the menu (in a Release 3 patch) to help
counteract one of the security weaknesses of X. This mode is intended to be activated when
you want to type a password or other important text in an xterra window. Generally, when
you press a keyboard key or move the pointer, the X server generates a packet of information
that is available for other clients to interpret. These packets of information are known as
events. Moving the pointer or pressing a keyboard key causes input events to occur.
There is an inherent security problem in the client-server model. Because events such as the
keys you type in an xterra window are made available via the server to other clients, hypo-
thetically an adept system hacker could access this information. (Naturally, this is not an
issue in every environment.) A fairly serious breach of security could easily occur, for
instance, if someone were able to find out a user's password or the root password. Enabling
Secure Keyboard mode causes all user input to be directed only to the xterm window itself.
Of course, in many environments, this is probably not necessary: if the nature of the work is
in no way sensitive, if the system administrator has taken pains to secure the system in other
ways, etc. If your environment might be vulnerable, you can enable Secure Keyboard mode
before typing passwords and other important information and then disable it again using the
menu.
When you enable Secure Keyboard mode, the foreground and background colors of the xterm
window will be exchanged (as if you had enabled the Reverse Video mode from the VT
Options menu), as shown in Figure 4-3. When you disable Secure Keyboard mode, the colors
will be switched back.
Be aware that only one X client at a time can secure the keyboard. Thus, if you have enabled
Secure Keyboard mode in one xterm, you will not be allowed to enable it in another xterm
until you disable it in the first. If Secure Keyboard mode is not available when you request it,
the colors will not be switched and a bell will sound.
If you request Secure Keyboard mode and are not refused, but the colors are not exchanged,
be careful: you are not in Secure Keyboard mode. If this happens, there's a good chance that
someone has tampered with the system. If the application you're running displays a prompt
before asking for a password, it's a good idea to enable Secure Keyboard mode before the
prompt is displayed and then verify that the prompt is displayed in the proper colors. Before
entering the password, you can also display the Main Options menu again and verify that a
check mark appears next to Secure Keyboard mode.
Be aware that Secure Keyboard will be disabled automatically if you iconify the xterra win-
dow, or start twin or another window manager that provides a titlebar or other window deco-
ration. This limitation is due to the X protocol. When the mode is disabled, the colors will
be switched back and the bell will sound to warn you.
In addition to modes that can be toggled, the Main Options menu includes several commands.
All of the commands (except for Redraw Window) send a signal that is intended to affect the
xterm process: suspend it (Send STOP Signal), terminate it (Send TERM Signal), etc. Given
that your operating system may recognize only certain signals, every menu item may not pro-
duce the intended function.
Note that most of these commands are equivalent to common keystroke commands, which
are generally simpler to invoke. For example, in most terminal setups, Control-C can be used
The xterm Terminal Emulator 53
The Ouit command sends the SIGHUP signal to the process group of the process running
under xterm, usually the shell. (The Send HOP Signal command sends the same signal.) This
ends up killing the xterm process, and the window disappears from the screen.
Ouit is separated from the earlier commands by a horizontal line, so it's easier to point at.
Sending a SIGHUP signal with Ouit is also slightly more gentle to the system than sending a
SIGKILL signal with Send KILL Signal.
The Redraw Window command redraws the contents of the window. As an alternative, you
can redraw the entire screen using the xrefresh client. See the xrefresh reference page in Part
Three of this guide for more information about this client.
If you are still using the uwm window manager, the Redraw and Refresh Screen selections of
the WindowOps menu redraw a selected window and the entire screen, respectively. See
Appendix B, The uwm Window Manager, for more about these uwm menu items.
VT Options Menu
The VT Options menu (formerly the Modes menu) provides many VT102 setup functions.
Some of these mode settings are analogous to those available in a real VT102's setup mode;
others, such as scrollbar, are xterm-only modes.
The VT Options menu items allow you to reset several modes at once, to select the Tektronix
window to accept input, and to hide the VT window.
The Release 4 version of this menu is very similar to the Release 3 version. A majority of the
mode toggles have been renamed by adding the first word "Enable." For example, Jump
Scroll has been renamed Enable Jump Scroll, making it more apparent when a check mark
precedes it that the mode is active. The names of a few of the other items have been changed
slightly: Enable Visual Bell has been added from the Main Options menu, and Show Tek Win-
dow has been moved from the mode toggles section of the menu below to the commands
section.
To bring up the VT Options menu, move the pointer to the xterm window, hold down the
Control key, and then press and hold down the middle pointer button. (You can release the
Control key but must continue to press the middle button to keep the VT Options menu in the
window.) The menu shown in Figure 4-4 appears.
Check marks indicate the active modes. For example, Jump Scroll, Auto Wraparound, and
Scroll to Bottom on Try Output are active in the VT Options menu displayed in Figure 4-4.
(These are the only modes active by default. In Release 3, Scroll to Bottom on Tty Output was
not active by default.*) To turn off one of these modes, move the menu pointer to that mode
and release the middle button.
*In Release 3, if you enable the scrollbar for a particular window, the mode Scroll to Bottom on Tly Output is turned on
automatically. This mode indicates that if you are using the scrollbar and the window receives output (or a key is
pressed, if st:t:y echo is enabled), the window scrolls forward so that the cursor is at the current line. (You can use
the menu to toggle this mode off, but it is generally desirable to have.)
The xterm Terminal Emulator 55
VT Options
Enable Scrollbar
Enable Jump Scroll
Enable Reverse Video
Enable Auto Wraparound
Enable Reverse Wraparound
Enable Auto Linefeed
Enable Application Cursor Keys
Enable Application Keypad
Scroll to Bottom on Key Press
Scroll to Bottom on Tty Output
Allow 80/132 Column Switching
Enable Curses Emulation
Enable Visual Bell
Enable Margin Bell
Show Alternate Screen
Do Soft Reset
Do Full Reset
Show Tek Window
Switch to Tek Mode
Hide VT Window
Figure 4-4. The VT Options menu
Most of these modes can also be set by command line options when invoking xterm, or by
entries in a resource startup file like .Xresources (see Chapter 9, Setting Resources). The
menu selections enable you to change your mind once xterm is running.
The toggle Allow 80/132 Column Switching warrants a little more explanation. This mode
allows xterm to recognize the DECCOLM escape sequence, which switches the terminal
between 80- and 132-column mode. The DECCOLM escape sequence can be included in a
program (such as a spreadshee0 to allow the program to display in 132-column format. See
Appendix F, xterm Control Sequences, for more information. This mode is off by default.
The VT Options menu commands (in the second and third partitions of the menu) perform two
sets of functions, neither of which can be performed from the command line or a resource
definition file. The commands Soft Reset and Full Reset reset some of the modes on the
menu to their initial states. See the xterm reference page in Part Three of this guide for more
information.
The Show Tek Window, Switch to Tek Mode, and Hide VT Window menu items allow you to
manipulate the Tektronix and VT102 windows.
The Show Tek Window command displays the Tek window and its contents, without making it
the active window (you can't input to it). Use the Switch to Tek Mode command to display a
Tektronix window and make it the active window. When you select Switch to Tek Mode, the
56 X Window System User's Guide
To display all xterm windows with a scrollbar by default, set scrollBar in your
.Xresources file, as described in Chapter 9, Setting Resources. This is illustrated below:
XTerm* scrollBar: true
Figure 4-7 shows an xterm window with a scrollbar.
1- xterm
% twm&
% oclock&
[] oclock []
.:
.....
:-: =_ ....
Figure 4-Z An xterm window w#h a scrollbar
The thumb (the highlighted area within the scrollbar) moves within the scroll region. The
thumb displays the position and amount of text currently showing in the window relative to
the amount saved. When an xterm window with a scrollbar is first created, the thumb fills the
entire scrollbar. As more text is saved, the size of the thumb decreases. The number of lines
saved is 64 by default, but an alternative can be specified with either the -al command line
option or the saveLines value in an .Xresources file.
When the pointer is positioned in the scrollbar, the cursor changes to a two-headed arrow.
Clicking the first (usually the left) pointer button in the scrollbar causes the window to scroll
toward the end of information in the window.
Clicking the third (usually the right) pointer button in the scrollbar causes the window to
scroll toward the beginning of information in the window.
Clicking the second (usually the middle) pointer button moves the display to a position in the
saved text that corresponds to the pointer's position in the scroll region. For example, if you
move the pointer to the very top of the scroll region and click the second (middle) button, the
display is positioned very near the beginning of the saved area.
60 X Window System User's Guide
If you hold down the second button, you can drag the thumb up and down. Text moves as
you move the thumb. If you drag up, the window scrolls back, toward the beginning of infor-
mation in the window. If you drag down, the window scrolls forward, toward the end of
information in the window. When you release the button, the window displays the text at that
location. This makes it easy to get to the top of the data by pressing the second button, drag-
ging it off the top of the scrollbar, and releasing it.
Copying and Pasting Text Selections
Once your xterm window is created, you can select text to copy and paste within the same or
other xterm windows using the pointer. You don't need to be in a text editor to use copy and
paste. You can also copy or paste text to and from the command line.
Text copied into memory using the pointer is saved in a global cut buffer and also becomes
what is known as the PRIMARY text "selection." Both the contents of the cut buffer and the
contents of the PRIMARY text selection are globally available to all clients. When you paste
text into an xterm window, by default the contents of the PRIMARY selection are pasted. If
there is no text in the PRIMARY selection, the contents of the cut buffer (called
CUT_BUFFER0), are pasted. (Thus, in most cases, these will be the same.)
Copying and pasting is one way in which clients exchange information, in this case, text.
Prior to Release 3, many clients exchanged information solely by means of cut buffers. Cut
buffers are only useful for transferring information between clients that interpret data in the
same format. Thus, cut buffers could be used to transfer ASCII text between xterm windows.
In accordance with the newer interclient communication conventions developed since
Release 2, most Release 3 and 4 clients, notably xterm, primarily exchange information via
selections. The advantage of the selection mechanism is that it allows data from one client to
be converted to a different format to be used by another client. Cut buffers do not perform
this type of translation.
As we've said, if you are copying text between xterm windows, the contents of
CUT_BUFFER0 and the PRIMARY selection should be the same. However, as we'll see later,
while some applications (notably the current version of xterm) copy to both the cut buffer
and the selection, other applications (generally prior to Release 3) only copy to the cut buffer.
If you are using both types of applications together and trying to transfer text between them,
differences between the contents of the cut buffer and the PRIMARY selection may make
copying and pasting problematic. If you are only copying text between xterm windows
(Release 3 or later), problems of this type will never arise.
For our purposes, we are mainly concerned with ASCII text selections from xterm windows.
First, we'll show you how to copy and paste text between xterm windows. Then we'll dis-
cuss some of the implications of using selections versus cut buffers, and describe two clients,
xcutsel and xclipboard, which allow you to manipulate text saved in memory. The xcutsel
client addresses problems that arise when you're copying text between an application that
uses selections and one that uses cut buffers. The xclipboard allows you to store multiple
text selections.
The xterm Terminal Emulator 61
2. Place the pointer on the word graphics in the sample sentence and select it with two
clicks of the first button.
3. Then press and hold the third pointer button. Move the pointer away from the word
graphics, to the left or right. A new selection now extends from the last selection (graph-
ics) to the pointer's location and looks something like the following:
The X Window System is a network-based :-iiiiiiiiiiiiiiiiiii
or:
was developed at MIT in 1984.
Remember that your extension always begins from your last selection. By moving the
pointer up or down, right or left of the last selection, you can use this technique to select part
of one line or add or subtract several lines of text.
xterm
Dear Mr. Hoffman:
.LP
You called yesterday for
inlormation about X. []
xterm
X have been developed, the most
recent o! which is X Version 11
(Xll), first released in 1987. Xll
has been adopted as an industry-
....
:::: [] oclock []
' ..
..... :.
Figure 4-8. Highlighted text saved as the PRIMARY selection
To clear the highlighting, move the pointer off the selection and click anywhere else in the
window with the first button. Note, however, that the text still remains in memory until you
make another selection.
The xterm Terminal Emulator 63
You can also paste over existing text with the vi change text commands (such as cw, for
change word). For example, you can paste over five words by specifying the vi command
5cw, and then pasting text by clicking the second pointer button. Note that you can paste
over existing text in any editor that has an overwrite mode.
Manipulating Text Selections
Prior to Release 3, text copied into memory using the pointer was saved in the global cut
buffer, in effect, "owned" by the server, and available to all clients. Cut buffers are only use-
ful for copying and pasting information that does not need to be translated to another format,
such as ASCII text between two xterm windows.
Since Release 3, text copied into memory from an xterm window is saved in the cut buffer
and as the PRIMARY selection. The PRIMARY selection takes precedence over the contents
of the cut buffer. When pasting text between xterm windows, if the selection contains text, it
is pasted. If not, the contents of the cut buffer are pasted. Selections can be used to transfer
data that must be translated to a form the receiving client can interpret.
A selection is globally available, but it is not owned by the server. A selection is owned by a
client initially by the client from which you copy it. Then when the text selection is pasted
to another window, that window becomes the owner of the selection.
Because of the rules of precedence governing cut buffers and selections, and the nature of
selections (particularly the issue of ownership), certain problems can arise in transferring
data:
1. If one client communicates with cut buffers and one with selections, copying and pasting
between them is inherently problematic. By default, the selection takes precedence.
How do you paste the contents of the cut buffer instead?
2. By default, you can save only one selection at a time.
3. For a selection to be transferred to a client, the selection must be owned by a client. If
the client that owns the selection no longer exists, the transfer cannot be made.
The xcutsel and xclipboard clients address the first two of these problems, respectively.
Most users will probably not encounter the third problem. You are probably doing all your
copying and pasting between xterm windows. If you've made a selection from an xterm win-
dow and the window is killed, the selection contents are lost. However, the cut buffer con-
tents remain intact and are pasted instead. (Since all xterm windows interpret ASCII text, the
translation capabilities of the selection mechanism are not needed.)
Problems involving the loss of selections are more likely to happen if you are transferring
information between clients that require information to be in different formats. If you are
having such problems, you can customize the clients involved to copy information to what is
known as the CLIPBOARD selection.
The CLIPBOARD selection is intended to avert problems of selection ownership by providing
centralized ownership. Once the CLIPBOARD owns a selection, the selection can be
transferred (and translated), even if the client that previously owned the selection goes away.
The xterm Terminal Emulator 65
You can customize a client to send data to the CLIPBOARD selection by using event transla-
tions, which are discussed in Chapter 9, Setting Resources. See the client reference pages for
information on the appropriate translations. For more information on selections and transla-
tions, see Volume One, Xlib Programming Manual.
Copying and Pasting between Release 2 and 3 Clients: xcutsel
The xcutsel client is intended to bridge a gap that exists between the ways older and newer
clients allow you to copy text. If all the clients you are using are from Release 3 or later, you
will probably have no use for xcutsel and should skip ahead to the next section.*
Since Release 3, when you select text from an xterm window with the pointer, the text is
copied into the global cut buffer and made the PRIMARY selection. (Thus, generally, the
contents of the cut buffer and the PRIMARY selection are the same.) By default, the PRI-
MARY selection is what gets pasted into a window. If there is no PRIMARY selection, the
contents of the cut buffer are pasted.
Prior to Release 3, clients did not use selections. Text was copied into the cut buffer only
(and was not equated with a PRIMARY selection). Problems can arise if you are running cli-
ents that use cut buffers only (many Release 2 clients and uwm, any release) with clients that
primarily use selections (Release 3 and later) and are trying to paste text between them.
For instance, say you copy text in a Release 3 xterm window using the pointer. The text is
copied into the cut buffer and also becomes the PRIMARY selection. If you paste in any win-
dow, the PRIMARY selection is what you get. Then, say you copy text in a R2 xterm window.
The text is stored in the cut buffer, replacing the text in the cut buffer from the R3 window,
but it does not replace the PRIMARY selection. You can paste the text from the R2 window in
another R2 window because the window only understands cut buffers, but you can't paste it
in an R3 window. If you try to, by default you get the PRIMARY selection (from the other R3
window).
xcutsel enables you to switch the text in the cut buffer and the PRIMARY selection so that you
can cut and paste between clients that use cut buffers and clients that use selections.
To open an xcutsel window, type:
% xcutsel &
and then place the window on your screen. Figure 4-10 shows an xcutsel window.
The window contains three command buttons whose functions are described below:
quit
copy PRIMARY to 0
copy 0 to PRIMARY
Exits the xcutsel program.
Copies the contents of the PRIMARY selection to CUT_BUFFER0.
Copies the contents of CUT_BUFFER0 to the PRIMARY selection.
*If you are using uwm, you may have use forxcutsel. Regardless of the release, uwm uses only cut buffers. See
Appendix B, The uwm Window Manager, of this guide for details.
66 X Window System User's Guide
Figure 4-10. An xcutsel window
Now let's go back to the problem we set up earlier in this section. If you copy text from an
R2 window and want to paste in an R3 window, you merely click on the copy 0 to PRIMARY
button. The contents of the cut buffer (from the R2 client) replace the previous PRIMARY
selection (from the R3 client). When you paste, you get the text you want (from the R2
window).
Now say you have the same situation, but the opposite problem. You made a selection from
an R3 window, which filled the cut buffer and the PRIMARY selection. Then you copied text
from an R2 window, which merely filled the buffer. (The contents of the buffer and the PRI-
MARY selection are different.) But now say you want to paste the text from the PRIMARY
selection (from the R3 window) in an R2 window. If you paste text in an R2 window, you get
the contents of the cut buffer (the text from the other R2 window).
To solve this problem, just click on the copy PRIMARY to 0 button in the xcutsel window.
The contents of the PRIMARY selection (from the R3 window) replace the contents of the cut
buffer (from the R2 window). When you paste in an R2 window, you get still get the con-
tents of the cut buffer, but it is now the text you want.
This business of selections versus cut buffers can be pretty confusing. If you have problems
pasting the text you want, experiment a litde with xcutsel.
The xterm Terminal Emulator 67
Saving Multiple Selections- xclipboard (Release 4 Version)
The xclipboard client provides a window in which you can paste multiple text selections and
from which you can copy text selections to other windows. Similar to the clipboard feature
of the Macintosh operating system, the xclipboard is basically a storehouse for text you may
want to paste into other windows, perhaps multiple times. The xclipboard window is shown
in Figure 4-11.
This section and the next two sections describe various features of the Release 4 version of
xclipboard. If you are using the Release 3 version, which has more limited functionality, also
read the section "Release 3 xclipboard" later in this chapter.
Figure 4-11. The xclipboard window
To open an xclipboard, type:
% xclipboard &
and then place the window interactively with the pointer.
You can paste text into the xclipboard window using the pointer in the manner described
above and then copy and paste it elsewhere, but this is not its intended usage. To use the
xclipboard most effectively, you must do some customization involving a resource file, such
as .Xresources. The necessary steps are described in detail in Chapter 9, Setting Resources.
For now, suffice it to say that you want to set up the xclipboard so that you can select text to
be made the CLIPBOARD selection and have that text automatically pasted in the xclip-
board window. This is illustrated in Figure 4-12.
Since the xclipboard client is intended to be coordinated with the CLIPBOARD selection,
the X server allows you to run only one xclipboard at a time.
In order to illustrate how the clipboard works, let's presume it has been set up according to
the guidelines in Chapter 9. According to those guidelines, you make text the CLIPBOARD
selection by selecting it with the first pointer button (as usual) and then, while continuing to
hold the first button, clicking the third button. (You could specify another button combina-
tion or a button and key combination, but we've found this one works pretty well. For more
information about these specifications, see Chapter 9, Setting Resources.) The first pointer
action makes the text the PRIMARY selection (and it is available to be pasted in another
68 X Window System User's Guide
window using the pointer); the second pointer action additionally makes the text the CLIP-
BOARD selection (and it is automatically sent to the xclipboard window).
These guidelines still allow you to select text with the first pointer button alone, and that text
will be made the PRIMARY selection; however, the text will not automatically be sent to the
xclipboard. This enables you to make many selections, but to direct to the xclipboard only
those you consider important (perhaps those you might want to paste several times).
text
Figure 4-12. Selected text appears automatically in the xclipboard window
In order to allow you to store multiple text selections, the seemingly tiny xclipboard actually
provides multiple screens, each of which can be thought of as a separate buffer. (However, as
we'll see, a single text selection can span more than one screen.) Each time you use the
pointer to make text the CLIPBOARD selection, the xclipboard advances to a new screen in
which it displays and stores the text.
Once you have saved multiple selections, the client's Next and Previous command buttons
allow you to move forward and backward among these screens of text. The functionality of
the client's command buttons is summarized in Table 4-3. They are all selected by clicking
with the first pointer button.
Table 4-3. Command Buttons and Functions
B utton
Quit
Delete
New
Function
Causes the application to exit.
Deletes the current xclipboard buffer; the current screenful of
text is cleared from the window, and the next screenful (or previ-
ous, if there is no next) is displayed.
Opens a new buffer into which you can insert text; the window is
cleared.
The xterm Terminal Emulator 69
Table 4-3. Command Buttons and Functions (continued)
Button
Next and Previous
Function
Once you have sent multiple selections to the xclipboard, Next
and Previous allow you to move from one to another (display
them sequentially). Before two or more CLIPBOARD selections
are made, these buttons are not available for use (their labels will
appear in a lighter typeface to indicate this).
The command buttons you will probably use most frequently are Delete, Next, and Previous.
When you select text using the first and third pointer buttons, the text will automatically be
displayed in the xclipboard window and will in effect be the first screenful of text (or first
buffer) saved in the xclipboard. Subsequent CLIPBOARD selections will be displayed and
saved in subsequent screens.
You select text from the xclipboard and paste it where you want it just as you would any text.
Just display the text you want in the xclipboard window, using Next or Previous as necessary.
Then select the text using the first pointer button and paste it using the second pointer button.
You can remove a screenful of text from the xclipboard by displaying that screenful and then
clicking on the Delete command button. When you delete a screenful of text using this com-
mand button, the next screenful (if any) will be displayed in the window. If there is no next
screenful, the previous screenful will be displayed.
Certain features (and limitations) of the xclipboard become apparent only when you make a
very large CLIPBOARD selection. Say you select a full xterm window of text with the first
and third pointer buttons, as described above. The text extends both horizontally and verti-
cally beyond the bounds of a single xclipboard screen. (As we suggested earlier, a CLIP-
BOARD selection can actually span more than one xclipboard screen. Pressing Delete will
remove all screenfuls comprising the selection.) When you make a selection that extends
beyond the bounds of the xclipboard screen (either horizontally, vertically, or both),
scrollbars will be activated in the window to allow you to view the entire selection.
If the text extends both horizontally and vertically beyond the bounds of the xclipboard
screen, as it does in Figure 4-13, the window will display both horizontal and vertical
scrollbars. If the text extends beyond the screen in only one of these two ways, the window
will display either a horizontal or vertical scrollbar, as needed.* These scrollbars are selec-
tion-specific: they are only displayed so long as the current selection cannot be viewed in its
entirety without them. If you move to a previous or subsequent selection that can be viewed
without scrollbars, the scrollbars will be deactivated.
*An application created using the X Toolkit, which provides horizontal and vertical scrollbars, is described as a
viewport. See Chapter 7, Other Clients, for more information about viewports and other X Toolkit features.
70 X Window System User's Guide
The X window system is a netw]
based graphic window system t
was developed at MIT in 1984.
Several versions of X have bee
he .... most recent of /
Figure 4-13. xclipboard with scrollbars to view large text selection
Problems with Large Selections
If you experiment making large selections with xclipboard, you may discover what seems to
be a bug in the program. Though in most circumstances, making a new selection causes the
screen to advance and display the new text, this does not happen reliably after a selection
vertically spanning more than one screenful. In these cases, the new selection is saved in the
xclipboard; however, the xclipboard window does not automatically advance to show you the
new current selection. Instead, the previous long selection is still displayed. This is a bit of
xclipboard sleight-of-hand. The new selection has been successfully made, but the appear-
ance of the window belies this fact. (The Noxt button will probably add to your confusion; it
will not be available for selection, suggesting that the text in the window is the last selection
saved. This is not the case.)
In order to get around this and display the actual current selection, press the Provious button.
The same long selection (which is, in actuality, the Provious selection) will again be
displayed. Then the Noxt button will be enabled, and you can click on it to display the actual
current selection.
Editing Text Saved in the xcllpboard
You can edit text you send to the xclipboard using the same commands recognized by xedit.
These commands are described in the section "Text Editing Widget" of Chapter 7, Other
Clients. A small caret cursor will be visible in each screenful of text. You can move this cur-
sor by clicking the pointer where you'd like it to appear. Then you can backspace to delete
letters or type to insert them, or use any of the text editing commands described in Chapter 7.
When you edit a screenful of text, the xclipboard continues to store the edited version, until
you delete it or exit the program.
Be aware that, without performing customization, you can still use xclipboard on a very
simple level. You can paste text into and copy text from the xclipboard window just as you
would any other, using the pointer movements described earlier in this chapter. You can also
type in the xclipboard window, and then copy and paste what you've typed. Just move the
The xterm Terminal Emulator 71
pointer into the window and try typing. However, keep in mind that this is not the intended
use of the xclipboard.
If you do choose to use the clipboard in a limited way, it can still be a helpful editing tool.
For example, say you wanted to create a paragraph composed of a few lines of text from each
of two files. You could copy the text from each file using the pointer and paste it into the
xclipboard window. (Each time you paste text into the xclipboard window, the text is
appended to whatever text has already been pasted there.) Again using the pointer, you could
copy the newly formed paragraph from the xclipboard window and paste it into a file in
another window.
Release 3 xclipboard
xclipboard was first shipped as a part of the standard version of X in Release 3. If you are
using the Release 3 xclipboard, shown in Figure 4-14, you'll find that it's functionality is
considerably more limited than the Release 4 version.
[
Quit
Pr.vious
Figure 4-14. The Release 3 xclipboard window
The Release 3 xclipboard can also be customized to receive the CLIPBOARD selection auto-
matically. However, this version of the xclipboard merely inserts each selection on the
line(s) following the previous one. The screen of the xclipboard will scroll forward as you
add more text, but at line intervals, not at full screen intervals as the Release 4 client does.
Thus, while the Release 4 xclipboard allows you to save multiple selections that are recog-
nized as such by commands like Delete, the Release 3 xclipboard only allows you to save
what is, in effect, a single, running selection. This limitation alone makes the Release 3
xclipboard far less useful than the Release 4 xclipboard.
But the Release 3 xclipboard has other serious limitations. It features only one functioning
command button, quit. The erase button in the window is not functional, and unfortunately,
no other key or combination of keys seems to clear the text from the xclipboard.
Unlike the Release 4 version, the Release 3 xclipboard does not recognize all of the text edit-
ing commands recognized by xedit. You can use all of the commands that move the cursor,
but none of the commands that delete text. Your only option to remove text is to select the
72 X Window System User's Guide
Running a Program in a Temporary xterm Window
Normally, when you start up an xterm window, it automatically runs another instance of the
UNIX Bourne or C shell (depending on which is set in your .Xresources file or the SHELL
environment variable). If you want to create an xterm window that runs some other program,
and goes away when that program terminates, you can do so with the xterm -e option:
% xterm-e command [arguments]
For example, if you wanted to look at the file temp in a window that would disappear when
you quit out of the file, you could use the UNIX more program as follows:
If you are using other options to xterm on the command line, the -e option must appear last.
This is because everything after the -e option is read as a command.
The xterm Terminal Emulator 75
5
Font Specification
This chapter describes what you need to know in order to select display fonts
for the various client applications. After acquainting you with some of the
basic characteristics of a font, this chapter describes the rather complex font
naming conventions and how to simplify font specification. This chapter also
describes how to use the xlsfonts, xfd, and xfontsel clients to list, display,
and select available screen fonts.
In This Chapter:
Font Naming Conventions ...................................................................... 74
Font Families ..................................................................................... 75
Stroke Weight and Slant .................................................................... 78
Font Sizes ......................................................................................... 78
Other Information in the Font Name ................................................... 81
Font Name Wildcarding ......................................................................... 82
The Font Search Path ............................................................................ 84
The fonts.dir Files .............................................................................. 85
Font Name Aliasing ............................................................................... 87
Making the Server Aware of Aliases ................................................ 89
Utilities for Displaying Information about Fonts ....................................... 89
The Font Displayer: xfd ..................................................................... 89
Release 3 xfd .................................................................................. 91
Previewing and Selecting Fonts: xfontsel .......................................... 92
Previewing Fonts with the xfontsel Menus ........................................ 92
Selecting a Font Name .................................................................... 96
Changing Fonts in xterm Windows ......................................................... 96
The Great Escape ........................................................................... 96
The Selection menu item ................................................................. 98
Release 2 versus Subsequent Release Fonts ........................................ 98
Font Specification in Release 2 .......................................................... 98
5
Font Specification
Many clients allow you to specify the font used to display text in the window, in menus and
labels, or in any other text fields. For example, you can choose the font used for the text in
lwm menus or in xlerm windows.
Unfortunately, for the most part, there are no simple "font menus" like there are on systems
such as the Macintosh.* Instead, X has a fairly complex font naming system (which, like
most things about X, is designed for maximum flexibility rather than for simplicity or ease of
use). Of course, there will no doubt soon be many applications such as word processors and
publishing packages that provide a simple interface for selecting fonts. However, for the
clients in the X distribution, you are generally limited to selecting fonts via command line
options or resource specifications.
This wouldn't be so bad if a typical font name wasn't mind-bending at first glance. Imagine
typing this command line to create an xterm window whose text is to be displayed in 14-point
Courier bold:
% xterm-fn -adobe-ourier-bold-r-normal--14-140-75-75-m-90-iso8859-1
Fortunately, you can use asterisks as wildcards to simplify this name to a somewhat more rea-
sonable one:
% xterm -fn '*ourier-bold-r*140*'
and you can define even simpler aliases, so that you could end up typing a command line like
this:
% xterm-fn ourierBl4
In this chapter, we're going to try to make sense out of the sometimes bewildering jungle of
information about fonts under X. First, we'll explain the font naming convention in detail.
Along the way, we'll acquaint you with the appearance of some of the basic font families
(groups of related fonts), and the various permutations (such as weight, slant, and point size)
within each family.
*An exception is the VT fonts menu in the R4 xterrn. But even then, you need to know a lot about font naming to
change the fonts on the menu.
Font Specification 79
inch. For example, the 16-inch monitor on the Sony NEWS workstation has an advertised
resolution of 1280 x 1024 pixels. The actual viewing area is approximately 13 inches wide
by 10 inches high. Dividing the resolution by the size, you come up with a vertical resolution
of 102.4 dpi and a horizontal resolution of 98.5 dpi.
The Sun 19-inch monitor, by contrast, has an advertised resolution of 1152 x 900. The hori-
zontal and vertical dimensions of the viewing area are approximately 13.75 x 10.75 inches.
This yields a resolution of about 84 dpi.
What happens if you select the wrong resolution for your monitor? Given the difference in
the pixel size, the same size font will appear larger or smaller than the nominal point size.
For example, consider the 75- and 100-dpi versions of the 24-point charter medium italic
font:
-bit s t ream-chart e r-me di um- i-norma i--25 -240 -75-7 S-p- 136- i so8859-1
-bit st ream-charter-medium-i-normal--33-240-I 00-I O0-p-179-iso8859-I
If you look at the pixel size field, you will notice that the height of the 75-dpi version is 25
pixels, while the height of the 100-dpi version is 33 pixels. If you use the 75-dpi version on
the Sun, you actually get something closer to 21.5 points (75/84*24); on a 100-dpi monitor,
you will actually get something closer to 18 points (75/100"24). We noticed this fight away
when we first began using the Sony workstation. Because of its higher resolution, the font
size we had been using on the Sun appeared much smaller.
If you are working on a lower-resolution monitor, you can take advantage of this artifact to
display type as large as 32 points (the size that a 24-point 100-dpi font will appear on a
75-dpi monitor.) Figure 5-6 shows the 75- and 100-dpi versions of the same 24-point font, as
displayed on a Sun workstation with a 19-inch monochrome monitor. As shown, neither is
actually 24 points. The 75-dpi version is actually 21.5 points, as discussed above; the
100-dpi version is about 28.5 points.*
-adobe-new centtu3 schoolbook-medium-r-n
-adobe-new century schoolbook-In
Figure 5-6. The l O0-dpi version of a 24-point font appears larger on a 75-dpi monitor
Note that the logical font naming convention allows for different horizontal and vertical res-
olution values. This would allow server manufacturers to support fonts that were "tuned" for
their precise screen resolution. However, the fonts that are shipped with the generic X11 dis-
tribution all use the same horizontal and vertical resolution.
*Note that the differences are exaggerated further in printing the screen dump of this display, xpr lets you select a
scale factor, such that each pixel on the screen appears as scale pixels in the printout. Since the laser printer has a
300-dpi resolution, a scale factor of 4 would produce a true scale screen dump if the resolution on the Sun monitor
were truly 75 dpi by 75 dpi. Since it is actually 84 by 84, the printed image is enlarged by about 10%.
86 X Window System User's Guide
As suggested above, this resolution may not exactly match the actual resolution of any partic-
ular screen, resulting in characters that are not true to their nominal point size. In the case of
the Sony monitors, the actual resolution is quite close to the design of the 100-dpi fonts.
However, on the Sun monitor, neither the 75- nor 100-dpi fonts will be right. (Of course, if
you are using the X 11/NeWS server rather than the MIT sample server, you won't be using
bitmapped fonts at all, but scalable outline fonts, so this isn't a problem.)
Other Information in the Font Name
What we've already shown summarizes the most important information in the font name.
The remaining fields are explained below:
Foundry Font manufacturers are still referred to as foundries, from the days when
type was cast from lead. The X font naming convention specifies that the
foundry is the company that digitized or last modified the font, rather than
its original creator.
For the fonts contained in the standard X distribution, the foundry is not
terribly significant, since there are no cases where the same font family is
available from different foundries. However, there are numerous commer-
cial font families available from more than one foundry. In general, the
appearance of the fonts should be quite similar, since the font family
defines the design of the typeface. However, there may be some small dif-
ferences in the quality of some of the characters, and there may be more
significant differences in the font metrics (the vertical or horizontal mea-
surements of the characters). This might be significant for a publishing
application that was using the bitmapped font for a wysiwyg screen display
that needed to match the fonts in a particular laser printer or typesetter.
Set width A value describing a font's proportionate width, according to the foundry.
Typical set widths include: normal, condensed, semicondensed, narrow,
double width. All of the Release 3 fonts and most of the Release 4 fonts
have the set width normal. A few of the Release 4 fonts have the set width
semicondensed.
Spacing All standard Release 3 fonts are either m (monospace, i.e., fixed-width) or p
(proportional, i.e., variable-width). In Release 4, fonts may also have the
spacing characteristic c (character cell, a fixed-width font based on the tra-
ditional typewriter model, in which each character can be thought to take
up the space of a "box" of the same height and width). As mentioned ear-
lier, the original R2 fonts were of this type.
Average width Mean width of all characters in the font, measured in tenths of a pixel.
You'll notice, if you look back at Figure 5-2, that two fonts with the same
point size (such as New Century Schoolbook and Times) can have a very
different average character width. This field can sometimes be useful if
you are looking for a font that is especially wide or especially narrow.
Font Specification 87
The Clean family of fonts from Schumacher offers several fonts in the same
point size, but with different average widths.*
Character set In the initial illustration of the font naming convention (Figure 5-1), we
identified the character set as a single field. If you look more closely,
you'll realize it is actually two fields, the first of which identifies the orga-
nization or standard registering the character set, the second of which iden-
tifies the actual character set.
Most fonts in the standard X distribution contain the string "iso8859-1" in
their names, which represents the ISO Latin-1 character set. The ISO
Latin-1 character set is a superset of the standard ASCII character set,
which includes various special characters used in European languages other
than English. See Appendix H of Volume Two, Xlib Reference Manual, for
a complete listing of the characters in the ISO Latin-1 character set.
Note, however, that the symbol font contains the strings "adobe-
fontspecific" in this position. This means that Adobe Systems defined the
character set in this font, and that it is font-specific. You can see from this
example that the usage of these fields is somewhat arbitrary.
Style Not represented in the example or in most R3 or R4 font names. However,
according to the logical font convention, the style of a font may be speci-
fied in the field between set width and pixels. Some of the possible styles
are i (informal), r (roman), serif and sans (serif). Note that the r for roman
may also be used in the slant field.
For a complete technical description of the font naming conventions, see the X Consortium
Standard, X Logical Font Description Conventions. This document is available as part of the
standard MIT X distribution, and is reprinted as Appendix M in the second edition of Volume
O, X Protocol Reference Manual.
Font Name Wildcarding
Prior to Release 3, the use of wildcards within font names was restricted to specifying fonts
to list with xlsfonts. If you are running Release 3 or Release 4, wildcarded font names can
also be used to specify the display font for a client, either on the command line or in a
resource specification.
An asterisk (*) can be used to represent any part of the font name string; a question mark (?)
can be used to represent any single character. You can usually get the font you want by spec-
ifying only the font family, the weight, the slant, and the point size, and wildcarding the rest.
For example, to get Courier bold at 14 points, you could use the command line option:
-fn '*courier-bold-r*140*'
*These fonts all (incorrectly to our minds) have a set width of "normal." They should be distinguished by set widths
such as condensed, semi-condensed, etc. Since they do not, they can be distinguished by the difference in their
average width.
88 X Window System User's Guide
Table 5-3. Standard Font Directories, Releases 3 and 4
Directory
lusrllib/X11 Ifon tslmisc
lusrllib/X111fonts175dpi
lusrllib/X111fonts1100dpi
Contents
Release 3: Six fixed-width fonts (also available in
Release 2), plus the cursor font.
Release 4: Sixty fixed-width fonts, including the six
available in Release 3, the cursor font, several Clean
family fonts provided by Schumacher, a Kanji font,
Kana fonts, and OPEN LOOK cursor and glyph
fonts.
Fixed- and variable-width fonts, 75 dots per inch.
Release 3: The Adobe Charter font family, 100 dots
per inch.
Release 4: Fixed- and variable-width fonts, 100 dots
per inch (all font families).
These three directories (in this order) comprise X's default font path.
Other directories can be added to the font search path, or its order can be rearranged, using
xset with the fp option. To completely replace the font path, simply specify a comma-
separated list of directories. For example, to put the lOOdpi directory before the 75dpi direc-
tory, you might enter:
% xsot fp= /usr/1ib/X11/fonts/misc,/usr/1ib/X11/fonts/100dpi,\
/usr/lib/Xl 1/font s/75dpi
(Note that a space must follow the equal sign, and that the example above is broken onto two
lines escaped with a backslash only so that it can be printed within the page margins.) To
restore the default font path, type:
% xet fp default
Use the fp+ option to add a directory or list of directories to the end of the font path, or +fp
to add them at the start. Use -fp and p- to delete directories from the beginning or end of
the font path.
For a complete listing of the fonts in each directory and samples of each font, refer to Appen-
dix E, Release 3 and 4 Standard Fonts.
The fonts.dir Files
In addition to font files, each font directory contains a file called fonts.dir. Thefonts.dir files
serve, in effect, as databases for the X server. When the X server searches the directories in
the default font path, it uses thefonts.dir files to locate the font(s) it needs.
Font Specification 91
Notice the instruction Select a character below the command buttons. To display
information about a particular character, click any pointer button within its grid square.
Statistics about the character's width, left bearing, right bearing, ascent, and descent are
displayed where the line Select a character previously appeared.
If you are running the Release 3 version of xfd, read the section "Release 3 xfd."
The xfd client is most useful when you have an idea what font you might want to display. If
you don't have a particular font in mind or would like to survey the possibities, the xfontsel
client (available as of Release 4) allows you to preview a variety of fonts by specifying each
component of the font name using a different menu. See the section "Previewing and Select-
ing Fonts: xfontsel" later in this chapter.
Release 3 xfd
The Release 3 version of xfd is not as flexible or as self-explanatory as the Release 4 version.
It offers no command buttons, no line identifying the font name, and no obvious scrolling
capabilities. However, it is still very useful for looking at a particular font.
Like the Release 4 version, by default the Release 3 xfd displays character number 0 of the
font at the upper left of the window. To see a character's number, move the pointer to the
desired character and click the middle button. That character's number is displayed both in
decimal and in hexadecimal notation at the bottom of the window, as in the following:
85.(0x55) :
This version ofxfd also accepts the -start option, which lets you specify the first character
of the font that appears at the upper left of the window.
Every character in the font may not fit in the window at once. Though this version of the
application does not feature the handy command buttons introduced at Release 4, you can
still view the obscured characters. To see additional characters, move the pointer to the xfd
window and click the third (usually the right) mouse button. The next window full of charac-
ters is displayed. To see the previous window of characters, click the first (usually the left)
mouse button, xfd beeps if an attempt is made to go back past the first (0) character.
The Release 3 xfd also provides statistics about the individual characters in a font, but you
must run the client with the -verbose option to access this information. Then, to see
information about a character's width, left bearing, right bearing, ascent, and descent, move
the pointer to the desired character and click the second (usually the middle) button. The
information is displayed in a portion of the window below the character grid.
To display the minimum or maximum values taken by each of these fields over the entire
font, move the pointer to the desired character and type a less than symbol (<) to display the
minimum values or a greater than symbol (>) to display the maximum. Information similar
to the following is displayed below the grid:
maximum bounds:
left bearing = 2, right bearing = 6
ascent= i0 , descent = 3
width = 6
Font Specification 97
To delete an xfd window that is running in the background, you can move the pointer to the
window and type either q, Q, or Control-C.
Previewing and Selecting Fonts: xfontsel
The xfontsel client, available as of Release 4, provides a font previewer window in which you
select the font to view using 14 menus corresponding to the 14 components of a font name.
By specifying various font name components, you can take a look at a variety of fonts. This
is particularly useful if you are trying to pick good display fonts and you don't have a very
clear idea what type of font would be best. Rather than running several instances of xfd, you
can dynamically change the font displayed in the xfontsel window by changing the font name
components. (Despite the flexibility of xfontsel, it's certainly not practical to preview all of
the available fonts. If you have no idea what particular font families look like, see the dis-
cussion earlier in this chapter, or refer to Appendix E, Release 3 and 4 Standard Fonts, for
complete listings.)*
Once you've displayed the desired font using the menus, you can make the name of that font
the PRIMARY text selection by clicking on the window's select button. (Selecting text is
described in Chapter 4, The xterm Terminal Emulator.) You can then paste the font name
into another window using the pointer: onto a command line, into a resource file, etc. Mak-
ing a font name the PRIMARY selection also enables you to choose that font from the xterm
vr Fonts menu, described in Chapter 4.
Previewing Fonts with the xfontsel Menus
To run xfontsel, enter the following command in an xterm window:
% xfontsel &
If your system is using the standard Release 4 fonts, the xfontsel window initially displays a
bold, constant-width, 7x13 pixel font, from the misc font directory, as shown in Figure 5-8.
This is the first font in the default font search path.
The upper-left corner of the xfontsel window features two command buttons: quit and
select. As we've explained, clicking on select (with the first pointer button) makes the font
displayed in the window the PRIMARY text selection. Obviously, quit causes the applica-
tion to exit.
Below the command buttons is, in effect, a generic font name or font name template. It is
divided into 14 fields corresponding to the 14 parts of a standard font name. Each field is an
abbreviation for one part of a font name. Take a look again at the sample font name in Figure
*To our minds, the major drawback of xfontsel is that it shows you only the first font that matches a given wildcarded
font name. A far better interface would list all of the matching fonts, so that you could compare and choose the one
that most suited your needs. There is no way in the standard X distribution to display the appearance of a group of
fonts. To produce the figures in this book, we had to write such a program, which we called xshowfonts. The pro-
gram has since been posted to cornpources.x, and a listing appears in Appendix E.
98 X Window System User's Guide
I
474 font.,+ match
-fndry- fmly-wght-slant-sWdth-adstyl-pxisz-ptSz-resx-resy-spc-avgWdth-rgstry-encdng
--- -----------
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
Figure 5-8. xfontsel window displaying 7x 13 bold font
5-1 to refresh your memory as to the components. Each of the fields in the xfontsel window
is actually the handle to a menu, which lets you specify this part of the font name.
To get a clearer idea of how this works, move the pointer onto the generic font name, specifi-
cally onto the first field, Indry. (This is an abbreviation for the first part of a font name, the
foundry.) When you place the pointer on lndry, the field title should be highlighted by a box.
You can then display a menu of foundry names by pressing and holding down the first pointer
button, as in Figure 5-9.
Notice that the first choice is the asterisk (*) wildcard character. This is the first choice on all
of the menus and thus allows you to include wildcards in the font name you specify, rather
than explicitly selecting something from all 14 menus.
To specify a font name component (i.e., make a selection from the menu), continue to hold
down the first pointer button and move the pointer down the menu. As the pointer rests on
each menu item, it is highlighted by reverse video. To select a highlighted menu item,
release the first pointer button.
The line below the font name menus represents the actual font name. When you first run
xfontsel, all of these fields contain wildcard characters because no menu selections have been
made. The number of fonts matched by the font name is displayed in the upper-right comer
of the window. The number of fonts matched initially depends on the number of fonts with
this naming convention available on your system. In this example, 474 fonts match. (Since
this line of wildcards can match any 14 part font name, the server chooses the first font in the
font path that reflects this naming convention.)
Font Specification 99
Selecting a Font Name
Once you compose the name of the font you want by making selections from the menus, the
corresponding font is displayed in the xfontsel window. Then you can select that font name
by clicking on the select command button with the first pointer button. The font name
becomes the PRIMARY text selection and thus can be pasted in another window using the
second (usually the middle) pointer button, as described in Chapter 4, The xterm Terminal
Emulator.
You might paste the font name on a client command line in an xterm window, in order to
specify it as the client's display font. (See Chapter 8, Command Line Options.) You might
paste it into a resource file such as .Xresources to specify it as the default font for a client or
some feature of a client (such as a menu). (See Chapter 9, Setting Resources, for more
information.)
Less obviously, once a font name is made the PRIMARY text selection, it can be toggled as
the xterm display font using the Selection item of the xterm VT Fonts menu. The Selection
menu item can only be chosen from the VI Fonts menu when there is a PRIMARY text selec-
tion. (Otherwise, the menu item appears in a lighter typeface, indicating that it is not avail-
able.) If the PRIMARY text selection is a valid font name (as it is when you've pressed the
select button in the xfontsel window), the xterm window displays in that font. (In cases
where the PRIMARY selection is not a valid font name, the xterm display font does not
change.)
By default, xfontsel displays the lower and uppercase letters a through z and the digits 0
through 9. You can specify alternative sample text using the -sample option. For more
information about this and other options, see the xfontsel reference page in Part Three of this
guide.
Changing Fonts in xterm Windows
As discussed in Chapter 4, The xterm Terminal Emulator, xterm includes a VT Fonts menu
that allows you to change fonts on the fly. We discussed most of the menu entries in Chapter
4. However, two of the many items require a greater understanding of font naming than we'd
covered by that point. So we've saved them until now.
The Great Escape
Though it is by no means obvious, xterm allows you to change the display font by sending an
escape sequence, along with the new font name, to the terminal window. Once you change
the font in this way, the Escape Sequence item on the xterm VT Fonts menu becomes avail-
able and choosing it toggles the font you first specified with the escape sequence. (In effect,
whatever font you specify using the escape sequence is stored in memory as the menu's
Escape Sequence font selection.)
You send an escape sequence to the terminal window by using the UNIX echo(l) command.
The escape sequence to change the xterm display font is comprised of the following
keystrokes:
102 X Window System User's Guide
This font will remain the Escape Sequence font for the duration of the xterm process, unless
you again change the display font with an escape sequence. If you enter another font name
using the escape sequence described above, the window will display in that new font and the
Escape Sequence menu item will toggle it.
The Selection Menu Item
The Selection menu item allows you to toggle a font whose name you've previously
"selected." The font name could be selected with the pointer, for example, from xlsfonts out-
put, using the "cut-and-paste" techniques described in Chapter 4, The xterm Terminal Emula-
tor. It is far more likely, though, that you would use this menu item after selecting a font
with xfontsel. This menu item was clearly designed with xfontsel in mind. (If no text is cur-
rently selected, this menu item is "grayed out," indicating that it is unavailable.)
The main limitation of this menu item is that it uses the last text selected as the font name,
regardless of what that text is. If you select a font name, that name is only available through
Selection until you use the pointer to select other text. Since cutting and pasting text is one
of the most useful features of xterm, you will probably be making frequent selections. If the
last selected text was not a valid font name, toggling Selection will not change the display
font, and a beep will inform you that the toggle failed.
Release 2 versus Subsequent Release Fonts
The primary intent of this guide is to describe the features of Release 4 of the standard X
Window System shipped by MIT. However, we assume that many people are still using
Release 3 and that some are still using Release 2. The available display fonts, font naming
conventions, and possible system administration tasks supporting fonts changed radically
from Release 2 to Release 3. For those who have been using Release 2 display fonts, switch-
ing to Release 3 or 4 may take some adjustment. The following two sections will acquaint
you with the differences between Release 2 fonts and the fonts provided in later releases and
show you how to work effectively with the fonts you have.
Font Specification in Release 2
All Release 2 screen fonts are stored in a single directory called/usr/lib/X11/fonts.* If you
do a listing of that directory, you'll see a list of filenames with .snfextensions. These are the
font files. In Release 2, the name of a font is equivalent to the name of the file in which it is
stored, without the .snfextension.
Thus, the file fg-16.snf contains the font fg-16. To create an xterm window in which text will
be displayed with the font namedfg-16, type the command line:
*At Release 3, most Release 2 fonts were moved from the standard distribution of X to the user-contributed
distribution.
104 X Window System User's Guide
6
Graphics Utilities
This chapter describes how to use the major graphics clients included with X,
notably the bitmap editor.
In This Chapter:
Creating Icons and Other Bitmaps ....................................................... 109
Bitmap Editing Commands ............................................................... 111
Pointer Commands ........................................................................ 112
Bitmap Command Boxes ............................................................... 112
Acting on the Entire Grid: Clear All, Set All, Invert All .................... 112
Acting on an Area: Clear Area, Set Area, Invert Area .................... 114
Copy Area, Move Area, Overlay Area ............................................ 115
Drawing: Line, Circle, Filled Circle ................................................. 116
Filling in a Shape: Flood Fill .......................................................... 117
Hot Spots: Set Hot Spot, Clear Hot Spot ....................................... 117
Saving and Quitting: Write Output, Quit ......................................... 117
Creating a Bitmap from a Cursor ...................................................... 119
Magnifying Portions of the Screen: xmag ........................................ 122
Quitting xmag ................................................................................ 123
What xmag Shows You .................................................................. 123
Dynamically Choosing a Different Source Area .............................. 125
6
Graphics Utilities
The standard release of X includes four utilities to help you create bitmap images: bitmap,
bmtoa, atobm, and xmag. The most powerful and useful of these clients is bitmap, a program
that lets you create and edit bitmap files. The following sections include detailed ins-uctions
for using the bitmap client.
The bmtoa and atobm clients are programs that convert bitmaps to arrays (of ASCII charac-
ters) and arrays to bitmaps. They are used to facilitate printing and file manipulation and can
help you convert a font character to a bitmap.
In a sense, the xmag client is a desk accessory for graphics programs. This client is used to
magnify a portion of the screen, assisting you in creating images with a graphics editor, such
as bitmap.
Creating Icons and Other Bitmaps
The bitmap program allows you to create and edit small bitmaps. A bitmap is a grid of pix-
els, or picture elements, each of which is white, black, or, in the case of color displays, a
color. You can use bitmap to create backgrounds, icons, and pointers.
At this point in X Window System development, bitmap is primarily a programming tool for
application developers. However, several applications allow you to design your own icon or
background pattern with bitmap, save it in a bitmap file, and specify that filename on the
command line.* For example, xsetroot (described in Chapter 11, Setup Clients) allows you
to specify a bitmap that will be used as the background pattern for the root window.
To invoke bitmap, type:
% bitmap filename &
An upper-left corner cursor appears on the screen for you to interactively place the bitmap
window, shown in Figure 6-1.
*There are many bitmaps included in the X distribution. These can be found in the directory/usr/include/Xll/bit-
maps. Samples are shown in Appendix G, Standard Bitmaps.
Graphics Utilities 109
Clear All
Set All
Invert All
I Clear Area
I SetArea I
I InvertArea I
I CopyArea I
I MoveArea I
[Overlay Area
I Line
I Circle
I Filled Circle I
I FloodFill I
I Se Ho Spo
IClear Hot Spot
Figure 6-2. Gumby bitmap
Figure 6-2 shows our own rendition of Gumby, created using various bitmap edififig com-
mands. The standard cursor font also contains a Gumby character. (You can specify the
Gumby cursor as the xterm window pointer, as described in Chapter 9, Setting Resources, or
as the root window pointer using the xsetroot client, as described in Chapter 11, Setup
Clients.) Later in this chapter, we'll show you how to convert the Gumby character of the
cursor font to a bitmap file, using the atobm client.
Bitmap Editing Commands
You can create and edit a bitmap using a combination of pointer commands and commands
that appear in boxes on the right-hand side of the window. The pointer commands work on
one square of the grid at a time, while the command boxes can work on the entire grid or a
specified area.
Graphics Utilities 111
Pointer Commands
When the pointer is in the checkerboard grid, each mouse button has a different effect upon
the single square under the pointer. You can hold down a mouse button and drag the pointer
to effect several squares in a row.
left button Changes a grid square to the foreground color and sets the corresponding
bitmap bit to 1. (On a monochrome display, background color means
white and foreground color means black.)
middle button Inverts a grid square, changing its color and inverting its bitmap bit.
right button Changes a grid square to the background color and sets the corresponding
bitmap bit to O.
Bitmap Command Boxes
To invoke any bitmap command, move the pointer to the appropriate command box and click
any button, bitmap does not have an Undo command. Once you have made a change, you
cannot retrieve the original.
Acting on the Entire Grid- Clear All, Set All, Invert All
To Clear All, Set All, or Invert All, click on the appropriate command box.
Clear All
Changes all the grid squares to the background color and sets all bit-
map bits to O.
Clear All
Set All
Invert All
Clear Area
Set Area
Invert Area
Copy Area I
I MoveArea I
I Overlay Area
Line
Circle
I Filled Circle I
Figure 6-3. Clearing all
112 X Window System User's Guide
Set All
Changes all the grid squares to the foreground color and sets all bit-
map bits to 1.
[ Clear All I
Set All
[ Invert All
[ Clear Area
[ SetArea
[ InvertArea ]
I CopyArea I
[ MoveArea ]
I Overlay Area
[ Line
I Circle
I Filled Circle I
Figure 6-4. Setting all
Invert All
Inverts all the grid squares and bitmap bits, as if you had pressed the
middle button over each square.
Clear All
Set All
Invert All
1 Clear Area I
Set Area
i invertArea i
i CopyArea
Move Area I
I Overlay Area I
I Line
I Circle
Filled Circle I
Figure 6-5. Inverting all
Graphics Utilities 113
Acting on an Area: Clear Area, Set Area, Invert Area
Clear Area
Set Area
Clears a rectangular area of the grid, i.e., changes it to the back-
ground color, and sets the corresponding bitmap bits to 0.
Changes a rectangular area of the grid to the foreground color and
sets the corresponding bitmap bits to 1.
Invert Area
Changes a rectangular area of the grid from the background color to
the foreground color or the foreground color to the background
color.
Clear All I
SetA, I
I =nve A" I
Clear Area
Set Area I
I InvertArea I
Copy Area J
Move Area ]
Overlay Area]
Line ]
Circle 1
I Filled Circle I
Figure 6-6. Selecting an area to c/ear, set, or invert
The procedure to act on an area is as follows:
1. Click the pointer over the command (Clear Area, Set Area, or Invert Area). The pointer
turns into an upper-left comer.
2. Move the pointer over the upper-left comer of the area you want to clear, set, or invert.
Press and hold any button. The pointer changes to a lower-right comer.
3. Move the pointer to the lower-right comer of the area you want to act on. X's cover the
rectangular area as you move the pointer. Release the button.
If the pointer has changed to a lower-right comer and you wish to abort the command
without inverting an area, either click another button, move the pointer outside the grid,
or move the pointer above or to the left of the upper-left comer.
114 X Window System User's Guide
Copy Area, Move Area, Overlay Area
Copy Area
Copies a rectangular area from one part of the grid to another.
Move Area
Moves a rectangular area from one part of the grid to another.
Overlay Area
Lays a rectangular area from one part of the grid over a rectangular
area in another part of the grid. Overlay is not a pixel-for-pixel
replacement, but those pixels that are clear (bitmap bits set to 0)
allow those pixels that are set (bitmap bits set to 1) to show through
the overlay.
Clear All
Set All
Invert All
I Clear Area ]
Set Area
[ InvertArea I
I CopyArea I
Move Area
Overlay Area
Line
Circle
Filled Circle I
Figure 6-7. Selecting an area to copy, move, or overlay
The procedure to Copy Area, Move Area, or Overlay Area is as follows:
1. Click the pointer over the command (Copy Area, Move Area, or Overlay Area). The
pointer turns into an upper-left comer.
2. Move the pointer over the upper-left comer of the area you want to copy, move, or over-
lay. Press and hold any button. The pointer changes to a lower-right comer.
3. Move the pointer to the lower-right comer of the area you want to act on. X's cover the
rectangular area as you move the pointer. Release the button. The pointer changes to an
upper-left comer.
Graphics Utilities 115
4. Move the pointer to the desired location and click any button.
OR:
Press and hold any button to see the outline of the destination rectangle, move the pointer
to the desired location, then release the button.
5. To cancel an overlay, copy, or move command, move the pointer outside the grid and
release the button.
Drawing: Line, Circle, Filled Circle
When you use a drawing command, the drawing is always done in the foreground color.
Line Draws a line between any two points you select.
Circle Draws a circle. You specify the center and the radius.
Filled Circle Draws a filled circle. You specify the center and the radius.
Clear All
Set All
[ Clear Area ]
[ SetArea
Invert Area
I CopyArea
Move Area
I Overlay Area
Line
Circle
[ Filled Circle
Figure 6-8. Selecting center and radius of circle
To draw a line or circle:
1. Click the pointer over the command Line, Circle, or Filled Circle. The pointer changes to
the dot cursor shape (o).
2. Move the pointer to the first point of the line or to the center of the circle. Click any but-
ton. An X fills the square which is the starting point of the line or center of the circle.
3. Move the pointer to the end point of the line or to the outside circumference of the circle.
Click any button. The graphic is drawn.
116 X Window System User's Guide
Filling In a Shape: Flood Fill
Flood Fill Fills all clear squares in a closed shape.
To fill a shape:
1. Click the pointer over the command Flood Fill. The pointer changes to the dot cursor
shape (.).
2. Move the pointer into the shape you want to fill.
3. Click on any clear square inside the closed shape and all clear squares are filled out to the
shape's border. If the shape is not closed, the entire grid will be filled.
Hot Spots: Set Hot Spot, Clear Hot Spot
Set Hot Spot
Clear Hot Spot
Designates a point on the bitmap as the hot spot. If a program is
using your bitmap as a pointer, the hot spot indicates which point on
the bitmap will track the actual location of the pointer. For instance,
if your pointer is an arrow, the hot spot should be the tip of the
arrow; if your pointer is a cross, the hot spot should be that point at
which the perpendicular lines intersect.
Removes a hot spot defined on this bitmap.
To set or clear a hot spot:
1. Click the pointer over Set Hot Spot or Clear Hot Spot.
2. Move the pointer to the location of the hot spot. Click any button. When a hot spot is
active a diamond (0) appears in the square.
Saving and Quitting: Write Output, Quit
Write Output
Writes the current bitmap value to the file specified in the command
line. If the file already exists, the original file is first renamed to
Jilename-.
If either the renaming or the writing causes an error (e.g., permission
denied), a dialog box appears, asking if you want to write the file
ItmplJilename instead. If you click Yes, all future Write Output com-
mands in the current bitmap editing session write to ItmplJilename.
See the bitmap reference page in Part Three of this guide for infor-
mation on the format of the output file.
Graphics Utilities 117
Creating a Bitmap from a Cursor
The atobm and bmtoa clients allow you to convert arrays (of ASCII characters) to bitmap
files and to convert bitmap files to arrays. These clients are commonly used to facilitate
printing: a bitmap file that is converted to ASCII text can be printed more readily and can
also be included in standard ASCII text files. Once converted to ASCII, bitmap files can also
be more quickly copied or mailed to other directories or systems, where they can be used in
ASCII format or converted back to bitmap format.
Among their uses, the bmtoa and atobm utilities make it possible to convert a character from
a font, such as the cursor font, to the bitmap file format. Once converted, the file can be
edited using the bitmap client, and used as you would any other bitmap file: specified as the
root window pattern (with xsetroot), etc.
When a bitmap file is converted to ASCII text, it is in the form of an array consisting of two
types of characters. (An array is a number of elements arranged in rows and columns; it is
sometimes called a matrix.) One character represents set or filled squares of the bitmap (bit-
map bit 1) and the other character represents empty squares (bitmap bit 0). By default, the
number sign character (#) represents filled squares and the hyphen (-) represents empty
squares. Figure 6-10 shows the British pound sign character of the 9x15 font (in the misc
directory) as an array of these ASCII symbols.
Figure 6-10. ASCII array representing the pound sign
As you can see, the array is a perfect rectangle. In a sense, the array is very similar to the bit-
map grid. (You can edit or create the array using an ASCII text editor, so long as you use the
standard two characters and keep the array rectangular.)
To convert the Gumby character of the cursor font to a bitmap, the first thing you must do is
display the cursor font as ASCII text. This can be done with the showsnfclient, which allows
you to display the contents of a font file (with a .snfextension). The -g opdon specifies that
arrays of all the characters in the font be displayed as well.
To display the cursor font with each character represented as an array, use showsnf, with the
font filename as an argument, and redirect output to a file called Itmplcursor.array:
% showsnf -g /usr/lib/Xll/fonts/misc/cursor.snf > /tmp/cursor.array
Graphics Utilities 119
The cursor.array file contains information about the font and an array for each character.
Using your ASCII text editing program, edit the file, writing the Gumby array to another file
called/tmp/gumby.array. The Gumby array is pictured in Figure 6-11.
--### .....
.... # ..... #--###
.... # ..... #--###
.... #__#__#_####
.... #__#__#__###
.... #__#__#
___#___#___# ....
__# .... # .... #___
Figure 6-11. /tmp/gumby.array
You can then use the atobm client to convert this array to a bitmap. Use the gumby.array file
as an argument and redirect the output to a bitmap file:
% aton /tmp/gumby.array > /tmp/gumby.bitmap
Figure 6-12 shows the Gumby bitmap. As you can see from the bitmap, the Gumby character
of the cursor font is considerably smaller than the Gumby we created (Figure 6-2) with bit-
map.
If you want, you can then edit the gumby.bitmap file using the bitmap client.
If you specify the bitmap as the root window pattern, you'll notice that there is virtually no
space between the Gumby figures. This is because the array file had no extra hyphens (repre-
senting empty bitmap squares) padding it. If you want, you can add some hyphens to the
gumby.array file (keeping the image symmetrical) and then use atobm to create a more pad-
ded version of the bitmap. Figure 6-13 shows the gumby.array file after being padded with
hyphens.
See the bitmap reference page in Part Three of this guide for more information on the atobm
and bmtoa conversion clients.
120 X Window System User's Guide
!
._.
|
I Clear All
I SetA,
I Invert All
I Clear Area I
I Set Area
I InvertArea I
I CopyArea I
{ MoveArea ]
[Overlay Area
I Line
I Circle
I Filled Circle
Figure 6-12. Bitmap of the Gumby cursor
# ...... #--###
#--#--#--###
#--#--#
#---#---#
# .... # .... #
Figure 6-13. gumby.array padded by hyphens
Graphics Utilities 121
Magnifying Portions of the Screen: xmag
The xmag client enables you to magnify a portion of the screen. The close-up look xmag
affords can assist you in creating and editing bitmaps and other graphic images.
xmag is primarily a tool for application developers using sophisticated graphics programs.
But you could also use xmag in concert with the bitmap client. For instance, say you're run-
ning a program that creates a special image on the root window and you'd like to create a bit-
map file of a part of that image. You can display a magnification of the image you want with
xmag, and try to recreate the image by editing in an open bitmap window.
If you invoke xmag without options, you can interactively choose the area to be magnified
(the source area) and position the magnified image on your screen. At the command line,
type:
% xmag&
The pointer changes to a small cross (the crosshair cursor) in the center of a small, hollow
square with a wavering border. (By default, the square is 64 pixels on each side.) Move the
crosshair cursor, placing the square over the area you want to magnify, and click the first
mouse button.
The crosshair changes to an upper-left corner cursor, and the hollow square becomes
enlarged to the size of the magnified image. (By default, the image is magnified five times.)
Move the upper-left corner cursor, positioning the square where you want the magnified
image. Again click the first mouse button and the xmag window containing the magnified
bitmap image is displayed, as shown in Figure 6-14.
If you are using a window manager that provides titlebars, such as twm, the title string "Mag-
nifying Glass" will be displayed in the xmag window titlebar. This is the default title string
of the application.*
The default-size xmag window shows an area 64 pixels square, magnified five times. This
magnification enables you to see the individual pixels, which are represented by squares of
the same color as the corresponding pixels in the source image.
Rather than use the default source area and magnification, you can specify other values on
the command line. See the xmag reference page in Part Three of this guide for a complete
list of options.
*Applications written using the X Toolkit allow you to change the title string. See the section "Title and Name" in
Chapter 8, Command Line Options, for details. The xmag client was not written using the X Toolkit and provides no
method for changing the title string.
122 X Window System User's Guide
Figure 6-14. xmag window displaying magnified screen area
Quitting xmag
To exit the program, type q, Q, or Control-C in the xmag window.
What xmag Shows You
xmag enables you to determine the x and y coordinates, bitmap bit setting, and RGB color
value of every pixel in the xmag window. (See Chapter 8, Command Line Options, for a dis-
cussion of the RGB color model.) If you move the pointer into the xmag window, the cursor
becomes an arrow. Point the arrow at one of the magnified pixels and press and hold down
the first mouse buuon. Across the top edge of the window, a banner displays information
about the pixel, as shown in Figure 6-15.
Graphics Utilities 123
Dynamically Choosing a Different Source Area
If you want to magnify another portion of the screen using the same source area size and
magnification, you do not have to start xmag again. Simply move the pointer into the xmag
window and click the second or third mouse button, or press the space bar. The magnified
image disappears and again the cursor becomes a crosshair surrounded by a hollow square.
Move the crosshair cursor, placing the square over the new source area you want to magnify,
and click any mouse button. The magnified image is immediately displayed in the location
you placed the first image.
You can select any number of source areas during a single xmag session.
Graphics Utilities
125
7
Other Clients
This chapter gives an overview of other clients available with X, including
window and display information clients, printing utilities, the xkill program,
and several "desk accessories."
In This Chapter:
Desk Accessories ................................................................................ 129
Clock Programs: xclock and oclock ................................................. 130
A Scientific Calculator: xcalc ........................................................... 132
Terminating the calculator .............................................................. 133
Mail Notification Client: xbiff ............................................................ 133
Monitoring System Load Average: xload ......................................... 134
Browsing Reference Pages: xman .................................................. 135
Release 3 xman ............................................................................. 138
Printing Utilities: xwd, xpr, xdpr ........................................................... 140
Killing a Client Window with xkill ........................................................... 141
Problems with Killing a Client ........................................................... 142
Window and Display Information Clients .............................................. 144
Displaying Information about a Window: xwininfo ............................ 144
Listing the Window Tree: xlswins ..................................................... 146
Listing the Currently Running Clients: xlsclients .............................. 148
Generating Information about the Display: xdpyinfo ........................ 149
User-contributed Clients ...................................................................... 150
X Toolkit Applications ........................................................................... 150
Dialog Boxes and Command Buttons ............................................... 151
Scrollbars ........................................................................................ 152
Selecting Information for Copying and Pasting ................................. 152
Vertical Panes .................................................................................. 153
Viewports ........................................................................................ 154
Text Editing Widget .......................................................................... 154
A Scientific Calculator: xcalc
xcalc is a scientific calculator that can emulate a TI-30 or an HP-10C. Once you place the
pointer within the xcalc window, the calculator can be operated in two ways: with the
pointer, by clicking the first pointer button on the buttons in the calculator window, or with
the keyboard, by typing the same numbers and symbols that are displayed in the calculator
window. When using the first method, notice that the pointer appears as a small hand, ena-
bling you to "press" the buttons. Figure 7-4 shows xcalc on the screen.
0
DEG
Figure 7-4. The default xcalc (TI-30 mode) on the screen
This is the version of the calculator provided with Release 4 of X. As you can see, it features
oval buttons. If you are running an earlier release, the calculator will have rectangular but-
tons and may also have darker background coloring. These differences do not affect func-
tionality. However, the Release 3 and Release 4 versions of xcalc do work somewhat differ-
ently. We've described some of those differences below. For additional information, see the
xcalc reference page in Part Three of this guide.
The long horizontal window along the top of the calculator is the display in which the values
are punched on the calculator and their results are displayed. You can enter values either by
clicking on the calculator keys with the pointer, or by pressing equivalent keys on the key-
board. Most of the calculator keys have keyboard equivalents. The non-obvious equivalents
are described on the xcalc reference page in Part Three.
132 X Window System User's Guide
No mail
New mail has arrived
Figure 7-5. xbiff before and after mail is received
Monitoring System Load Average- xload
xload periodically polls the system for the load average, and graphically displays that load
using a simple histogram. By default, xload polls the system every 5 seconds. You can
change this frequency with the -update option. For example, if you type the following
command at an xterm window:
t xload -update 3 &
you can interactively place an xload window polling every 3 seconds.
your system
Figure 7-6. A sample xioad window
If you are using both the local machine and remote machines, you can display loads for all
systems and do your processing on the system that is fastest at the time.
134 X Window System User's Guide
Browsing Reference Pages: xman
The xrnan client allows you to display and browse through formatted versions of manual
pages (reference pages). By default, xman lets you look at the standard UNIX manpages
found in subdirectories of the directory lusr/man. The standard version of X assumes there
are ten subdirectories: manl through man8, corresponding to the eight sections of manpages
in the UNIX documentation set; manl (man local) and mann (man new). You can specify
other directories by setting the MANPATH system variable. (The individual directory names
should be separated by colons.)
This section describes the version of xman provided with Release 4 of X. From a user's
viewpoint, the general operation of the client has not changed much since prior releases, but
the organization of menus and options has changed. If you are running Release 3 of X, read
this section for an idea of how the client works and then take a look at the next section,
"Release 3 xman," for a summary of the differences.
Regardless of the version of X, you run xman by t)qging:
in an xterm window.
The initial xman window, shown in Figure 7-7, is a small window containing only a few com-
mands.
Manual Browser
(Manual Page
Figure 7-7. Initial xman window
This window is small enough to be displayed for prolonged periods during which you might
have need to examine UNIX manual pages. You select a command by clicking on it with the
first pointer button.
The Manual Page command brings up a larger window in which you can display a formatted
version of any manual page in the MANPATH. By default, the first page displayed contains
general help informaUon about xman. Use this information to acquaint yourself with the cli-
ent's features. (The actual xman reference page in Part Three of this guide primarily
describes how to customize the client.)
Other Clients
135
I
I
otons
IS cd.
CD{ 1) USER Commands CD{ 1)
NAME
cd - change working directory
SYNOPSIS
cd directory
DESCRIPTION
Directory becomes the new working dlrectory. The process must
ave execute (search) Derission in directory.
Because a new process is creaed zo execute each coand, cd
would be ineffective if it were writte as a normal command.
it is a therefore recogrlzea and executed by the shells. In
csh([) you may specify a is of directories in whc. direc-
tory is to be sough as subdirectory i: it is not a
dlrecory of the current irectory; see the escrlptlon of
the cdpath varlable in csh(1)
SEE ALSO
csh(1), sh(1), pwo(1), cho:r(2)
To display another manual page from the same directory, display the Xman Options menu
again. Select Display Directory, and the directory listing is again displayed in the window.
Then click on another command name to display its manual page in the window. (If you
decide not to display another manpage, you can remove the directory listing and go back to
the manpage previously displayed by using the second Xman Options menu selection, Display
Manual Page. Display Directory and Display Manual Page are toggles of one another.)
To display a manual page from another directory in the MANPATH, you must first change to
that directory using the second xman menu, Xman Sections. You bring up the menu by plac-
ing the pointer in the Sections box in the application's titlebar and holding down the first but-
ton. The Xman Sections menu lists the default directories of UNIX manual pages, as in
Figure 7-10.
Other Clients 137
Xman Sections
(1) User Commands
(2) System Calls
(3) Subroutines
(4) Devices
(5) File Formats
(6) Games
(7) Miscellaneous
(8) Sys. Administration
(I) Local
(n) New
(o) Old
Figure 7-10. Xman Sections menu
You can select another directory of manpages from which to choose with the first pointer but-
ton. Once you select a directory, the files in that directory are listed in the window. Again,
you display a page by clicking on its name with the first pointer button.
You can display more than one "browsing" window simultaneously by selecting the Open
New Manpa0e option from the Xman Options menu. An additional manpage window will be
opened, again starting with the help information.
You can remove a browsing window by selecting the Remove This Manpa0o option from the
Xman Options menu. (Prior to Release 4, selecting this option resulted in an error and caused
the xman program to exit.)
Selecting Quit from the Xman Options menu or from the initial xman window causes the cli-
ent to exit.
Release 3 xman
In the Release 3 version of xman, the horizontal bar spanning the top of the browsing window
merely contains information about the contents of the window. It is not divided and it does
not contain obvious text handles to any menus.
Though it may not be readily apparent, you can access the Xman Options menu simply by
placing the pointer in the horizontal bar. You can then display manpages from the default
directory by following the steps outlined in the previous section. Xman Options is the only
menu directly accessible from the horizontal bar.
The Release 3 Xman Options menu differs slightly in options and organization from the
Release 4 menu. The Release 3 menu is pictured in Figure 7-11.
138 X Window System User's Guide
Xman Options
Change Section
Display Directory
Display Manual Page
Help
Search
Show Both Screens
Remove This Manpage
Open New Manpage
Quit
Figure 7-11. Release 3 Xman Options menu
Again, you can acquaint yourself with the various options by reading the help information
displayed on the initial manual page. Most of the options and functionality are the same as
described above for Release 4.
The most significant difference is the method of changing directories within the MANPATH.
As we've seen in the Release 4 version of xman, this is accomplished through the Xman Sec-
lions menu, which is accessible directly from the horizontal bar. In the Release 3 version, in
order to change directories you must first bring up the Xman Options menu. Then select the
first option, Change Section (which has been removed from the Release 4 menu). A sub-
menu of Xman Options, called Manual Sections, will be displayed. This sub-menu is the R3
equivalent of the R4 Xman Sections menu.
Like Xman Sections, the Manual Sections menu lists the default directories of UNIX manual
pages. You can select an alternate directory by the method described in the previous section.
The Release 3 version ofxman has one serious limitation. Selecting the option Remove This
Manpage from the Xman Options menu results in an error and causes the xman program to
exit. (This error has been corrected in Release 4.)
Other Clients 139
% xkill
Select the client you wish
kill with button 1 ...
| | ],xterm
.... : .......
-?: .... :.:i: i:. '-::ii)
Figure 7-12. Selecting the window to be removed
You can also specify the window to be killed by its resource ID. Every window has an iden-
tification number associated with it. The xwininfo client can be used to display a window's
resource ID (see the section "Window and Display Information" later in this chapter).
To remove a window using its ID number, type:
% x.kill -id number
The window with the ID number is removed. Killing a window by its ID number is more
cumbersome, but it's somewhat safer than choosing the window to be killed with the pointer.
It's too easy to click in the wrong place. (Of course, it's less treacherous to use the pointer
on an isolated window than a window in a stack.)
Problems with Killing a Client
The most obvious problem with xki//is that it's possible to kill the wrong window inadver-
tently. Perhaps less obvious is a problem inherent in 'killing' a program. As a general rule, a
command that 'kills" a program does not give the program time to save or complete processes
that are still running--in effect, to clean up after itself. The processes that can be adversely
affected may be visible to the user, like an editing session, or they may be underlying system
processes, like writing to or reading from a socket.
142 X Window System User's Guide
The other statistics (with the exception of depth) can be used to gauge the window's geome-
try (size and position). The absolute upper-left X and Y correspond to the positive x and y
offsets of the window from the root window. These figures can be used on the command line
to specify window placement, as described in Chapter 8, Command Line Options.
The relative upper-left X and Y are significant only if you're running a window manager,
such as twm, that provides some sort of frame. The relative upper-left X and Y are the win-
dow's x and y offsets relative to its frame. In this example, the relative upper-left Y of 21
pixels refers to the height of the window's titlebar.
The four comers are listed with the upper left comer first and the other three clockwise
around the window (i.e., upper fight, lower fight, lower left). The upper left comer always
gives the positive x and y offsets for the window. The width and height in pixels are some-
what less useful, since the geometry option to xterm requires that these figures be specified in
characters and lines. See Chapter 8, Command Line Options, for more information about
window geometry and how to set it based on the results of xwininfo.
The values for window depth and colormap relate to how color is specified. See the discus-
sion of color in Chapter 8 for more information.
Be aware that the Release 3 version of xwininfo does not provide relative x and y offsets. It
does provide absolute x and y offsets, though they are labeled simply as:
--> Upper left X: 0
--> Upper left Y: 0
The other statistics provided by xwininfo are listed below:
--> Window class: InputOutput
--> Window Bit Gravity State: NorthWestGravity
--> Window Window Gravity State: NorthWestGravity
--> Window Backing Store State: NotUseful
--> Window Save Under State: no
--> Window Map State: IsViewable
--> Window Override Redirect State: no
These statistics have to do with the underlying mechanics of how a window is resized,
moved, obscured, unobscured, and otherwise manipulated. They are inherent in the client
program and you cannot specify alternatives. For more information on these and other win-
dow attributes, see Chapter 4 in Volume One, Xlib Programming Manual.
You can also use xwininfo with various options to display other window attributes. See the
reference page in Part Three of this guide for details.
Listing the Window Tree: xlswins
Windows are arranged in a hierarchy, much like a family tree, with the root window at the
top. The xlswins client displays the window tree starting with the root window, listing each
window by its resource ID and title (or name), if it has one. (See Chapter 8, Command Line
Options, for a discussion of setting a client's title and name with command line options.)
146 X Window System User's Guide
A resource ID can be supplied to xkill to specify the window to kill. You can also supply a
resource ID to xwininfo to specify the window you want information about, or to xprop to get
the window's properties. Being able to display the ID numbers of all windows on the screen
at once is especially helpful if one or more windows is obscured in the stack. The xwininfo
client is virtually useless in situations in which one window is hidden behind another.
x/swins allows you to determine, by process of elimination, which window is hidden--with-
out having to circulate all the windows on your screen. You can then use xwininfo with the
ID number (displayed by xlswins) to get information about the obscured window.
Figure 7-14 shows the results of xlswins for a simple window arrangement: a single xterm
(login) window on a root window.
Ox8006e ()
Ox3OOOOe (xterm)
0x300015 ()
0x300016 ()
Figure 7-14. Window tree displayed by xlswins
The xterm window is easily identified. Any client that displays a window, such as xterm,
xclock, xfd, bitmap, etc., will be listed by name (in parentheses) following the ID number.*
The root window is listed above the xterm in the window hierarchy. Client (and other) win-
dows displayed on the root window are called children of the root window, in keeping with
the family tree analogy. Thus, the root window is the parent of the xterm window. In the
xlswins listing, a child window is indented once under its parent.
But what are the other windows listed in Figure 7-14? A superficial examination of these
other windows provides a brief introduction to the inner workings of X. An underlying fea-
ture of X is that menus, boxes, icons, and even features of client windows, such as scrollbars,
are actually windows in their own right. What's more, these windows (and client window
icons) may still be considered to exist, even when they are not displayed.
The two remaining windows are unnamed. From the relative indents of the windows, we can
tell certain information. The first unnamed window is a child of the xterm, the second is a
child of the child.
If we again run xlswins, this time requesting a long listing (with the -1 option), we get geom-
etry information that helps identi each window, as shown in Figure 7-15.
O: Ox8006e () i152x900+0+0 +0+0
i: Ox3OOOOe (xterm) 818x484+0+0 +0+0
2: 0x300015 () 818x484+0+0 +i+i
3: 0x300016 () 14x484+-i+-i +0+0
Figure 7-15. Window tree with geometry specifications
The first number on each line refers to the level of the window in the hierarchy, the root win-
dow being at level 0, client windows at 1, etc. The first geometry string is the complete
*Most likely, you will not have to deal with the ID numbers for windows other than the explicitly named client win-
dows. You can use the IDs of the client windows in all of the ways we've discussed: with xkill, xwininfo, xprop, etc.
Other Clients
147
Window 0x30000e:
Machine: colorful
Name: xterm
Icon Name: xterm
Command: xterm -geometry 80x24+I0+I0 -is
Instance/Class: xterm/XTerm
Window 0x40000b:
Machine: colorful
Name: xclock
Icon Name: xclock
Command: xclock -geometry -0-0
Instance/Class: xclock/XClock
Figure 7-16. Long xlsclients listing
As we'll see in Chapter 8, Command Line Options, many clients, including xterm, allow you
to specify an alternate name for a client and a title for the client's window. If you've speci-
fied a title, it will appear in the xlsclients Name field. If you haven't specified a title, but
have specified a name for the application, the name will appear in this field. Neither of the
clients in the sample display has been given an alternate name or title.
You use the instance and class resource names to specify default window characteristics, gen-
erally by placing them in a file in your home directory. This is described in detail in Chapter
9, Setting Resources.
Generating Information about the Display: xdpyinfo
The xdpyinfo client gives information about the X display, including the name of the display
(contents of the DISPLAY variable), version and release of X, number of screens, current
screen, and statistics relating to the color, resolution, input, and storage capabilities of each
screen. The xdpyinfo reference page in Part Three of this guide shows a listing for a display
that supports both a color and monochrome screen.
Much of the information provided by xdpyinfo has to do with how clients communicate infor-
mation to one another and is more relevant to a programmer than to the typical user. How-
ever, the basic statistics about the name of the display, the version and release of X, and the
number and nature of screens might be very helpful to a user, particularly one who is using a
display for the first time.
In addition, the detailed information about each screen's color capabilities can also be very
valuable in learning how to use color more effectively. This information includes the default
number of colormap cells: the number of colors you can use on the display at any one time.
See Chapter 8, Command Line Options, for more information on the use of color and how to
specify colors for many clients.
See Volume One, Xlib Programming Manual, for insights into some of the other information
provided by xdpyinfo.
Other Clients 149
User-contributed Clients
In addition to the clients in the standard MIT X distribution, there are many user-contributed
clients available in the X source tree, distributed over Usenet, and perhaps included with var-
ious commercial distributions. If you have access to Usenet, the newsgroup comp.windows.x
contains voluminous discussions of X programming and the newsgroup comp.sources.x con-
tains sources.
Prior to Release 4, uwm (the universal window manager) was the official window manager
shipped with the standard X Window System. As of Release 4, uwm is no longer supported,
but is still available as a user-contributed client. However, be aware that uwm does not com-
ply with accepted interclient communication conventions and thus, should probably not be
the window manager of choice.
Several other window managers are widely used and have been tailored to reflect the inter-
client communication conventions proposed in Release 3. Some of the more popular window
managers that reflect these conventions are:
awm Ardent window manager (written by Jordan Hubbard of Ardent Computer
Corporation).
rtl Tiled window manager (written by Ellis Cohen at Siemens Research &
Technology Laboratories, RTL).
olwm OPEN LOOK window manager (developed by AT&T).
mwm Motif window manager (written by Ellis Cohen at the Open Software
Foundation).
Appendix C, The OSF/Motif Window Manager, discusses mwm in greater detail.
Commercial products (such as spreadsheets, word processors, and graphics or publishing
applications) based on the X Window System are also becoming available.
X Toolkit Applications
Many clients have been written (or rewritten) with a programming library called the X
Toolkit. The X Toolkit provides a number of predefined components called widgets. Widg-
ets make it easier to create complex applications; they also ensure a consistent user interface
between applications.
Most of the clients described in this guide were written before the X Toolkit was fully devel-
oped. Although they have since been rewritten to use the X Toolkit, they don't necessarily
make full use of all its features.
However, most of the standard clients use enough of these features that you can see what to
expect from future applications that are based more fully on the X Toolkit.
150 X Window System User's Guide
(A very handy shortcut exists in some applications: if you press the original button again, it
will be interpreted as a Confirm. If you press any other command button, it will be inter-
preted as an Abort.)
Scrollbars
As described in the discussion of xterm in Chapter 4, The xterm Terminal Emulator, applica-
tions can use a scrollbar to move up and down through data that is too large to fit in a win-
dow. A scrollbar is an X Toolkit widget.
The scrollbar consists of a sliding bar (often called the thumb) within a columnar slide
region. The size of the thumb within the scrollbar corresponds to the amount of the data
displayed within the visible portion of the window with respect to the entire body of data. If
no data has yet been displayed in the window, the thumb fills the entire scrolling region, as
shown in Figure 7-18.
xterm uses a vertical scrollbar; other applications may use a horizontal scrollbar, or both.
One type of widget that can have both horizontal and vertical scrollbars is called a viewport.
When the pointer is moved into the scrollbar, the cursor appears as an arrow that points in the
direction that scrolling can occur. If scrolling can occur in either direction, the cursor
appears as a two-headed arrow.
When the middle pointer button is clicked at any point in the scrollbar, the thumb moves to
that point, and the data in the window scrolls to the corresponding position. When the
middle pointer button is pressed and held down, the thumb can be "dragged" to a desired
position in the scrollbar. If you click the first (left) button in the scrollbar, the data in the
window scrolls up, toward the end of the information in the window. If you click the third
(right) button, the data in the window scrolls down, towards the beginning of the information
in the window.
Selecting Information for Copying and Pasting
As described in the discussion of xterm in Chapter 4, when you select contents from one file,
those contents become the PRIMARY selection, which is available to other clients. For
example, you can select text in one xterm window and paste the text into any other xterm
window. See Chapter 4, The xterm Terminal Emulator, for a complete discussion of copying
and pasting. In applications written with the X Toolkit, selections are a method of
widget-to-widget communication.
152 X Window System User's Guide
Control-A
Control-B
Control-D
Control-E
Control-F
Control-H, or
Backspace
Control-J,
Control-M,
LineFeed, or
Return
ControI-K
Control-I
ControI-N
ControI-O
ControI-P
ControI-V
ControI-W
ControI-Y
ControI-Z
Meta-<
Meta->
Meta-[
Meta-]
Meta-B
Meta-D
Meta-F
Meta-H, or
Meta-Delete
Meta-I
Meta-V
Move to the beginning of the current line.
Move backward one character.
Delete the next character.
Move to the end of the current line.
Move forward one character.
Delete the previous character.
New paragraph.
Kill the rest of this line.
Redraw this window.
Move down to the next line.
Divide this line into two lines, at this point.
Move up to the previous line.
Move down to the next screenful of text.
Kill the selected text.
Insert the last killed texL
Scroll the text one line up.
Move to the beginning of the file.
Move to the end of the file.
Move backward one paragraph.
Move forward one paragraph.
Move backward one word.
Kill the next word.
Move forward one word.
Kill the previous word.
Insert a file. If any text is selected, use the selected text as the
filename. Otherwise, a dialog box will appear in which you can type
the desired filename.
Move up to the previous screenful of texL
156 X Window System User's Guide
Meta-Y
Meta-Z
Delete
Insert the last selected text here. Note that this can be text selected in
some other text subwindow. Also, if you select some text in an xterm
window, it may be inserted in an xmh window with this command
Pressing pointer button 2 is equivalent to this command.
Scroll the text one line down.
Delete the previous character.
Other Clients
157
Part Two:
Customizing X
X has been designed to put the user in the driver's seat. Everything from the
colors and sizes of windows to the contents of twm menus can be custom-
ized by the user. This part of the book tells you how to reshape X to your
liking.
Command Line Options
Setting Resources
Customizing the twm Window Manager
Setup Clients
8
Command Line Options
This chapter describes command-line options that are common to most cli-
ents. Some arguments to command-line options can also be specified as the
values of resource variables, described in Chapter 9. For example, the for-
mat of a geometry string or a color specification is the same whether it is
specified as an argument to an option or as the value of a resource definition.
In This Chapter:
Which Display to Run On ..................................................................... 164
Title and Name .................................................................................... 165
Window Geometry ............................................................................... 166
Border Width ....................................................................................... 168
Color Specification ............................................................................... 169
The rgb.txt File ................................................................................. 169
Release 4 Color Names ................................................................... 170
Release 3 Color Names ................................................................... 172
Alternative Release 4 Color Databases ............................................ 172
Hexadecimal Color Specification ...................................................... 172
The RGB Color Model .................................................................... 173
How Many Colors are Available? ................................................... 174
Starting a Client Window as an Icon ..................................................... 176
Specifying Fonts on the Command Line ............................................... 176
Reverse Video ..................................................................................... 177
The host specifies on which machine to create the window, the server specifies the
server number, and the screen specifies the screen number. Note that the server param-
eter always begins with a colon (a double colon after a DECnet node*), and that the screen
parameter always begins with a period. If the host is omitted or is specified as unix, the
local node is assumed. If the screen is omitted, screen 0 is assumed.
xterm and other X clients normally get the host, server, and screen from the DISPLAY envi-
ronment variable. (In most configurations, DISPLAY will be set to the local host, server 0 and
screen 0.)
However, you may want to specify the host, server, and screen explicitly. You can do this for
all clients by resetting the value of the DISPLAY variable, or for a single invocation of a cli-
ent by using the -display option.
For example:
% xterm-display other_node:O.O &
creates an xterm window on screen 0 of server 0 on the machine named othe__node.
Although much of the current X Window System documentation suggests that any of the
parameters to the -display option can be omitted and will default to the local node, server
and screen 0, respectively, we have not found this to be true. In our experience, only the
host and screen parameters (and the period preceding screen) can be omitted. The
colon and server are necessary in all circumstances.
The -display option can be abbreviated as -d.
Title and Name
The name of the program (as known to the server) and the title of the window can be speci-
fied on the command line. The -title option allows you to specify a text string as the title
of the application's window. If your application has a titlebar, or if the window manager you
are using puts titlebars on windows, this string will appear in the titlebar. Window titles can
be useful in distinguishing multiple instances of the same application.
The -name option actually changes the name by which the server identifies the program.
Changing the name of the application itself (with the -name option) affects the way the
application interprets resource files. This option is discussed further in Chapter 9, Setting
Resources. If a name string is defined for an application, that string will appear as the appli-
cation name in its icon.
If you display information about currently running windows using the xwininfo or xlswins
client, title strings will appear in parentheses after the associated window ID numbers. (If
there is no title string, but there is a name string, the name string will be displayed.)
*By convention, DECnet node names end with a colon.
Command Line Options
165
You can also use the xwininfo client to request information about a particular window by
title, or name, if no title string is defined, using that application's own -name option. See
the xlswins and xwininfo reference pages in Part Three and the section "Window and Display
Information Clients" in Chapter 7, Other Clients, to learn more about these clients.
Window Geometry
All clients that display in a window take a geometry option that specifies the size and loca-
tion of the client window. The syntax of the geometry option is:
-geometry geometry
The -geometry option can be (and often is) abbreviated to -g, unless there is a conflicting
option that begins with "g."
The parameter to the geometry option (geometry), referred to as a "standard geometry
string," has the form:
wi dthxhei gh t+xof f+yof f
The variables, width, height, xoff (X offset), and yoff (y offset) are values in pixels
for many clients. However, application developers are encouraged to use units that are
meaningful to the application. For example, xterm uses columns and rows of text as width
and height values in the xterm window.
You can specify any or all elements of the geometry string. Incomplete geometry specifica-
tions are compared to the resource manager defaults and missing elements are supplied by
the values specified there. If no default is specified there, and twm is running, the window
manager will require you to place the window interactively.
The values for the x and y offsets and their effects are shown in Table 8-2.
Table 8-2. Geometry specification x and y offsets
Offset Variables
+xoff
+yoff
-xoff
-yoff
Description
A positive x offset specifies the distance the left edge of the window is
offset from the left side of the display.
A positive y offset specifies the distance the top edge of the window is
offset from the top of the display.
A negative x offset specifies the distance the right edge of the window
is offset from the right side of the display.
A negative y offset specifies the distance the bottom edge of the win-
dow is offset from the bottom of the display.
For example, the command line:
% xclock -geometry 125x125-10+10 &
166 X Window System User's Guide
Color Specification
Many clients have options that allow you to specify the color of the window border, back-
ground, and foreground (the color text or graphic elements will be displayed in). These
options generally have the form:
-bg color Sets the background color.
-fg color Sets the foreground color.
-bd color Sets the border color.
By default, the background of an application window is usually white and the foreground
black, even on color workstations. You can specify a new color using either the color names
listed in a system file called rgb.txt or hexadecimal values representing colors.
In the next section, we'll take a look at some of the colors available in the rgb.txt file. For
now, let's consider the syntax of a command line specifying an xterm to be displayed in three
colors:
% xterm -bg lightblue -fg arkslategrey -bd plum &
This command creates an xterm window with a background of light blue, foreground of dark
slate grey, and window border of plum (all colors are available in both Releases 3 and 4).
At the command line, a color name should be typed as a single word (for example, dark-
slategrey). However, you can type the words comprising a color name separately if you
enclose them in quotes, as in the following command line:
% xterm -bg "light blue" -fg "ark slate grey" -bd plum &
As we'll see, the rgb.txt file contains variants of the same color name (for example, "navy
blue" and "NavyBlue," or "grey" and "gray") to allow a range of spelling, spacing, and capi-
talization on the command line.
Some clients allow additional options to specify color for other elements, such as the cursor,
highlighting, and so on. See the appropriate client reference pages in Part Three of this guide
for details.
The rgb.txt File
The rgb.txt file, usually located in lusrlliblX11, is supplied with the standard distribution of X
and consists of predefined colors assigned to specific text names.
A corresponding compiled file called rgb.dir contains the definitions used by the server; this
machine-readable file serves as a color name database, and is discussed more fully in Appen-
dix A, System Management. The rgb.txt file is the human-readable equivalent.
Command Line Options 169
Section 1:
Section 2:
Section 3:
A standard spectrum of colors, many available in or similar to colors in
Release 3 (such as sea green). These colors seem to be ordered roughly
as follows: off-whites and other pale colors, greys, blues, greens, yel-
lows, browns, oranges, pinks, reds, and purples.
Sub-shades of Section 1 colors (such as SeaGreen 1 through 4). These
sub-shades comprise the largest part of the file.
One hundred and one additional shades of grey, numbered 0 through
100 (also available in Release 3). This large number of precisely gradu-
ated greys provides a wide variety of shading for monochrome screens.
Rather than list every color in the rgb.txt file, we've compiled the following table of repre-
sentative colors. We've chosen some of the more esoteric color names. Naturally, all of the
primary and secondary colors are available also.
Section 1:
ghost white peach puff lavendar blush lemon chiffon
slate grey midnight blue cornflower blue medium slate blue
dodger blue powder blue turquoise pale green
lawn green chartreuse olive drab lime green
khaki light yellow goldenrod indian red
sienna sandy brown salmon coral
tomato hot pink maroon violet red
magenta medium orchid blue violet purple
Secon 2:
snowl - 4
azurel - 4
PaleTurquoisel - 4
SpringGreenl -4
chocolatel - 4
DeepPinkl - 4
Section 3:
bisquel - 4
SteelBluel - 4
aquamarinel - 4
goldl - 4
firebrickl - 4
PaleVioletRedl - 4
grey0 (gray0) rough greyl00 (grayl00)
cornsilkl - 4
DeepSkyBluel - 4
PaleGreenl - 4
RosyBrownl - 4
DarkOrangel - 4
pluml - 4
honeydewl -4
LightCyanl - 4
DarkOliveGreenl - 4
burlywoodl - 4
OrangeRedl - 4
DarkOrchidl - 4
If you want to look more closely at the rgb.txt file, you can open it with any text editor. As
an alternative, you can also display the contents of the file using the showrgb client, showrgb
seems to do nothing more than cat(l) the file to your terminal window. Given the size of the
file, it's necessary to pipe the command's output to a paging program, such as pg(1) or
more(l).
% showrgb [ more
See Appendix A, System Management, for information on customizing color name
definitions.
Command Line Options 171
Release 3 Color Names
The following are the default color names shipped with Release 3 of the X Window System.
Again, this list does not include the many variants of these names.
aquamarine medium aquamarine black blue
cadet blue corn flowerblue dark slate blue light blue
light steel blue medium blue medium slate blue midnight blue
navy blue navy sky blue slate blue
steel blue coral cyan firebrick
brown sandy brown gold goldenrod
medium goldenrod green dark green dark olive green
forest green lime green medium forest green medium sea green
medium spring green pale green sea green spring green
yellow green dark slate grey grey dim grey
light grey khaki magenta maroon
orange orchid dark orchid medium orchid
pink plum red indian red
medium violet red orange red violet red salmon
sienna tan thistle turquoise
dark turquoise medium turquoise violet blue violet
wheat white yellow green yellow
greyO (grayO) drough greylO0 (graylO0)
Alternative Release 4 Color Databases
In addition to the standard color database described above, Release 4 also includes three
other databases that can be compiled by your system administrator. These files can be found
in the general release in the directory ./rgb/others.
raveling.txt
thomas.txt
old-rgb.txt
Designed by Paul Raveling, this database rivals the default database in
size and scope, but has been tuned to display optimally on Hewlett-
Packard monitors.
Based on the Release 3 database, this file has been modified by John
Thomas of Tektronix to approximate the colors in a box of Crayola
Crayons.
This is nothing more than the Release 3 database.
Hexadecimal Color Specification
You can also specify colors more exactly using a hexadecimal color string. You probably
won't use this method unless you require a color not available by using a color name. In
order to understand how this works, you may need a little background on how color is imple-
mented on most workstations.
172 X Window System User's Guide
The RGB Color Model
Most color displays on the market today are based on the RGB color model. Each pixel on
the screen is actually made up of three phosphors: one red, one green, and one blue. Each of
these three phosphors is excited by a separate electron beam. When all three phosphors are
fully illuminated, the pixel appears white to the human eye. When all three are dark, the
pixel appears black. When the illumination of each primary color varies, the three phosphors
generate a subtractive color. For example, equal portions of red and green, with no admix-
ture of blue, makes yellow.
As you might guess, the intensity of each primary color is controlled by a three-part digital
value--and it is the exact makeup of this value that the hexadecimal specification allows you
to set.
Depending on the underlying hardware, different servers may use a larger or smaller number
of bits (from 4 to 16 bits) to describe the intensity of each primary. To insulate you from this
variation, most clients are designed to take color values containing anywhere from 4 to 16
bits (1 to 4 hex digits), and the server then scales them to the hardware. As a result, you can
specify hexadecimal values in any one of the following formats:
#RGB
#RRGGBB
#RRRGGGBBB
#RRRRGGGGBBBB
where R, G, and B represent single hexadecimal digits and determine the intensity of the red,
green, and blue primaries that make up each color.
When fewer than four digits are used, they represent the most significant bits of the value.
For example, # 3 a 6 is the same as # 3 0 0 0 a 0 0 0 6 0 0 0.*
What this means concretely is perhaps best illustrated by looking at the values that corre-
spond to some colors in the color name database. We'll use 8-bit values--two hexadecimal
digits for each primary. The following definitions are the hexadecimal equivalents of the
decimal values for some of the colors found in the rgb.txt file:
#000000 black
#FFFFFF white
#FF0000 red
#00FF00 green
#0000FF blue
#FFFF00 yellow
#00FFFF cyan
#FF00FF magenta
#5FgEA0 cadet blue
#6495ED cornflower blue
#ADDSE6 light blue
#BOC4DE light steel blue
#0000CD medium blue
#000080 navy blue
*If you are unfamiliar with hexadecimal numbering, see the Glossary for a brief explanation, or a basic computer
textbook for a more extended discussion.
Command Line Options
173
#87CEED sky blue
#6A5ACE slate blue
#4682B4 steel blue
As you can see from the colors given above, pure red, green, and blue result from the corre-
sponding bits being turned full on. All primaries off yields black, while all nearly full on
gives white. Yellow, cyan, and magenta can be created by pairing two of the other primaries
at full intensity. The various shades of blue shown above are created by varying the intensity
of each primarynsometimes in unexpected ways.
The bottom line here is that if you don't intimately know the physics of color, the best you
can do is to look up existing colors from the color name database and experiment with them
by varying one or more of the primaries till you find a color you like. Unless you need pre-
cise colors, you are probably better off using color names.
How Many Colors are Available?
The number of distinct colors available on the screen at any one time depends on the amount
of memory available for color specification. (The xdpyinfo client provides information about
a display, including the number of colors available at one time. See Chapter 7, Other Clients,
and the xdpyinfo reference page in Part Three for details.)
A color display uses multiple bits per pixel (also referred to as multiple planes or the depth of
the display) to select colors. Programs that draw in color use the value of these bits as a
pointer to a lookup table called a colormap, in which each entry (or colorcell) contains the
RGB values for a particular color.* As shown in Figure 8-2, any given pixel value is used as
an index into this tablemfor example, a pixel value of 16 will select the sixteenth colorcell.
Why is this technical detail important? Because it explains several issues that you might
encounter in working with color displays.
First, the range of colors possible on the display is a function of the number of bits available
in the colormap for RGB specification. If eight bits is available for each primary, then the
range of possible colors is 256 3 (somewhere over 16 million colors). This means that you
can create incredibly precise differences between colors.
However, the number of different colors that can be displayed on the screen at any one time
is a function of the number of planes. A four-plane system can index 2 ' colorcells (16 dis-
tinct colors); an eight-plane system can index 2 s colorcells (256 distinct colors); and a
24-plane system can index 2 24 colorcells (over 16 million distinct colors).
If you are using a four-plane workstation, the fact that you can precisely define hundreds of
different shades of blue is far less significant than the fact that you can't use them all at the
same time. There isn't space for all of them to be stored in the colormap at one time, or any
mechanism for them to be selected even if they could be stored.
*There is a type of high-end display in which pixel values are used directly to control the illumination of the red,
green, and blue phosphors, but far more commonly, the bits per pixel are used indirectly, with the actual color values
specified independently, as described here.
174 X Window System User's Guide
Frame
Buffer Colormap
R G B
Pixel 16
..... 0 14
..... 0 10
blue
Figure 8-2. Multiple planes used to index a colormap
This limitation is made more significant by the fact that X is a multi-client environment.
When X starts up, usually no colors are loaded into the colormap. As clients are invoked,
certain of these cells are allocated. But when all of the free colorcells are used up, it is no
longer possible to request new colors. When this happens, you will usually be given the
closest possible color from those that have already been allocated. However, you may
instead be given an error message and told that there are no free colorcells.
In order to minimize the chance of running out of colorcells, many programs use "shared"
colorcells. Shared colorcells can be used by any number of applications, but they can't be
changed by any of them. They can only be deallocated by each application that uses them,
and when all applications have deallocated the cell, it is available for setting one again.
Shared cells are most often used for background, border, and cursor colors.
Alternately, some clients have to be able to change the color of graphics they have already
drawn. This requires another kind of cell, called private, which can't be shared. A typical
use of a private cell would be for the pallete of a color mixing application. Such a program
might have three bars of each primary color, and a box which shows the mixed color. The
primary bars would use shared cells, while the mixed color box would use a private cell.
In summary, some programs define colorcells to be read-only and shareable, while others
define colorcells to be read/write and private.
To top it off, there are even clients that may temporarily swap in a whole private colormap of
their own. Because of the way color is implemented, if this happens, all other applications
will be displayed in unexpected colors.
Command Line Options 175
In order to minimize such conflicts, you should request precise colors only when necessary.
By preference, use color names or hexadecimal specifications that you specified for other
applications.
Starting a Client Window as an leon
The -iconic command line option starts the client window in iconified form. To start an
xterm window as an icon, type:
% xezm-iconic &
This can be especially useful for starting the login xterm window. As described in Chapter 2,
Getting Started, terminating the login xterm window kills the X server and all other clients
that are running. It's always possible to terminate a window inadvertently, by selecting the
wrong menu option or typing the wrong key sequence. If your login xterm window is auto-
matically iconified at startup, you are far less likely to terminate the window inadvertently
and end your X session.
For most clients, the size and position of the icon can be set using resource variables in an
.Xdefaults or other resource file. (This is highly recommended if you are starting the login
xterm window as an icon.) See the appropriate client reference pages in Pan Three for a
complete list of available resources. Refer to Chapter 9, Setting Resources, for instructions
on how to set resources.
Specifying Fonts on the Command Line
Many clients allow you to specify the font to be used when displaying text in the window.
(These are known as screen fonts and are not to be confused with printer fonts.) For clients
written with the X Toolkit, the option to set the display font is -fn. For example, the com-
mand line:
% xtez'm-fn fon tname &
creates an xterm window in which text will be displayed with the font named fontname.
Chapter 5, Font Specification, describes the available screen fonts and font naming
conventions.
176 X Window System User's Guide
Reverse Video
There are three options to control whether or not the application will display in reverse
video--that is, with the foreground and background colors reversed. The -x:v or
- x:eve x:se option is used to request reverse video.
The +x:v option is used to override any reverse video request that might be specified in a
resource file (see Chapter 9, Setting Resources). This is important, because not all clients
handle reverse video correctly, and even those that do usually do so only on black and white
displays.
Command Line Options
177
9
Setting Resources
This chapter describes how to set resource variables that determine applica-
tion features such as color, geometry, fonts, and so on. It describes the syn-
tax of resource definition files such as .Xresources, as well as the operation
of xrdb, a client that can be used to change resource definitions dynamically,
and make resources available to clients running on other machines.
In This Chapter:
Resource Naming Syntax .................................................................... 182
Syntax of Toolkit Client Resources ................................................... 183
Tight Bindings and Loose Bindings .................................................. 184
Instances and Classes ..................................................................... 184
Precedence Rules for Resource Specification .................................. 185
Some Common Resources .............................................................. 187
Event Translations ............................................................................... 188
The Syntax of Event Translations ..................................................... 189
xterm Translations to Use xclipboard .............................................. 191
How to Set Resources ......................................................................... 192
A Sample Resources File ................................................................. 193
Specifying Resources from the Command Line ................................ 194
The -xrm Option ............................................................................ 194
The -name Option ......................................................................... 194
Setting Resources with xrdb ................................................................ 195
Querying the Resource Database .................................................... 196
Loading New Values into the Resource Database ............................ 196
Saving Active Resource Definitions in a File ..................................... 197
Removing Resource Definitions ....................................................... 197
Listing the Current Resources for a Client: appres .......................... 198
Other Sources of Resource Definition .............................................. 199
9
Setting Resources
Virtually all X clients are customizable. You can specify how a client looks on the screen--
its size and placement, its border and background color or pattern, whether or not the window
has a scrollbar, and so on. Some applications even allow you to redefine the keystrokes or
pointer actions used to control the application.
Traditional UNIX applications rely on command line options to allow users to customize the
way they work. As we've already discussed in Chapter 8, Command Line Options, X appli-
cations support command line options too, but often not for all of their features. Also, there
can be so many customizable features in an application that a command line to set them all
would be completely impractical. (Imagine the aggravation of misspelling an option in a
command that was three lines long.)
X offers an alternative to customizing an application on the command line. Almost every
feature of a program can be controlled by a variable called a resource; you can change the
behavior or appearance of a program by changing the value associated with a resource vari-
able. (All of the standard X Toolkit Command Line Options described in Chapter 8 have cor-
responding resource variable names. See Table 8-1 for more information.)
Resource variables may be Boolean (such as scrollBar: True) or take a numeric or
string value (borderWidth: 2 or foreground: blue). What's more, in applica-
tions written with the X Toolkit (or other object-oriented systems), resources may be associ-
ated with separate objects (or "widgets") within an application. There is a syntax that allows
for separate control over both a class of objects in the application and an individual instance
of an object. This is illustrated by the following resource specifications for a hypothetical
application called xclient:
xclient*Buttons, foreground : blue
xclient*help, foreground : red
The f'u'st resource specification makes the foreground color of all buttons in the xclient appli-
cation (in the class Buttons) blue; the second resource specification makes the foreground
color of the help button in this application (an instance of the class Buttons) red.
The values of resources can be set as application defaults using a number of different mecha-
nisms, including resource files in your home directory and a program called xrdb (X resource
database manager). As we'll see, the xrdb program stores resources directly in the server,
thus making them available to all clients, regardless of the machine the clients are running
on.
Setting Resources 181
Placing resources in files allows you to set many resources at once, without the restrictions
encountered when using command line options. In addition to a primary resource file (often
called .Xdefaults or .Xresources) in your home directory, which determines defaults for appli-
cations you run, you can create system-wide resource files to set application defaults. You
can also create resource files to set some resources only for the local machine, some for all
machines in a network, and some for one or more specific machines.
The various resource files are automatically read in and processed in a certain order within
an application by a set of routines called the resource manager. The syntax for resource
specifications and the rules of precedence by which the resource manager processes them are
intended to give you the maximum flexibility in setting resources, with the minimum amount
of text. You can specify a resource that controls only one feature of a single application,
such as the red hea_p button in the hypothetical xclient settings above. You can also specify
a resource that controls one feature of multiple objects within multiple applications with a
single line.
It is important to note that command line options normally take precedence over any prior
resource settings, so you can set up the files to control the way you normally want your appli-
cation to work, and then use command line options to specify changes you need for only one
or two instances of the application.
In this chapter, we'll first look at the syntax of resource specifications. Then we'll consider
some methods of setting resources, primarily some special command line options and the
xrdb program. Finally, we'll take a brief look at the section "Other Sources of Resource Def-
inition," additional files that can be created or edited to set application resources.
Resource Naming Syntax
The basic syntax of a resource definition file is fairly simple. Each client recognizes certain
resource variables that can be assigned a value. The variables for each client are documented
on its reference page in Part Three of this guide.
Most of the common clients are written to use the X Toolkit. As described in Chapter 7,
Other Clients, toolkits are a mechanism for simplifying the design and coding of applica-
tions, and making them operate in a consistent way. Toolkits provide a standard set of
objects, or "widgets," such as menus, command buttons, dialog boxes, scrollbars, and so on.
As we'll see, the naming syntax for certain resources parallels the object hierarchy that is
built into X Toolkit programs.*
The most basic line you can have in a resource definition file consists of the name of a client,
followed by a period or an asterisk and the name of a variable. A colon and whitespace sepa-
*If a client was built with the X Toolkit, this should be noted on the reference page. In addition to certain applica-
tion-specific resource variables, clients that use the X Toolkit have a common set of resource variables. These com-
mon variables may not be shown on each reference page, but all of the Toolkit variables are listed in Table 8-1, in
Chapter 8, Command Line Options and are described in slightly greater detail on the X reference page in Part Three
of this guide. A few of the more common variables also appear in Table 9-1 later in this chapter.
182 X Window System User's Guide
rate the client and variable names from the actual value of the resource variable. The follow-
ing line specifies that all instances of the xterm application have a scrollbar:
xterm*scrollBar : True
If the name of the client is omitted, the variable applies to all instances of all clients (in this
case, all clients that can have a scrollbar). If the same variable is specified as a global vari-
able and a client-specific variable, the value of the client-specific variable takes precedence
for that client. Note, however, that if the name of the client is omitted, the line should gener-
ally begin with an asterisk.
Be sure that you don't inadvertently omit the colon at the end of a resource specification.
This is an easy mistake to make and the resource manager provides no error messages. If
there is an error in a resource specification (including a syntax error like the omission of the
colon or a misspelling), the specification is ignored. The value you set will simply not take
effect. To include a comment in a resource file or comment out one of the resource specifica-
tions, begin the line in question with an exclamation point (!). If the last character on a line
is a backslash (k), the resource definition on that line is assumed to continue on the next line.
Syntax of Toolkit Client Resources
As mentioned above, X Toolkit applications are made up of predefined components called
widgets. There can be widgets within widgets (e.g., a command button within a dialog box).
The syntax of resource specifications for Toolkit clients parallels the levels of the widget
hierarchy. Accordingly, you should think of a resource specification as having the following
format:
object.subobject[.subobject. . .].attribute: value
is the client program, or a specific instance of the program. (See The
-name Option later in this chapter.)
subobjects correspond to levels of the widget hierarchy (usually the major structures
within an application, such as windows, menus, scrollbars, etc.).
a t t ri bu t e is a feature of the last s ubobj ec t (perhaps, a command buuon), such as
background color or a label that appears on it.
val ue is the actual setting of the resource attribute, i.e., the label text, color,
or other feature.
The type of val ue to supply should usually be evident from the name of the resource or
from the description of the resource variable on the reference page. Most of these values are
similar to those used with the command line options described in Chapter 8, Command Line
Opons.
For example, various resources, such as borderColor or background, take color spec-
ifications; geometry takes a geometry string, font takes a font name, and so on. Logical
values, such as the values taken by scrollBar, can be generally specified as on or off,
as yes or no, or as True or False.
where:
object
Setting Resources
183
Note that in a complex Toolkit application, these values can occur at every level in a widget
hierarchy. For example, our hypothetical xclient application might support the following
complete instance names:
xclient, background
xcl ient. butt onBox, background
xcl ient. buttonBox, commandButton, background
xcl ient. buttonBox, quit. background
These resources would specify the background color for the application window, the button
box area, any command buttons, and the quit command button, respectively.
Of course, the specification:
xclient*background
would match any and all of them. See Table 8-1 for a comprehensive list of the common X
Toolkit resources.
Event Translations
We've discussed the basics of resource naming syntax. From the sample resource settings, it
appears that what many resource variables do is self-evident, or nearly so. Among the less
obvious resource variables, there is one type of specification, an event translation, that can be
used with many clients and warrants somewhat closer examination.
User input and several other types of information pass from the server to a client in the form
of events. An event is a packet of information that tells the client something it needs to act
on, such as keyboard input. As mentioned in Chapter 4, The xterm Terminal Emulator, mov-
ing the pointer or pressing a key, etc., causes input events to occur. When a program receives
a meaningful event, it responds with some sort of action.
For many clients, the resource manager recognizes mappings between certain input events
(like a pointer button click) and some sort of action by the client program (like selecting
text). A mapping between one or more events and an action is called a translation. A
resource containing a list of translations is called a translation table.
Many event translations are programmed into an application and are invisible to the user.*
For our purposes, we are only concerned with very visible translations of certain input
events, primarily the translation of keystrokes and pointer button clicks to particular actions
by a client program.
*For more information on events and translations, see Volume Four, X Toolkit Programming Manual
188 X Window System Users Guide
The Syntax of Event Translations
The operation of many clients, notably xterm, is partly determined by default input event
translations. For example, as explained in Chapter 4, The xterm Terminal Emulator, selecting
text with the first pointer button (an event) saves that text into memory (an action).
In this case, the input "event" is actually three separate X events:
1. Pushing the first pointer button down.
2. Moving the pointer while holding the first button down.
3. Releasing the button.
Each of these input events performs part of the action of selecting text:
1. Unselects any previously selected text and begins selecting new text.
2. Extends the selection.
3. Ends the selection, saving the text into memory (both as the PRIMARY selection and
CUT_BUFFER0).
The event and action mappings would be expressed in a translation table as follows:
<BtnlDown>: select-start()\n\
<BtnlMotion>: select-extend()\n\
<BtnlUp>: select-end(PRIMARY, CUT_BUFFER0)
where each event is enclosed in angle brackets (< >) and produces the action that follows the
colon. A space or tab generally precedes the action, though this is not mandatory:
<event>: action
A translation table must be a continuous string. In order to link multiple mappings as a con-
tinuous string, each event-action line should be terminated by a newline character (M), which
is in turn followed by a backslash (x,) to escape the actual newline.
These are default translations for xterm.* All of the events are simple, comprised of a single
button motion. As we'll see, events can also have modifiers, i.e., additional button motions
or keystrokes (often Control or Meta) that must be performed with the primary event to pro-
duce the action. (Events can also have modifiers that must not accompany the primary event
if the action is to take place.)
As you can see, the default actions listed in the table are hardly intuitive. The event-action
mappings that can be modified using translation resources are usually described on the refer-
ence page for the particular client.
*They are actually slightly simplified versions of default translations. Before you can understand the actual transla-
tions listed on the xterm reference page in Part Three of this guide, you must leam more about the syntax of transla-
tions. In addition to the current chapter, read Appendix H, Translation Table Syntax.
Setting Resources 189
xterm Translations to Use xclipboard
As stated in Chapter 4, The xterm Terminal Emulator, you can specify xterm translations to
have copied text made the CLIPBOARD selection. The CLIPBOARD selection is the property
of the xclipboard client. If you are running xclipboard and you copy text to be made the
CLIPBOARD selection, this text automatically appears in the xclipboard window. The xclip-
board window allows you to store text that can then be copied to other windows.
Some sample translations that would allow you to use the xclipboard in this way follow:
*VTI00 .Translations: #override\
Buttonl <Btn3Down>: select-end (CLIPBOARD)\n\
-Ctrl -Meta <Btn2Up>: insert-selection (PRIMARY, CLIPBOARD)
According to this table, while selecting text with Buttonl (the modifier), the event of
pressing the third pointer button (Btn3Down) (while continuing to hold down the first but-
ton), produces the action of making the text the CLIPBOARD selection. (Notice that we've
taken the select-end action and combined it with the argument CLIPBOARD. The default
translation uses the arguments PRIMARY,CUT_BUFFER0.)
The second line modifies the way selected text is pasted into a window so that the CLIP-
BOARD selection can be pasted. As described in Chapter 4, The xterm Terminal Emulator,
pressing the second pointer button pasted the contents of the PRIMARY selection, by default.
If there is no PRIMARY selection, the contents of the cut buffer are pasted. The default trans-
lation that sets this behavior is as follows:
-Ctrl -Meta <Btn2Up>: insert-selection (PRIMARY, CUT BUFFER0)
--
This translation specifies that releasing pointer button 2, while pressing any modifier button
or key other than Control or Meta, inserts text from the PRIMARY selection, or if the selec-
tion is empty, from cut buffer 0. In the second line of our translation table, we've replaced
CUT_BUFFER0 with the CLIPBOARD selection. The new behavior is that releasing the second
pointer button pastes the PRIMARY selection, or if there is none, the CLIPBOARD selection.
Thus, according to the translations in the example, if you select text as usual with the first
pointer button, and then additionally push the third button down (while continuing to hold
the first button), the text becomes the CLIPBOARD selection and appears automatically in the
xclipboard window, as in Figure 9-1.
Since our first translation specifies a different event/action mapping than the default transla-
tion for selecting text (discussed in the previous section), the default translation still applies.
If you select text with the first pointer button alone, that text is still made the PRIMARY selec-
tion and fills CUT_BUFFER0. To send text to the xclipboard, you would need to use the third
pointer button as well. Thus, not all selected text need be made the CLIPBOARD selection
(and sent automatically to the xclipboard).
There are advantages to making only certain selections CLIPBOARD selections. You can
keep xclipboard running and make many text selections by the default method (first pointer
button), without filling up the xclipboard window. And chances are you don't want to save
every piece of text you copy for an extended period of time, anyway.
i-
Setting Resources 191
text
Figure 9-1. Selected text appears automatically in the xclipboard window
The CLIPBOARD selection and the xclipboard client also get around the potential problems
of selection ownership discussed in Chapter 4. Once text becomes the CLIPBOARD selection,
it is owned by the xclipboard client. Thus, if the client from which text was copied (the orig-
inal owner) goes away, the selection is still available, owned by the xclipboard, and can be
transferred to another window (and translated to another format if necessary).
The operation of many clients can be modified by specifying event translations as resources.
See the relevant client reference pages in Part Three of this guide.
For information about events, actions, and translation table syntax, see Appendix H, Transla-
tion Table Syntax, in this guide, and Volume Four, X Toolkit Programming Manual.
How to Set Resources
Learning to write resource specifications is a fairly manageable task, once you understand the
basic rules of syntax and precedence. In contrast, the multiple ways you can set
resources--for a single system, for multiple systems, for a single user, for all users--can be
confusing. For our purposes, we are primarily concerned with specifying resources for a
single user running applications both on the local system and on remote systems in a net-
work.
As we've said, resources are generally specified in files. A resource file can have any name
you like. Resources are generally "loaded" into the X server by the xrdb client, which is nor-
mally run from your startup file or run automatically by xdm when you log in. (See Appendix
A, System Management, for information about startup files and xdm.) Prior to Release 2 of X,
there was only one resource file called .Xdefaults, placed in the user's home directory. If no
resource file is loaded into the server by xrdb, the .Xdefaults file will still be read.
Remember that X allows clients to run on different machines across a network, not just on
the machine that supports the X server. The problem with the older .Xdefaults mechanism
was that users who were running clients on multiple machines had to maintain multiple
192 X Window System User's Guide
.Xdefaults files, one on each machine. By contrast, xrdb stores the application resources
directly in the server, thus making them available to all clients, regardless of the machine the
clients are running on. As we'll see, xrdb also allows you to change resources without edit-
ing files.
Of course, you may want certain resources to be set on all machines and others to be set only
on particular machines. See the section "Other Sources of Resource Definition" later in this
chapter for information on setting machine-specific resources. This section gives an over-
view of additional ways to specify resources, using a variety of system files.
In addition to loading resource files, you can specify defaults for a particular instance of an
application from the command line using two options: -xrm and -name.
First we'll consider a sample resources file. Then we'll take a look at the use of the -xrm
and -name command line options. Finally, we'll discuss various ways you can load
resources using the xrdb program and consider "Other Sources of Resource Definition."
A Sample Resources File
Figure 9-2 shows a sample resources file. This file sets the border width for all clients to a
default value of 2 pixels, and sets other specific variables for xclock and xterm. The meaning
of each variable is fairly obvious from its name (for example, xterm*scrollBar:
T rue means that xterm windows should be created with a scrollbar.
Note that comments are preceded by an exclamation point (!).
detailed description of each possible variable, see the appropriate client reference
For a
pages
in Part Three of this guide.
*borderWidth: 2
! xclock resources
xclock*borderWidth: 5
xclock*geometry: 64x64
o
! xterm resources
xterm*curses: on
xterm*cursorColor: skyblue
xterm*pointerShape: pirate
xterm*jumpScroll: on
xterm*saveLines: 300
xterm*scrollBar: True
xterm*scrollKey: on
xterm*background: black
xterm*borderColor: blue
xterm*borderWidth: 3
xterm*foreground: white
xterm*font: 8x13
Figure 9-2. A sample resources file
i-
Setting Resources
193
Specifying Resources from the Command Line
Two command line options that are supported by all clients written with the X Toolkit can be
useful in specifying resources.
The-xrm Option
The -xrm option allows you to set on the command line any specification that you would
otherwise put into a resources file. For example:
% xterm-xrm 'xterm*Foreground: lue' &
Note that a resource specification on the command line must be quoted using the single
quotes in the line above.
The -xrm option only specifies the resource(s) for the current instance of the application.
Resources specified in this way do not become pan of the resource database.
The -xrm option is most useful for setting classes, since most clients have command line
options that correspond to instance variable names. For example, the -fg command line
option sets the foreground attribute of a window, but -xrm must be used to set Fore-
ground.
Note also that a resource specified with the -xrm option will not take effect if a resource that
takes precedence has already been loaded with xrdb. For example, say you've loaded a
resource file that includes the specification:
xterm*pointerShape : pirate
The following command line specification of another cursor will fail:
% xterm-xrm '*pointerShape: gumby' &
because the resource xterm*pointerShape is more specific than the resource
*pointerShape. Instead, you'll get an xterm with the previously specified pirate cursor.
To override the resource database (and get the Gumby cursor), you'd need to use a resource
as or more specific, such as the following:
% xterm -xrm ' xterm*pointerShape: gumby' &
The -name Option
The -name option, which lets you name one instance of a client using an arbitrary alias, can
also be used to set resources. If a client supports the -name option, you can create instance
resources using the arbitrary alias as the object. You can then run the client using the alias
as the -name argument. The client automatically uses the resources that begin with that
alias.
For example, you could put the following entries into a resource file such as 2(resources:
XTerm*Font : 8x13
smallxterm*Font : 6x10
194 X Window System User's Guide
You should load a resource file with the xrdb -load option. For example, to load the con-
tents of your 2resources file into the RESOURCE_MANAGER, you would type:
% xrdb -load . Xresources
Querying the Resource Database
You can find out whm options are currently set by using the -query option. For example:
% xrdb -query
XTerm*ScrollBar: True
bigxterm*font: 9x15
bigxterm*Geometry: 80x55
smallxterm*Font: 6x10
smallxterm*Geometry: 80x10
xterm*borderWidth: 3
If xrdb has not been run, this command will produce no ouut.
Loading New Values into the Resource Database
By default, xrdb reads its input (either a file or standard input) and stores the results into the
resource database, replacing the previous values. If you simply want to merge new values
with the currently active ones (perhaps by specifying a single value from standard input), you
can use the -merge option. Only the new values will be changed; variables that were
already set will be preserved rather than overwritten with empty values.
For example, let's say you wanted to add new resources listed in the file new.values. You
could say:
% xrdb -merge new. values
As another example, if you wanted all subsequently run xterm windows to have scrollbars,
you could use standard input, and enter:
xterm* scrollBar: True
and then press Control-D to end the standard input. Note that because of precedence rules
for resource naming, you may not automatically get what you want. For example, if you
specify:
xterm*scrollBar : True
and the more specific value:
xterm*vtl00.scrollBar: False
has already been set, your new, less specific setting will be ignored. The problem isn't that
you used the -merge option incorrectly--you just got caught by the rules of precedence.
196 X Window System User's Guide
If your specifications don't seem to work, use the -query option to list the values in the
RESOURCE_MANAGER property, and look for conflicting specifications.
Note also that when you add new specifications, they won't affect any programs already run-
ning, but only programs started after the new resource specifications are in effect. (This is
also true even if you overwrite the existing specifications by loading a new resource file.
Only programs run after this point will reflect the new specifications.)
Saving Active Resource Definitions in a File
Assume that you've loaded the RESOURCE_MANAGER property from an .Xresources or
other file. However, you've dynamically loaded a different value using the -me rge option,
and you'd like to make the new value your default.
You don't need to edit the file manually (although you certainly could.) The -edit option
allows you to write out the current value of the RESOURCE_MANAGER property into a file.
If the file already exists, it is overwriuen with the new values. However, xrdb is smart
enough to preserve any comments and preprocessor declarations in the file being overwritten,
replacing only the resource definitions.
For example:
% xrdb -edit -/. Xre=ource=
will save the current contents of the RESOURCE_MANAGER property in the file .Xresources
in your home directory.
If you want to save a backup copy of an existing file, use the -backup option as follows:
% xrdb -edit . mydefault= -backup old
The string following the -backup option is used as an extension to be appended to the old
filename. In the example shown above, the previous copy of .mydefaults would be saved as
.mydefaults.old.
Removing Resource Definitions
You can delete the definition of the RESOURCE_MANAGER property from the server by cal-
ling xrdb with the -remove option.
There is no way to delete a single resource definition, other than to read the current xrdb val-
ues to a file. For example:
% xrdb -query > filename
Use an editor to edit and save the file, deleting the resource definitions you no longer want:
% vi filename
Then read the edited values back into the RESOURCE_MANAGER with xrdb:
% xrdb -load filename
Setting Resources
197
Listing the Current Resources for a Client: appres
The appres (application resource) program, available as of Release 4, lists the resources that
currently might apply to a client. These resources may be derived from several sources,
including the user's .Xresources file and a system-wide application defaults file. The direc-
tory lusrlliblXlllapp-defaults contains application default files for several clients. The func-
tion of these files is discussed in the next section. For now, be aware that all of the resources
contained in these files begin with the class name of the application.
Also be aware that appres has one serious limitation: it cannot distinguish between valid and
invalid resource specifications. It lists all resources that might apply to a client, whether the
resources are correctly specified or not.
appres lists the resources that apply to a client having the class_name and/or
inse,nce_n,rne you specify. Typically, you would use appres before running a client
program to find out what resources the client program will access.
For example, say you want to run xterm, but you can't remember the latest resources you've
specified for it, whether you've loaded them, or perhaps what some of the application
defaults are, etc. You can use the appres client to check the current xterm resources. If you
specify only a class name, as in the following command line:
appres lists the resources that any xterm would load. In the case of xterm, this is an extensive
list, encompassing all of the system-wide application defaults, as well as any other defaults
you have specified in a resource file.
You can additionally specify an instance name to list the resources applying to a particular
instance of the client, as in the following:
% appres XTerm bigxterm
If you omit the class name, xappres assumes the class -NoSuchClass-, which has no
defaults, and returns only the resources that would be loaded by the particular instance of the
client.
Note that the instance can simply be the client name, for example, xterm. In that case, none
of the system-wide application defaults would be listed, since all begin with the class name
XTe rm. For example, the command:
% appres xterm
might return resources settings similar to the following:
xterm.vtl00.scrollBar:
xterm*PhonyResource:
xterm*pointerShape:
xterm*iconGeometry:
*VTl00.Translations:
Buttonl <Btn3Down>:
True
youbet
gumby
+50+50
#override\
select-end(CLIPBOARD)\n\
-Ctrl -Meta <Btn2Up>: insert-selection (PRIMARY, CLIPBOARD)
Most of these resources set obvious features of xterm. The translation table sets up xterm to
use the xclipboard. Notice also that appres has returned an invalid resource called
198 X Window System User's Guide
10
Customizing the
twm Window Manager
This chapter describes the syntax of the .twmrc startup file that can be used
to customize the operation of the twm window manager. It describes how to
bind functions to keys, and how to define your own twm menus. An alterna-
tive .twmrc file is included.
In This Chapter:
Setting .twmrc Variables ...................................................................... 205
Button/Key Bindings ............................................................................ 206
Pointer Buttons ................................................................................ 206
Keys ................................................................................................ 207
Context ............................................................................................ 207
Function Names .............................................................................. 208
Action .............................................................................................. 208
Defining Menus .................................................................................... 209
Submenus ....................................................................................... 210
Executing System Commands from a Menu .................................... 211
Color Menus .................................................................................... 212
A Complete Revamp of twm ................................................................ 213
Example 10-1. The system.twmrc file from the MIT distribution (continued)
#
# Sites should tailor this file. providing any extra title buttons.
# menus, etc.. that may be appropriate for their environment. For
# example, if most of the users were accustomed to uwm. the defaults
# could be set up not to decorate any windows and to use meta-keys.
#
NoGrabServer
DecorateTransients
TitleFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
ResizeFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
MenuFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
IconFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*"
IconManagerFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*"
#ClientBorderWidth
Color
BogderColor "slategrey"
DefaultBackground "maroon"
DefaultForeground "gray85"
TitleBackground "maroon"
TitleForeground "gray85"
MenuBackground "maroon"
MenuForeground "gray85"
MenuTitleBackground "grayT0"
MenuTitleForeground "maroon"
IconBackground "maroon"
IconForeground "gray85"
IconBorderColor "gray85"
IconManagerBackground "maroon"
IconManagerForeground "gray85"
}
#
# Define some useful functions for motion-based actions.
#
MoveDelta 3
Function "move-or-lower" { f.move f.deltastop f.lower }
Function "move-or-raise" { f.move f.deltastop f.raise }
Function "move-or-iconify" { f.move f.deltastop f.iconify }
#
# Set some useful bindings. Sort of uwm-ish, sort of simple-button-ish
#
Buttonl = : root : f.menu "defops"
Buttonl = m : window,icon : f.function "move-or-lower"
Button2 = m : window,icon : f.iconify
Button3 = m : window,icon : f.function
Buttonl = : title : f.function
Button2 = : title : f.raiselower
Buttonl = : icon : f.function
Button2 = - icon : f.iconify
Buttonl = : iconmgr : f.iconify
Button2 = : iconmgr : f.iconify
"move-or-raise"
"move-or-raise"
"move-or-iconify"
204 X Window System User's Guide
An example of a numeric variable is:
IconBorderWidth 5
which sets the width of an icon's window border in pixels.
In the following example, TitleHighlight is a keyword:
Pixmaps
Tit leHighlight "grayl"
)
An example of a list variable is:
NoTitle { "oclock .... xclock .... xscreensaver .... zwgc" }
The available variables are described in detail on the twin reference page in Part Three of this
guide, so we won't go into detail on each of them here.
Button/Key Bindings
The second section of the .twmrc file specifies which combination of keys, pointer buttons,
and title buttons (and in which context) will be used to invoke each predefined twm function.
Let's see how this works, by looking at the first few lines of the function binding section of
sysm.twmrc.
# BUTTON/KEY =
Buttonl =
KEYS : CONTEXT : FUNCTION ACTION
: root : f.menu "defops"
Buttonl = m : window [ icon : f. function "move-or-lower"
Button2 = m : windowlicon : f.iconify
The first line we've shown is just a comment line, which is not present in the original file. It
labels each of the fields in the line below. The first field is separated from the others by an
equals sign; subsequent fields are separated by colons. In system.twmrc, fields are separated
by tabs for clarity, making the colons (falsely) appear to be delimiters only for the context
field; they could instead follow each other without intervening whitespace.
Let's talk about each of the fields in turn.
Pointer Buttons
The first field defines which keys or pointer buttons are used to invoke the function.
twin can handle a pointer with up to five buttons, which would be named Buttonl, Button2,
Button3, Button4, and Button5. To bind a key to a twin function, just use that key's
keysym--the name that represents the label on a key. For example, the keysym for the F1
key on a DECstation 3100 is "FI". For more information about keysyms, see Chapter 11,
Setup Clients.
206 X Window System User's Guide
Keys
The second field lists modifier keys, if any, which must be held down while invoking the
specified function, twin recognizes the Shift, Control and Meta keys. (See Chapter 11, Setup
Clients, for more discussion.) These names must be entered in the .twrnrc file in lower case,
and can be abbreviated s, c, and m.
If two keys must be held down at once, the names should be separated by a vertical bar ( [ ).
For example, c I a would mean that the Control and Shift keys should be pressed simulta-
neously. It is not permissible to bind a function to three keys at once. If the field is left
blank, no key needs to be pressed while invoking the function.
Control and Shift should be familiar to most users. But what is a "Meta" key? There isn't a
key by that name on many keyboards---instead, Meta is a user-definable Control key that can
be mapped to an actual key on the physical keyboard using the xmodrnap client as described
in Chapter 11. Most implementations of X will include a mapped Meta key. Type xmodrnap
without any arguments to display the map. The systern.twrnrc specifies the Meta key in many
keyboard bindings. On workstations without a special key corresponding to Meta, you will
have to use xmodraap to find out or change the definition of Meta to something reasonable.
M6ta could be mapped to the Control key, although this could potentially lead to conflicts
with applications that want to use the Control key. In particular, certain functions of xedit
will operate strangely or not at all if Meta is mapped to Control.
If you want to map the Meta key, it is best to choose a keyboard key that's within easy reach
and is not used frequently for other applications (perhaps an Alt or Funct key). Left- or right-
handedness could also be a factor in choosing a Meta key.
Some X developers warn against binding functions to the Shift key alone, since they say cer-
tain applications use it as a Control key. If you use it in twin, it will perform both functions
simultaneously, which is likely to be confusing. For the same reason, you should not bind
functions to buttons without modifier keys in the context of a window, as an application may
want to use the pointer buttons for its own purposes.
Context
The third field defines the context--the location the pointer must be in before the function
can be invoked. This field may be blank, or may contain one or more of: window, rifle, icon,
root, frame, iconmgr, their first letters (icon is i, iconmgr is m), or all. Multiple context speci-
fications should be separated by vertical bars.
If root is specified, it means that the pointer must be in the root (background) window, and
not in any other window or icon. If the context is window, icon, title, frame, or iconmgr, the
pointer must be in the specified place(s) for the function to be invoked.
The context field makes perfect sense if you consider the sample function binding:
Button2 = m : windowlicon : f.iconify
f. iconify turns a window into an icon, or an icon into a window. The pointer must be in
a window or an icon for the function to be used.
Customizing the twm Window Manager 207
running in that window. In order to avoid conflict with other applications, twin uses the more
complex key/button combination. But when the pointer is in an icon or in the root window,
there is no possibility of conflict, and it can take a more forgiving approach.
Defining Menus
The third section of a .twmrc file contains menu definitions. These definitions have the
format:
menu "menu name" {
--
"item name" action
--
The menu name must exactly match a name specified with the f. menu function.
Each item on the menu is given a label (item_.name), which will appear on the menu. This
is followed by the action to be performed. The action may be one of twin's functions, or if
prefixed by a ! character, it can be a system command to be executed, as if in an xterm win-
dow. The Utilities menu shown in Example 10-2 demonstrates both types of action.
Example 10-2. The Utilities menu
menu = "Utilities"
"Identify"
"Source .twmrc"
..
"Check Mail"
"Clock"
"New Window"
"Phase of Moon"
..
"news"
"mintaka"
{
f.identify
f.twmrc
f.beep
!"/usr/bin/Xll/xbiff -display $DISPLAY&"
!"/usr/bin/Xll/oclock -display $DISPLAY &"
!"/usr/bin/Xll/xterm -is -display $DISPLAY &"
!"/usr/bin/Xll/xphoon &"
f.beep
!"/usr/bin/Xll/xhost news.mit.edu;
/usr/bin/Xll/xterm -title news.mit.edu
-e rlogin news.mit.edu &"
!"/usr/bin/Xll/xhost mintaka.lcs.mit.edu;
/usr/bin/Xll/xterm -title mintaka.lcs.mit.edu
-e rlogin mintaka.lcs.mit.edu &"
New Window is accomplished by running another instance of xterm. CheckMail, Clock,
PhaseofMoon, news, and mintaka are also implemented by running a system function. The
other functions are accomplished simply by invoking one of twin's predefined functions.
The Preferences menu shown in Example 10-3 simply invokes xset with a number of differ-
ent options:
Customizing the twm Window Manager 209
Example 10-3. The Preferences menu
menu "Preferences" {
"Bell Loud" !"xset b 80&"
"Bell Normal" !"xset b on&"
"Bell Off" !"xset b off&"
"Click Loud" !"xset c 80&"
"Click Soft" !"xset c on&"
"Click Off" !"xset c off&"
"Lock On" !"xset led on&"
"Lock Off" !"xset led off&"
"Mouse Fast" !"xset m 4 2&"
"Mouse Normal" !"xset m 2 5&"
"Mouse Slow" !"xset m 1 l&"
}
Submenus
While the menu defined by the system.twmrc file is a drastic improvement over the cluttered
menus provided by uwm in previous releases of X11, it is still far from complete. We'd like
to modify it to add a couple of menus which contain commands that, while still worth putting
in a menu, aren't used as frequently as the commands in the Twm menu.
For the moment, let's assume that we want to leave the variable definitions and function key
bindings alone, but want to add two submenus to the Twm menu. For example, we might
copy system.twmrc to a local .twmrc file, and modify the menus section to be like the one
shown in Example 10-4.
Example 10-4. Window operations divided into three menus
menu "defops"
{
"Twm" f.title
"Iconify" f.iconify
"Resize" f.resize
"Move" f.move
"Raise" f.raise
"Lower" f.lower
"" f.nop
"..Utilities" f.menu "Utilities"
"..Preferences" f.menu "Preferences"
"" f.nop
"Focus" f.focus
"Unfocus" f.unfocus
"Show Iconmgr" f.showiconmgr
"Hide Iconmgr" f.hideiconmgr
"" f.nop
"Kill" f.destroy
"Delete" f.delete
"" f.nop
"Restart" f.restart
"Exit" f.quit
}
menu "Utilities" {
210 X Window System User's Guide
Example 10-5. A Useful Commands menu (continued)
Digital clock !"xclock -digital -geometry 162x37-10+174&"
Edit File !"xterm -e vi"
Calculator '"xcalc -geometry 126x230-180+10&"
Mailbox !"xbiff -geometry 65x65-353+10&"
Display keyboard mappings ! "xmodmap&"
}
As you can quickly see, you can run any window-based programs directly, but you need to
run other programs using xterm's -e option (discussed in Chapter 4, The xterm Terminal
Emulator). You are limited only by your imagination in what commands you might want to
put on a menu. Each command runs in its own window, but that isn't necessarily the case, as
we'll see in a moment.
Color Menus
So far, we've assumed that all menus are black and white. But you can also create color
menus. You can even assign different colors to the menu title, the highlighting bar (the hori-
zontal band that follows the pointer within the menu and shows which item is selected) and
the individual selections on the menu.
Colors are added to menus when they're defined, using optional arguments. In Example
10-6, we show a "colorized" version of the Preferences menu that we defined earlier.
Examp l O-& A menu with cobr definions
menu "Preferences" ("WhiteSmoke" : "HotPink" ) {
"Preferences" ("DarkSlateGray" : "thistle") f.title
"Bell Loud" ("DarkSlateGray" : "bisquel") !"xset b 80&"
"Bell Normal" ("DarkSlateGray" : "bisquel") !"xset b on&"
"Bell Off" ("DarkSlateGray" : "bisquel") !"xset b off&"
"Click Loud" ("DarkSlateGray" : "azurel") !"xset c 80&"
"Click Soft" ("DarkSlateGray" : "azurel") !"xset c on&"
"Click Off" ("DarkSlateGray" : "azurel") !"xset c off&"
"Lock On" !"xset led on&"
"Lock Off" !"xset led off&"
"Mouse Fast" ("DarkSlateGray" : "goldl") !"xset m 4 2&"
"Mouse Normal" ("DarkSlateGray" : "goldl") !"xset m 2 5&"
"Mouse Slow" ("DarkSlateGray" : "goldl") !"xset m i l&"
}
In this example, WhiteSmoke and HotPink are the foreground and background (respectively)
of a highlighted menu item. The colors defined for each menu item are the foreground and
background colors (in that order) for that item when it is not highlighted. The default fore-
ground and background colors for menu items are controlled by the variables Menu-
Foreground and MenuBackground.
twin has eighteen variables controlling different aspects of its color:
B o rde rC o 1 o r The default color of a window's border.
212 X Window System User's Guide
BorderTileBackground
BorderTileForeground
DefaultBackground
DefaultForeground
IconBackground
IconForeground
IconBorderColor
IconManagerBackground
IconManagerForeground
IconManagerHighlight
MenuBackground
MenuForeground
MenuShadowColor
MenuTitleBackground
MenuTitleForeground
TitleBackground
TitleForeground
The default background color of the gray pattern used in an
unhighlighted window border.
The default foreground color of the gray pattern used in an
unhighlighted window border.
The background color to be used for sizing and information
windows.
The foreground color to be used for sizing and information
windows.
The background color of icons.
The foreground color of icons.
The default color of an icon's border.
The background color to use for icon manager entries.
The foreground color to use for icon manager entries.
The border color used when highlighting the icon manager
entry which has the focus.
The background color used for menus.
The foreground color used for menus.
The color used for the shadow behind pull-down menus.
The background color of the highlighting bar.
The background color of the highlighting bar.
The background color of the highlighting bar.
The background color of the highlighting bar.
These variables are most commonly used as arguments to the Color and Monochrome
variables, as seen in Example ]0-].
Colors can be specified either with color names or hex strings, as described in Chapter 8,
Command Line Options.
A Complete Revamp of twm
Using the various techniques described in this chapter, we've modified the system.twmrc file
to create an interface we think is more helpful to the average user.
Our modified .twmrc file sets up three pull-right menus, each with a slightly different focus.
The second menu offers some utilities, including oclock and xcalc, and some system com-
mands, such as rlogin. The final menu is a Proforoncos menu, which sets different keyclick
volumes, leds, and pointer speeds than the default.
You can test our .twmrc, shown in Example 10-7, or just use it as a touchstone to create your
own.
Customizing the twm Window Manager 213
Examp I O-Z Modified .twmrc file
# O'Rellly custom .twmrc, modified from the XIIR4 system.twmrc
oGrabServer
NutoRelativeResize
DecorateTransients
UsePPosition "on"
RestartPreviousState
SortlconManager
ShowlconManager
IconifyByUnmapping
NoTitle
"oclock"
"xclock"
"xscreensaver"
"zwgc"
)
TitleFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*-
ResizeFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*-
MenuFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*-
IconFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*-
IconManagerFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*"
Color
BorderColor "slategrey"
DefaultBackground "maroon"
DefaultForeground "gray85"
TitleBackground "maroon"
TitleForeground "gray85"
MenuBackground "maroon"
MenuForeground "gray85"
MenuTitleBackground "gray70"
MenuTitleForeground "maroon"
IconBackground "maroon"
IconForeground "gray85"
IconBorderColor "gray85"
IconManagerBackground "maroon"
IconManagerForeground "gray85"
)
#
# Define some useful functions for motion-based actions.
#
MoveDelta 3
Function "move-or-lower" { f.move f.deltastop f.lower }
Function "move-or-raise" { f.move f.deltastop f.raise }
Function "move-or-iconify" { f.move f.deltastop f.iconify }
# Set some useful bindings. Sort of uwm-ish, sort of simple-button-ish
Buttonl = : root : f.menu "defops"
Button2 = : root : f.menu "Preferences"
Button3 = : root : f.menu "Utilities"
Buttonl = m : window,icon : f.function "move-or-lower"
214 X Window System Users Guide
Examp
Button2
Button3
Buttonl
Button2
I O-Z Modified .twmm file (continued)
= m : windowlicon : f.iconify
= m : window,icon : f.function
= : title : f.function
= : title : f.raiselower
Buttonl = : icon : f.function
Button2 = : icon : f.iconify
Buttonl = : iconmgr : f.iconify
Button2 = : iconmgr : f.iconify
#
# And a menu with the usual things
menu "defops"
{
"Twm" f. title
"Iconify" f. iconify
"Resize" f. resize
"Move" f. move
"Raise" f. raise
"Lower" f. lower
"" f. nop
"..Utilities" f.menu "Utilities"
.
. .Preferences" f. menu "Preferences"
"" f.nop
"Focus" f. focus
"Unfocus" f.unfocus
"Show Iconmgr" f. showiconmgr
"Hide Iconmgr" f. hideiconmgr
"" f. nop
"Kill" f.destroy
"Delete" f. delete
"Restart" f. restart
"Exit" f. quit
)
menu "Utilities" {
"Utilities"
,,.
"identify"
"source .twmrc"
..
"mail box"
"clock"
"xterm"
"xphoon"
..
"news"
"mintaka"
"move-or-raise"
"move-or-raise"
"move-or-iconify-
f.title
f.beep
f.identify
f.twmrc
f.beep
!"/usr/bin/Xll/xbiff -display $DISPLAY&"
!"/usr/bin/Xll/oclock -display $DISPLAY &"
!"/usr/bin/Xll/xterm -is -display $DISPLAY &"
!"/usr/bin/Xll/xphoon &"
f.beep
!"/usr/bin/Xll/xhost news.mit.edu;
/usr/bin/Xll/xterm -title news.mit.edu
-e rlogin news.mit.edu &"
!"/usr/bin/Xll/xhost mintaka.lcs.mit.edu;
/usr/bin/Xll/xterm -title mintaka.lcs.mit.edu
-e rlogin mintaka.lcs.mit.edu &"
Customizing the twm Window Manager 215
Example 10-7. Modified .twmrc file (continued)
menu "Preferences" {
"Preferences"
"Bell Loud"
"Bell Normal"
"Bell Off"
"Click Loud"
"Click Soft"
"Click Off"
"Lock On"
"Lock Off"
"Mouse Fast"
"Mouse Normal"
"Mouse Slow"
)
("DarkSlateGray" : "thistle") f.title
("HotPink" : "bisquel")
("HotPink" : "bisquel")
("HotPink" : "bisquel")
("HotPink" : "azurel")
("HotPink" : "azurel")
("HotPink" : "azurel")
!"xset led on&"
!"xset led off&"
("HotPink" : "goldl")
("HotPink" : "goldl")
("HotPink" : "goldl")
!"xset b 80&"
!"xset b on&"
!"xset b off&"
!"xset c 80&"
!"xset c on&"
!"xset c off&"
!"xset m 4 2&"
!"xset m 2 5&"
!"xset m 1 l&"
216 X Window System User's Guide
11
Setup Clients
This chapter describes three useful setup clients that can be used to custom-
ize the appearance of your display, and the operation of your keyboard and
pointer.
In This Chapter:
xset: Setting Display and Keyboard Preferences ................................. 219
Keyboard Bell ................................................................................ 219
Bug Compatibility Mode ................................................................. 220
Keyclick Volume ............................................................................ 220
Enabling or Disabling Auto-repeat .................................................. 221
Changing or Rehashing the Font Path ........................................... 221
Keyboard LEDs ............................................................................. 221
Pointer Acceleration ....................................................................... 222
Screen Saver ................................................................................. 222
Color Definition .............................................................................. 223
Help with xset Options ................................................................... 223
xsetroot: Setting Root Window Characteristics .................................... 224
Setting Root Window Patterns ......................................................... 224
Foreground, Background Color and Reverse Video .......................... 225
Changing the Root Window Pointer .................................................. 226
xmodmap: Modifier Key and Pointer Customization ............................ 227
Keycodes and Keysyms ................................................................... 229
Procedure to Map Modifier Keys ...................................................... 230
Displaying the Current Modifier Key Map ......................................... 230
Determining the Default Key Mappings ............................................ 231
Matching Keysyms with Physical Keys Using xev ............................ 232
Changing the Map with xmodmap .................................................... 233
Expressions to Change the Key Map ............................................. 234
Key Mapping Examples ................................................................. 235
Displaying and Changing the Pointer Map ........................................ 236
11
Setup Clients
This chapter discusses how to set up certain features of your working environment, using the
following clients:
xset To set certain characteristics of the keyboard, pointer and display.
xsetroot To set root window characteristics.
xmodmap To change pointer and modifier key mappings.
xset: Setting Display and Keyboard Preferences
The xset client allows you to set an assortment of user preference options for the display and
keyboard. Some of these are followed by on or off to set or unset the option. Note that xset
is inconsistent in its use of a dash (-) as an option flag. Some options use a preceding "-" to
indicate that a feature be disabled; this can be confusing at first to users accustomed to seeing
"-" as an introductory symbol on all options.
Although xset can be run any time, it is suggested that you run it at startup. These settings
reset to the default values when you log out. Not all X implementations are guaranteed to
honor all of these options.
Keyboard Bell
The b option controls bell volume (as a percentage of its maximum), pitch (in hertz), and
duration (in milliseconds). It accepts up to three numerical parameters:
b volume pitch duration
If no parameters are given, the system defaults are used. If only one parameter is given, the
bell volume is set to that value. If two values are listed, the second parameter specifies the
bell pitch. If three values are listed, the third one specifies the duration.
For example, the command:
% xset b 70 i000 i00
sets the volume of the keyboard bell to 70 percent of the maximum, the pitch to 1000 hertz,
and the duration to 100 milliseconds.
Setup Clients 219
Note that the particular LED values may refer to different LEDs on different hardware.
Pointer Acceleration
The m (mouse) option controls the rate at which the mouse or pointer moves across the
screen. This option takes two parameters: accelerati on and t,hres,hold. They must
be positive integers. Cllae acceleration can also be written as a numerator/denominator com-
bination separated by a '/', for example, 5/4.)
The mouse or pointer moves accelerat.ion times as fast when it travels more than the
t.hres.hold number of pixels in a short time. This way, the mouse can be used for precise
alignment when it is moved slowly, yet it can be set to travel across the screen by a flick of
the wrist when desired. If only one parameter is given, it is interpreted as the acceleration.
For example, the command:
% xset m 5 I0
sets the mouse movement so that if you move the mouse more than ten pixels, the mouse cur-
sor moves five times as many pixels on the screen as you moved the mouse on the pad.
If no parameter or the value default is used, the system defaults will be set.
If you want to change the threshold and leave the acceleration unchanged, enter the value
de f a u it for acceleration.
Screen Saver
X supports a screen saver to blank or randomly change the screen when the system is left
unattended for an extended period. This avoids the "bum in" that can occur when the same
image is displayed on the screen for a long time. The s (screen saver) option to xset deter-
mines how long the server must be inactive before the screen saver is started.
The s option takes two parameters: time and cyc1 e. The screen goes blank if the server
has not received any input for the time interval specified by the t./me parameter. The con-
tents of the screen reappear upon receipt of any input. If the display is not capable of blank-
ing the screen, then the screen is shifted a pixel in a random direction at time intervals set by
the cycl e parameter. The parameters are specified in seconds.
For example, the command:
% xset s 600
sets the length of time before the screen saver is invoked to 600 seconds (ten minutes).
For a display not capable of blanking the screen, the command:
% xset s 600 I0
sets the length of time before the screen saver is invoked to ten minutes and shifts the screen
every ten seconds thereafter, until input is received.
222 X Window System User's Guide
The s option also takes the parameters:
default Resets the screen save option to the default.
blank Turns on blanking and overrides any previous settings.
noblank Displays a background pattern rather than blanking the screen; overrides any
previous settings.
o f f Turns off the screen saver option and overrides any previous settings.
expose Allows window exposures (the server can discard window contents).
noexpose Disables screen saver unless the server can regenerate the screens without
causing exposure events (i.e., without forcing the applications to regenerate
their own windows).
Color Definition
On color displays, every time a client requests a private read/write colorcell, a new color def-
inition is entered in the display's colormap. The p option sets one of these colormap entries
even though they are supposed to be private. The parameters are a positive integer identify-
ing a cell in the colormap to be changed, and a color name:
p entry_number color_name
The root window colors can be changed on some servers using xsetroot. An error results if
the map entry is a read-only color.
For example, the command:
sets the third cell in the colormap to the color blue, but only if some client has allocated this
cell read/write.
The client that allocated the cell is likely to change it again sometime after you try to set it,
since this is the usual procedure for allocating a read/write cell.
Help with xset Options
The q option lists the current values of all xset preferences.
Setup Clients
223
xsetroot: Setting Root Window Characteristics
You can use the xsetroot client to tailor the appearance of the background (root) window on a
display running X.
The xsetroot client is primarily used to specify the root window pattern: as a plaid-like grid,
tiled grey pattern, solid color, or a bitmap. You can also specify foreground and background
colors (defaults are black and white), reverse video, and set the shape of the pointer when it's
in the root window.
If no options are specified, or the -clef option is specified, xsetroot resets the root window to
its default state, a grey mesh pattern, and resets the pointer to the hollow X pointer. The
-def option can also be specified with other options; those characteristics that are not set by
other options are reset to the defaults.
Although xsetroot can be run any time, it is suggested that you run it from a startup shell
script, as described at the end of this chapter. All settings reset to the default values when
you log out.
For a complete list of options, see the xsetroot reference page in Part Three of this guide. Not
all X implementations are guaranteed to support all of these options. Some of the options
may not work on certain hardware devices.
The -help option prints all the xsetroot options to standard outpuL The options you'll
probably use most frequently are explained in the next section. Since only one type of back-
ground pattern can be specified at a time, the -solid, -gray, -grey, -bitmap and
-rood options are mutually exclusive.
Setting Root Window Patterns
The default root window pattern is called a "grey mesh." On most displays, it is fairly dark.
The xsetroot client allows you to specify an alternative grey background with the -grey (or
-gray) option. This tiled grey pattern is slightly lighter than the default grey mesh pattern.
The xsetroot client also allows you to create a root window made up of repeated "tiles" of a
particular bitmap, using the option:
-bitmap filename
where filename is the bitmap file to be used as the window pattern.
You can choose any of the bitmaps in the directory lusrlincludelXlllbitmaps or make your
own bitmap files using the bitmap client (see Chapter 7, Other Clients).
For example, the command:
% xsetroot -bitmap /usr/andy/gumby -fg red -bg blue
fills the root window with a tiling of the bitmap lusrlandylgumby (a virtu army of Gu-
bys!), using the colors red and blue.
224 X Window System User's Guide
In the following sections, we discuss key mapping, with an emphasis on the first type of map-
ping, of modifier keyname functions. Chances are, you'll have relatively little call to map
other key functions (such as Backspace), though we have included an example of one such
mapping, just in case.
After considering key mapping, we'll take a look at the much simpler issues involved in map-
ping pointer button functions. As you might expect, when you're changing the functionality
of (up to) three pointer buttons, it's fairly simple to keep track of what you're doing.
On the other hand, mapping modifier key functions to physical keys can be more than a little
confusing. In order to understand the mechanics of mapping keys, we first need to take a
look at some terms used to describe keyboard keys.
Keycodes and Keysyms
Each key on a physical keyboard can be identified by a number known as a keycode. (Tech-
nically speaking, a keycode is the actual value that the key generates.) Keycodes cannot be
mapped to other keys. No matter what functions you assign to various keys with xmodmap,
the keycode associated with each physical key remains the same.
In addition to a keycode, each physical key is associated with a name known as a keysym. A
keysym ("key symbol" name) is a name that represents the label on a key (theoretically) and
corresponds to its function.
Alphanumeric keys generally have obvious keysyms, corresponding to the label on the key:
for example, the keysym for the key labeled "H" is h. Unfortunately, a keysym does not
always correspond to the key label. For example, on a Sun-3 workstation, though the keysym
for the key labeled "Return" is Return, the keysym for the key labeled "Alternate" is Break,
and the keysym for the key labeled "Right" is Meta R.
--
While each keycode is tied to a physical key, each keysym corresponds to a function--and
the keysym/function is mapped to a particular physical key (keycode). Every keyboard has a
default assignment of keysyms to keycodes. In most cases, each physical key on the key-
board will be associated with a different keysym. As we'll see, however, the keysym (func-
tion) associated with a particular physical key (keycode) can be changed. This is done by
assigning the keysym of one key to the keycode of another.
The modifier keynames recognized by X are not to be confused with keysyms. The X modi-
fier keys are limited to the eight keynames discussed previously and are assigned in adch'tion
to the regular keysym/keycode pairings. In other words, when a physical key is mapped to
function as the X Control key, it already has a default functionality (keysym) and keycode.
By default, most modifier keyname functions are mapped to keys having keysyms represent-
ing the same function. For example, the X Control keyname is probably mapped to the key
labeled Control, and having the keysym Control.
The Meta modifier keyname is probably also assigned to a key having the keysym Meta.
However, determining which physical key has the keysym Meta can be something of a
puzzle. Later in this chapter, we'll consider a program called xev, which can be used to
determine the keysym and keycode of any physical key.
Setup Clients 229
"Logical" modifier keyname
recognized by X
Shift
Lock
Control
Modl
Keysym
Shift_L
Shift_R
Caps_Lock
Control_L
Meta_L
Meta_R
Keycode
(hex version)
(0x6a)
(0x75)
(0x7e)
(0x53)
(0x7f)
(0x81)
In this mapping, two keys are assigned as Meta (modl) keys: keys having the keysyms
Meta_L and Meta_R (for left and right, apparently one on each side of the keyboard). Unfor-
tunately, as you can see, this doesn't really tell you which keys these are on the physical key-
board. You still need to know which physical keys (keycodes) have the keysyms Meta_L and
Meta_R. You can determine this using the xev client, described later in this chapter.
Determining the Default Key Mappings
Before you start mapping keys, you should display and save a map of the default assignments
of keysyms to keycodes. Running xmodmap with the -pk option prints a current map of all
keyboard keys to standard output. This map, called a keymap table, lists the decimal key-
code on the left and the associated keysym(s) on the right. Figure 11-1 shows a portion of a
typical keymap table, for a Sun-3 keyboard.
Notice that each keysym is listed by a keysym name (comma, Caps_Lock, etc.) and a keysym
value (0x002c, 0xffe5, etc). For our purposes, this value is irrelevant. It cannot be supplied
as a keysym argument to xmodmap.
As you can see, the keymap table lists regular keyboard keys (C, V, comma, slash, space,
etc.), and function/numeric keypad keys (R13, F35, etc.) as well as modifier keys
(Caps_Lock, Meta_L and Meta_R). If you map several keys, you may get confused as to the
original assignments. Before you map any keys, we suggest you redirect the keymap table to
a file to save and use as a reference:
% xmodmap -pk > keytable
The keysyms recognized by your server are a subset of a far greater number of keysyms
recognized internationally. The file/usr/include/X11/keysym.h lists the keysymfamilies that
are enabled for your server. The file/usr/include/X11/keysymdef.h lists the keysyms in each
of the families enabled for your server, as well as the keysyms in several other families. See
Appendix H, Keysyms, of Volume Two, Xlib Reference Manual, for more information on
keysyms and tables of the most common ones.
Setup Clients
231
Keycode
109
110
III
112
113
114
115
116
117
118
119
120
121
Keysym
value (name)
0x0043
0x0056
0x0042
0M004e
0x004d
0x002c
0x002e
0x002f
0xffe2
0xff0a
0xffde
0xff54
0xffe0
(c)
(v)
(B)
(N)
(M)
(comma) 0x003c (less)
(period) 0x003e (greater)
(slash) 0x003f (question)
(Shift R)
--
(Linefeed)
(RI3)
(Down) 0xffdf (F34)
(F35)
126
127
128
129
0xffe5 (Caps_Lock)
0xffe7 (Meta L)
--
0x0020 (space)
0xffe8 (Meta R)
--
Figure 11-1. Partial keymap table
Matching Keysyms with Physical Keys Using xev
The keysym and keycode for any key can be determined with the xev client.* This is particu-
larly useful for finding the Meta key(s). The xev client is used to keep track of events, pack-
ets of information that are generated by the server when actions occur and are interpreted by
other clients. Moving the pointer or pressing a keyboard key cause input events to occur.
(For more information about events, see Volume One, Xlib Programming Manual.)
To use xev, enter the command:
% xev
in an xterm window, and then use the pointer to place the xev window, as in Figure l 1-2.
Within the xev window is a small box. Move the pointer inside this box. When you type a
key inside the box, information about the key, including its keysym and keycode, will be
displayed in the xterm window from which you started xev. The relevant information will
look like this:
*xev is a Release 3 standard client. In Release 4, it has been moved to the demos directory. If an executable version
does not exist on your system, ask your system administrator.
If you cannot use xev, you must rely on the keymap table and a little deductive reasoning. Since certain twin func-
tions have keyboard shortcuts involving the Meta key, testing these shortcuts should help you locate this key. See
Chapter 3, Using the twin Window Manager, for more information.
232 X Window System Users Guide
There are 3 pointer buttons defined.
Physical Button
Button Code
1 1
2 2
3 3
Figure 11-3. Pointer map
These are typical assignments for a right-handed person: the first logical button is the left-
most button, designed to be pressed by the right index finger. The xmodmap client allows
you to reassign logical buttons so that the pointer can be more easily used with the left hand.
The xmodmap client allows you to change the pointer map.* There are two xmodmap expres-
sions: one to assign logical pointer buttons (button codes) to physical buttons; and another to
restore the default assignments. The syntax of the expressions is as follows:
pointer = x y z
Sets the first, second, and third physical buttons to the button codes x, y, and z.
pointer = default
Sets the pointer map back to its default settings (button 1 generates a code of l, but-
ton 2 generates a code of 2, etc.).
Being able to change the pointer button assignments is very useful if you happen to be left-
handed and would like the rightmost physical button to function as the first logical button
(i.e., generate button code 1). To configure the pointer for a southpaw:
% xmmap -e 'pointer = 3 2 l'
Then if you display the pointer mappings with xmodmap -pp, you get the following:
There are 3 pointer buttons defined.
Physical Button
Button Code
1 3
2 2
3 1
You can then push the first logical button (button code l) with the index finger of your left
hand.
You can return to the default pointer button assignments by entering:
% xmdmap -e ' pointer = default'
*Remember that the -n option, which allows you to see what xmodmap would do, without performing the changes,
cannot be used with expressions to change the pointer mapping.
Setup Clients
237
Part Three:
Client Reference Pages
This part of the guide provides UNIX-style "man-pages" for each of the X pro-
grams. These pages are arranged alphabetically for ease of reference, and
they contain detailed information (such as all options to a program) that is not
covered in other parts of this guide.
The following reference pages appear in this section:
intro xdm
X xdpr
Xau xdpyinfo
Xserver xedit
appres xev
bdftosnf xfd
bitmap xfontsel
listres xhost
mkfontdir xinit
oclock xkill
resize xlswins
sedscr xmag
showsnf xman
twm xmh (Release 4)
uwm xmh (Release 3)
xlOtoxl I xmodmap
xauth xpr
xbiff xprop
xcalc xpseudoroot
xclipboard xrdb
xclock xrefresh
xcutsel xset
xditview xsetroot
xload xstdcmap
xlogo xterm
xlsatoms xwd
xlsclients xwininfo
xlsfonts xwud
raThe X Window System
,jr X
Name
X - a portable, network transparent window system.
Description
X is a network transparent window system developed at MIT that runs on a wide range of com-
puting and graphics machines. The Release 4 core distribution from MIT has support for the
following operating systems:
Ultrix 3.1 (Digital)
SunOS 4.0.3 (Sun)
HP-UX 6.5 (HewleU-Packard)
Domain/OS 10.1 (HP/Apollo)
UX 1.1 (Apple)
AIX RT-2.2 and PS/2-1.1 (IBM)
AOS-4.3 (IBM)
UTEK 4.0 (Tektronix)
NEWS-OS 3.2 (Sony; client only)
UNICOS 5.0.1 (Cray; client only)
UNIX(tm) System V, Release 3.2 (AT&T 6386 WGS; client only)
It should be relatively easy to build the client-side software on a variety of other systems.
Commercial implementations are also available for a much wider range of platforms.
The X Consortium requests that the following names be used when referring to this software:
X
X Window System
X Version 11
X Window System, Version 11
Xll
X Window System is a trademark of the Massachusetts Institute of Technology.
X window system sewers run on computers with bitmap displays. The sewer distributes user
input to and accepts output requests from various client programs through a variety of different
interprocess communication channels. Although the most common case is for the client pro-
grams 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.
X supports overlapping hierarchical subwindows and text and graphics operations, on both
monochrome and color displays. For a full explanation of the functions that are available, see
Volume Four, X Toolkit Intrinsics Programming Manual and Volume Five, X Toolkit Intrinsics
Reference Manual.
The number of programs that use X is growing rapidly. Of particular interest are: a terminal
emulator (xterm), a window manager (twm), a display manager (xdm), mail managing utilities
(xmh and xbiff), a manual page browser (xman), a bitmap editor (bitmap), access control
X Window System User's Guide 245
X (continued) The X Window System
programs (xauth and xhost), user preference setting programs (xrdb, xset, xsetroot, and xmod-
map), a load monitor (xload), clocks (oclock and xclock), a font displayer (xfd), utilities for list-
ing information about fonts, windows, and displays (xlsfonts, xfontsel, xlswins, xwininfo, xdpy-
info, xlsclients, and xprop), a diagnostic for seeing what events are generated and when (xev),
screen image manipulation utilities (xwd, xwud, xpr, and xmag), and various demos (xeyes, ico,
muncher, puzzle, xgc, etc.).
Many other utilities, window managers, games, toolkits, etc. are available from the user-contri-
buted dislribution. See your site administrator for details.
Starting Up
There are currently three ways of starting the X server and an initial set of client applications.
The particular method used depends on what operating system you are running and on whether
or not you use other window systems in addition to X.
xdm (the X Display Manager)
If you want to always have X running on your display, your site administrator
can set your machine up to use the X Display Manager xdm. This program is
typically started by the system at boot time and takes care of keeping the
server running and getting users logged in. If you are running xdm, you will
see a window on the screen welcoming you to the system and asking for your
username and password. Simply type them in as you would at a normal ter-
minal, pressing the Return key after each. If you make a mistake, xdm will
display an error message and ask you to try again. After you have success-
fully logged in, xdm will start up your X environment. By default, if you
have an executable file named .xsession in your home directory, xdm will
treat it as a program (or shell script) to run to start up your initial clients (such
as terminal emulators, clocks, a window manager, user settings for things like
the background, the speed of the pointer, etc.). Your site administrator can
provide details.
xinit (run manually from the shell)
Sites that support more than one window system might choose to use the xinit
program for starting X manually. If this is true for your machine, your site
administrator will probably have provided a program named "xl 1", "starlx",
or "xstart" that will do site-specific initialization (such as loading convenient
default resources, running a window manager, displaying a clock, and starting
several terminal emulators) in a nice way. If not, you can build such a script
using the xinit program. This utility simply runs one user-specified program
to start the server, runs another to start up any desired clients, and then waits
for either to finish. Since either or both of the user-specified programs may
be a shell script, this gives substantial flexibility at the expense of a nice
interface. For this reason, xinit is not intended for end users.
xterm -L (started from letclinit)
This method can be used only with Release 3 (or an earlier release) of X.
Some versions of UNIX that are derived from BSD 4.3 support starting the
246 X Window System User's Guide
X (continued) The X Window System
% xeyes -display Joesws : 0 -geomtr 1000x1000+0+0
% rsh big xterm -display myws:O -is </dev/null &
X servers listen for connections on a variety of different communications channels (network
byte streams, shared memory, etc.). Since there can be more than one way of contacting a
given server, the hose name part of the display name is used to determine the type of channel
(also called a transport layer) to be used. The sample servers from MIT support the following
types of connections:
local
TCPFIP
DECnet
The host part of the display name should be the empty string. For example:
:0, :l, and :0.i.
The host part of the display name should be the server machine's IP address
name. Full Internet names, abbreviated names, and IP addresses are all
allowed. For example: expo. lcs .mit. edu : 0, expo : 0,
18.30.0. 212 : 0, bigmachine : 1, and hydra : 0.1.
The host part of the display name should be the server machine's nodename
followed by two colons instead of one. For example: myws : : 0, big : : 1,
and hydra : : 0.1.
Access Control
The sample server provides two types of access control: an authorization protocol that pro-
vides a list of "magic cookies" clients can send to request access (available as of Release 4);
and a list of hosts from which connections are always accepted, xdm initializes magic cookies
in the server, and also places them in a file accessible to the user. Normally, the list of hosts
from which connections are always accepted should be empty, so that only clients that are
explicitly authorized can connect to the display. When you add entries to the host list (with
xhost), the server no longer performs any authorization on connections from those machines.
Be careful with this.
The file for authorization used by both xdm and Xlib can be specified with the environment
variable XAUTHORITY, and defaults to the file .Xauthority in the home directory, xdm uses
$HOMEI.Xauthority and will create it or merge in authorization records if it already exists
when a user logs in.
To manage a collection of authorization files containing a collection of authorization records,
use xauth. This program allows you to extract records and insert them into other files. Using
this, you can send authorization to remote machines when you login. As the files are machine-
independent, you can also simply copy the files or use NFS to share them. If you use several
machines, and share a common home directory with NFS, then you never really have to worry
about authorization files, the system should work correctly by default. Note that magic cookies
transmitted "in the clear" over NFS or usingftp or rcp can be "stolen" by a network eaves-
dropper, and as such may enable unauthorized access. In many environments this level of secu-
rity is not a concern, but if it is, you need to know the exact semantics of the particular magic
cookie to know if this is actually a problem.
248 X Window System User's Guide
The X Window System (continued) X
/usr/lib/X11 Ifonts175dpi
This directory contains fonts contributed by Adobe Systems, Inc., Digital
Equipment Corporation, Bitstream, Inc., Bigelow and Holmes, and Sun
Microsystems, Inc. for 75 dots per inch displays. An integrated selection of
sizes, styles, and weights is provided for each family.
lusrllib/X111fonts1100dpi
This directory contains 100 dots per inch versions of the fonts in the 75dpi
directory.
Font databases are created by running the mkfontdir program in the directory containing the
source or compiled versions of the fonts (in both compressed and uncompressed formats).
Whenever fonts are added to a directory, mkfontdir should be rerun so that the server can find
the new fonts. To make the server reread the font database, reset the font path with the xset
program. For example, to add a font to a private directory, the following commands could be
used:
% cp newfont, snf -/myfonts
% mkfontdir ~/myfonts
% xset fp rehash
The xlsfonts program can be used to list all of the fonts that are found in font databases in the
current font path. Font names tend to be fairly long as they contain all of the information
needed to uniquely identify individual fonts. However, the sample server supports wildcarding
of font names, so the full specification:
-adobe-cour ie r-medium-r-norma i- - 1 O- 10 0-7 5-7 5-m- 60-iso8 8 5 9-1
could be abbreviated as:
*-cour ier-medium-r-normal--*- 10 0-*
Because the shell also has special meanings for * and ?, wildcarded font names should be
quoted:
% xlsfonts -fn ' *-courier-medium-r-normal--*-100-*'
If more than one font in a given directory in the font path matches a wildcarded font name, the
choice of which particular font to return is left to the server. However, if fonts from more than
one directory match a name, the returned font will always be from the first such directory in the
font path. The example given above will match fonts in both the 75dpi and lOOdpi directories;
if the 75dpi directory is ahead of the lOOdpi directory in the font path, the smaller version of
the font will be used.
Color Names
Most applications provide ways of tailoring (usually through resources or command line argu-
ments) the colors of various elements in the text and graphics they display. Although black and
white displays don't provide much of a choice, color displays frequently allow anywhere
between 16 and 16 million different colors.
X Window System User's Guide 251
X (continued) The X Window System
Colors are usually specified by their commonly-used names (for example, red, white, or
medium slate blue). The server translates these names into appropriate screen colors using a
color database that can usually be found in lusrlliblX111rgb.txt. Color names are case-insensi-
five, meaning that red, Red, and RED all refer to the same color.
Many applications also accept color specifications of the following form:
#rgb
#rrggbb
#rrrgggbbb
#rrrrggggbbbb
where r, g, and b are hexidecimal numbers indicating how much red, green, and blue should be
displayed (zero being none and ffff being on full). Each field in the specification must have the
same number of digits (e.g., #rrgb or #gbb are not allowed). Fields that have fewer than four
digits (e.g., #rgb) are padded out with zero's following each digit (e.g., #r000g000b000). The
eight primary colors can be represented as:
black
red
green
blue
yellow
magenta
cyan
white
#000000000000 (no color at all)
#ffff00000000
#0000ffff0000
#00000000ffff
#ffffffff0000 (full red and green, no blue)
#ffff0000ffff
#0000ffffffff
# ffffffffffff (full red, green, and blue)
Unfortunately, RGB color specifications are highly unportable since different monitors produce
different shades when given the same inputs. Similarly, color names aren't portable because
there is no standard naming scheme and because the color database needs to be tuned for each
monitor. Application developers should take care to make their colors tailorable.
Keys
The X keyboard model is broken into two layers: server-specific codes (called keycodes) which
represent the physical keys, and server-independent symbols (called keysyms) which represent
the letters or words that appear on the keys. Two tables are kept in the server for converting
keycodes to keysyms:
modifier list
Some keys (such as Shift, Control, and Caps Lock) are known as modifier and
are used to select different symbols that are attached to a single key (such as
Shift-a generates a capital A, and Control-L generates a formfeed character
"L). The server keeps a list of keycodes corresponding to the various modifier
keys. Whenever a key is pressed or released, the server generates an event
that contains the keycode of the indicated key as well as a mask that specifies
which of the modifer keys are currently pressed. Most servers set up this list
to initially contain the various shift, control, and shift lock keys on the key-
board.
252 X Window System User's Guide
The X Window System (continued) X
If these resources were stored in a file called .Xresources in your home directory, they could be
added to any existing resources in the server with the following command:
xrc -merge $HOE/.Xresource8
This is frequently how user-friendly startup scripts merge user-specific defaults into any site-
wide defaults. All sites are encouraged to set up convenient ways of automatically loading
resources.
Examples
The following is a collection of sample command lines for some of the more frequently used
commands. For more information on a particular command, please refer to that command's
manual page.
xrdb -load SHOME/.Xresource8
xmodmap -e ' keysym BackSpace = Delete'
% mkfontdir /usr/local/lib/Xll/otherfont8
% xset fp+ /usr/local/lib/Xll/otherfonts
% xmodmap $HOME/. keymap, km
% xsetroot -solid '#888'
% xset b I00 400 c 50 s 1800 r on
% xset q
% twin
% xmag
% xclock -geometry 48x48-0+0 -bg blue -fg white
% xeyes -geometry 48x48-48+0
% xbiff -update 20
% xlsfonts ' *helvetica*'
% xlswins -i
% xwininfo -root
% xdpyinfo -display Joesworkstation : 0
% xhost -Joesworkstation
% xrefresh
% xwd I xwud
% bitmap companylogo.bm 32x32
% xcalc -bg blue -fg magenta
% xterm -geometry 80x66-0-0 -nam myxterm
Diagnostics
A wide variety of error messages are generated from various programs. Various toolkits are
encouraged to provide a common mechanism for locating error text so that applications can be
tailored easily. Programs written to interface directly to the Xlib C language library are
expected to do their own error checking.
The default error handler in Xlib (also used by many toolkits) uses standard resources to con-
struct diagnostic messages when errors occur. The defaults for these messages are usually
stored in lusr/liblX111XErrorDB. If this file is not present, error messages will be rather terse
and cryptic.
X Window System User's Guide 257
X (continued) The X Window System
When the X Toolkit Intdnsics encounter errors converting resource strings to the appropriate
internal format, no error messages are printed. This is convenient when it is desirable to have
one set of resources across a variety of displays (e.g., color versus monochrome, lots of fonts
versus very few, etc.), although it can pose problems for trying to determine why an application
might be failing. This behavior can be overridden by setting the StringConversions-
Wa rn ing resource.
To force the X Toolkit Intrinsics to always print string conversion error messages, the following
resource should be placed at the top of the file that gets loaded onto the RESOURCE_MANAGER
property using the xrdb program (frequently called .Xresources or .Xres in the user's home
directory):
*StringConversionWarnings: on
To have conversion messages printed for just a particular application, the appropriate instance
name can be placed before the asterisk:
xterm*StringConversionWarnings: on
Bugs
If you encounter a repeatable bug, please contact your site administrator for instructions on
how to submit an X Bug Report.
See Also
XConsortium(1), XStandards(1), Xau, Xserver, mkfontdir, bdftosnf, bitmap, bsdtosnf, oclock,
showsnf, twm, uwm, xl0toxl 1, xauth, xbiff, xcalc, xclock, xdpyinfo, xedit, xev, xfd, xfontsel,
xhost, xinit, xkill, xload, xlogo, xlsclients, xlsfonts, xlswins, xmag, xman, xmh, xmodmap, xpr,
xprop, xrdb, xrefresh, xset, xsetroot, resize, xterm, xwd, xwininfo, xwud, biff(1), mh(1), init(8),
ttys(5); Volume One, Xlib Programming Manual; Volume Two, Xlib Reference Manual; Vol-
ume Four, X Toolkit Intrinsics Programming Manual; Volume Five, X Toolkit Intrinsics Refer-
ence Manual.
Copyright
The following copyright and permission notice outlines the rights and restrictions covering
most parts of the standard distribution of the X Window System from MIT. Other parts have
additional or different copyrights and permissions; see the individual source files.
Copyright 1984, 1985, 1986, 1987, 1988, 1989 Massachusetts Institute of Technology.
Permission to use, copy, modify, and distribute this software and its documentation for any pur-
pose and without fee is hereby granted, provided that the above copyright notice appear in all
copies and that both that copyright notice and this permission notice appear in supporting docu-
mentation, and that the name of M.I.T. not be used in advertising or publicity pertaining to dis-
tribution of the software without specific, written prior permission. M.I.T. makes no represen-
tations about the suitability of this software for any purpose. It is provided "as is" without
express or implied warranty.
258 X Window System User's Guide
Xserver
X Window System Server m
Name
X - X Window System server.
Syntax
X [ : di spl ayn umber] [opti on s] [t tyname]
Description
X is the generic name for the X Window System server. It is frequently a link or a copy of the
appropriate server binary for driving the most frequently used server on a given machine. The
sample server from MIT supports the following platforms:
Xqvss
Xqdss
Xsun
Xhp
Xibm
Xapollo
XmaclI
Xcfbpmax
Xmfbpmax
Xtek
Digital monochrome vaxstationlI or II
Digital color vaxstationlI or II
Sun monochrome or color Sun 2, 3, or 4
HP Topcat 9000s300
IBM AED, APA and megapel PC/RT, 8514 and VGA PS/2 model 80
Apollo monochrome or color (Domain/OS SR10.1 or SR10.2)
Apple monochrome Macintosh II
Digital color DECstation 3100
Digital monochrome DECstation 3100
Tektronix 4319 (this is the only tested configuration)
Starting the Server
The server is usually started from the X Display Manager program, xdm. This utility is run
from the system boot files and takes care of keeping the server running, prompting for user-
names and passwords, and starting up the user sessions. It is easily configured for sites that
wish to provide nice, consistent interfaces for novice users (loading convenient sets of
resources, starting up a window manager, clock, and nice selection of terminal emulator win-
dows).
Since xdm now handles automatic starting of the server in a portable way, the -T, option to
xterm is now considered obsolete. Support for starting a login window from BSD 4.3-derived
/etc/ttys files is no longer included as of Release 4.
Installations that run more than one window system will still need to use the xinit utility. How-
ever, xinit is to be considered a tool for building startup scripts and is not intended for use by
end users. Site adminstrators are strongly urged to build nicer interfaces for novice users.
When the sample server starts up, it takes over the display. If you are running on a workstation
whose console is the display, you cannot log into the console while the server is running.
Network Connections
The sample server supports connections made using the following reliable byte-streams:
TCP/IP The server listens on port htons(6000+n), where n is the display number.
UNIX Domain The sample server uses /tmp/.X11-unix/Xn as the filename for the socket,
where n is the display number.
262 X Window System User's Guide
X Window System Server (continued) Xserver
DECnet
The server responds to connections to object X$Xn, where n is the display
number.
Options
All of the sample servers accept the following command line options:
-a number Sets pointer acceleration (i.e., the ratio of how much is reported to how much
the user actually moved the pointer).
-auth authori zati on-fil e
Specifies a file which contains a collection of authorization records used to
authenticate access. (Available as of Release 4.)
bc
Disables certain kinds of error checking, for bug compatibility with previous
releases (e.g., to work around bugs in Release 2 and Release 3 versions of
xterm and the toolkits). Use of this option is discouraged. (Available as of
Release 4.)
Disables backing store support on all screens.
Turns off key-click.
c vol ume
-cc class
Sets key-click volume (allowable range: 0-8).
Sets the visual class for the root window of color screens. The class numbers
are as specified in the X protocol. Not obeyed by all servers. (Available as of
Release 4.)
-dpi resol ut./. on
Sets the resolution of the screen, in dots per inch. To be used when the server
cannot determine the screen size from the hardware. (Available as of Release
4.)
-f volume
-I
Sets beep (bell) volume (allowable range: 0-7).
Causes all remaining command line arguments to be ignored. (Available as
of Release 4.)
-ld kilobytes
Sets the data space limit of the server to the specified number of kilobytes.
The default value is zero, making the data size as large as possible. A value
of-1 leaves the data space limit unchanged. (Available as of Release 4; not
available in all operating systems.)
-is k.i.lobytes
Sets the stack space limit of the server to the specified number of kilobytes.
The default value is zero, making the stack size as large as possible. A value
of -1 leaves the stack space limit unchanged. This option is not available in
all operating systems. (Available as of Release 4; not available in all operat-
ing systems.)
-logo Turns on the X Window System logo display in the screen-saver. There is
currently no way to change this from a client.
X Window System User's Guide 263
Xserver (continued) X Window System Server
Bugs
The option syntax is inconsistent with itself and xset.
The acceleration option should take a numerator and a denominator like the protocol.
If X dies before its clients, new clients won't be able to connect until all existing connections
have their TCP TIME_WAIT timers expire.
The color database is missing a large number of colors. However, there doesn't seem to be a
better one available that can generate RGB values tailorable to particular displays.
Authors
The sample server was originally written by Susan Angebranndt, Raymond Drewry, Philip
Karlton, and Todd Newman, of Digital Equipment Corporation, with support from a large cast.
It has since been extensively rewritten by Keith Packard and Bob Scheifler of MIT.
268 X Window System User's Guide
bdftosnf
BDF to SNF Font Compiler--
Name
bdftosnf - BDF to SNF font compiler for X11.
Syntax
bdftoenf [options] bdf file
Description
bdftosnf reads a Bitmap Distribution Format (BDF) font from the specified file (or from stan-
dard input if no file is specified) and writes an X11 Server Natural Format (SNF) font to stan-
dard output.
Options
-pnumber
-unumber
-m
-1
-M
-L
--W
-W
Forces the glyph padding to a specific number. The legal values are 1, 2, 4,
and 8.
Forces the scanline unit padding to a specific number. The legal values are
1,2,and4.
Forces the bit order to most significant bit first.
Forces the bit order to least significant bit first.
Forces the byte order to most significant byte first.
Forces the byte order to least significant byte first.
Prints warnings if the character bitmaps have bits set to one outside of their
defined widths.
Prints warnings for characters with an encoding of - 1; the default is to silently
ignore such characters.
Expands glyphs in "terminal-emulator" fonts to fill the bounding box.
Suppresses computation of correct ink metrics for "terminal-emulator" fonts.
See Also
X, Xserver, Bitmap Distribution Format 2.1
270 X Window System User's Guide
--System Bitmap Editor
f
bitmap
Name
bitmap, bmtoa, atobm - system bitmap editor and conversion utilities.
Syntax
bitmap [options] fil ename [WIDTHxHEIGHT]
Immtoa [options] filename
atolmm [options] filename
Description
bitmap allows you to create and edit small bitrnaps which you can use to create backgrounds,
icons, and pointers. A bitmap is a grid of pixels, or picture elements, each of which is white,
black, or, in the case of color displays, a color.
The bmtoa and atobm filters convert bitmap files to and from ASCII strings. They are most
commonly used to quickly print out bitmaps and to generate versions for inclusion in text. The
bmtoa and atobm programs are available in the standard distribution of X as of Release 3.
The window that bitmap creates has three sections (see Figure 6-1 in Part One of this guide).
The largest section is the checkerboard grid, which is a magnified version of the bitmap you are
editing. Squares on the grid can be set, cleared, or inverted directly with the buttons on the
pointer. A menu of higher level operations, such as drawing lines and circles, is provided to the
right of the grid. You can invoke these menu commands by clicking with any mouse button.
Beneath the menu commands is an actual size picture of the bitmap you are editing; below this
is an inverted version of the same bitmap. Each time the grid changes, the same change occurs
in the actual-size bitmap and its inverse.
If the bitmap is to be used for defining a cursor, one of the squares in the image may be desig-
nated as the hot spot. This determines where the cursor is actually pointing. For cursors with
sharp tips (such as arrows or fingers), this is usually at the end of the tip; for symmetric cursors
(such as crosses or bullseyes), this is usually at the center.
Bitmaps are stored as small C code fragments suitable for including in applications. They pro-
vide an array of bits as well as symbolic constants giving the width, height, and hot spot (if
specified) that may be used in creating cursors, icons, and tiles.
The W_TDTHxHE_TGHT argument gives the size to use when creating a new bitmap (the default
is 16x6). Existing bitmaps are always edited at their current size.
If the bitmap window is resized by the window manager, the size of the squares in the grid will
shrink or enlarge to fit.
Options: bitmap
-display [host] : server[, screen]
Allows you to specify the host, server, and screen on which to create the bit-
map window, host specifies which machine to create the bitmap window
on, server specifies the server number, and screen specifies the screen
number. For example:
X Window System User's Guide 271
System Bitmap Editor (continued) bitmap
Options: atobm
The atobm conversion program accepts the following options:
-chars cc Specifies the pair of characters to use when converting string bitmaps into
arrays of numbers. The first character represents a 0 bit and the second char-
acter represents a 1 bit. The default is to use dashes (-) for O's and number
signs (#) for l's.
-name variable
Specifies the variable name to be used when writing out the bitmap file. The
default is to use the basename of the filename command line argument or
leave it blank if the standard input is read.
-xhot number
Specifies the X coordinate of the hot spot. Only positive values are allowed.
By default, no hot spot information is included.
-yhot number
Specifies the Y coordinate of the hot spot. Only positive values are allowed.
By default, no hot spot information is included.
Changing Grid Squares
Grid squares may be set, cleared, or inverted by pointing to them and clicking one of the but-
tons indicated below. Multiple squares can be changed at once by holding the button down and
dragging the cursor across them. Set squares arc filled and represent l's in the bitrnap; clear
squares are empty and represent O's.
Button 1 (usually the left)
Changes one or more grid squares to the foreground color and sets the corre-
sponding bits in the bitmap to 1.
Button 2 (usually
the middle)
Inverts one or more grid squares. The corresponding bit or bits in the bitmap
are inverted (l's become O's and O's become l's).
Button 3 (usually
the right)
Changes one or more grid squares to the background color and sets the corre-
sponding bits in the bitmap to 0.
Menu Commands
To make defining shapes easier, bitmap provides 13 commands for drawing whole sections of
the grid at once, two commands for manipulating the hot spot, and two commands for updating
the bitmap file and exiting. A command button for each of these operations is located to the
right of the grid.
Several of the commands operate on rectangular portions of the grid. These areas are selected
after the command button is pressed by moving the cursor to the upper left square of the desired
area, pressing a pointer button, dragging the cursor to the lower right hand comer (with the but-
ton still pressed), and then releasing the button. The command may be aborted by pressing any
other button while dragging or by releasing outside the grid.
i
X Window System User's Guide 273
bltmap (continued) System Bitmap Editor
To invoke a command, move the poter over that command and click any button.
The following command descriptions assume that black is the foreground color and white is the
background color (the defaults).
Clear All Turns all the grid squares white and sets all bitmap bits to 0. This is irrevers-
ible, so invoke it with caution.
Set All Turns all the grid squares black and sets all bitmap bits to 1. This is also irre-
versible, so invoke it with caution.
Clear Area Clears a rectangular area of the grid, turning it white and setting the corre-
sponding bitmap to 0. After you click on this command, the cursor turns into
a comer cursor representing the upper-left comer of the area you want to
clear. Press and hold down any mouse button while moving the mouse to the
lower-right comer of the area you want to clear, then release the button.
While you are holding down the button, the selected area is covered with X's,
and the cursor changes to a lower-right comer cursor. If you now wish to
abort the command without clearing an area, either press another mouse but-
ton, move the cursor outside the grid, or move the cursor to the left of or
above the left-comer.
Set Area Turns a rectangular area of the grid black and sets the corresponding bitmap
bits to 1. It works the same way as the Clear Area command.
Invert Area Inverts rectangular area of the grid. It works the same way as the Clear Area
command.
Copy Area Copies a rectangular area from one part of the grid to another. First, you
select the rectangle to be copied, in the manner dcscribed under Clear Area
above.
Once you have selected the area to copy, the cursor changes to an upper-left
comer cursor. When you press a mouse button, a destination rectangle over-
lays the grid; moving the mouse while holding down the button moves this
destination rectangle. The copy occurs when you release the button. To can-
cel the copy, move the mouse outside the grid and then release the button.
Move Area Works identically to Copy Area, except it clears the source rectangle after
copying to the destination.
Overlay Area Lays a rectangular area from one part of the grid over a rectangular area in
another part of the grid. Select the area as described under Clear Area. Over-
lay is not a pixel for pixel replacement: those pixels that are clear (bitmap
bits set to 0) allow those pixels that are set (bitmap bits set to 1) to show
through the overlay.
274 X Window System User's Guide
System Bitmap Editor (continued) bitmap
Line
Circle
Filled Circle
Flood Fill
Set Hot Spot
Clear Hot Spot
Write Output
Quit
Draws a line between two pints. When you select this menu option, the cur-
sor changes to a dot shape. Position the cursor over the first point of the line
you want to draw and click any mouse button. Then position the cursor over
the end point of the line and click any mouse button. A black line is drawn
between the two points.
Draws a circle. When you select this menu option, the cursor changes to a
dot shape. First, position the cursor over the point you want to specify as the
center and click any mouse button. Then position the cursor over a point you
want to specify as the radius and click any mouse button. A black circle is
drawn.
Draws a filled circle when you specify the center and radius of the circle as
with Circle.
Fills all clear squares in a closed shape you specify. When you select this
menu option, the cursor changes to a dot shape. Click on any clear square
inside the shape you want to fill and all clear squares are filled out to the bor-
der of the closed shape. If the shape is not closed, the entire grid will be
filled.
Designates a point on the bitmap as the "hot spoL" If a program is using your
bitmap as a cursor, the hot spot indicates which point on the bitmap is the
"actual" location of the cursor. For instance, if your cursor is an arrow, the
hot spot could be the tip of the arrow; if your cursor is a cross, the hot spot
should be where the perpendicular lines intersecL
Removes any hot spot that was defined for this bitmap.
Writes the current bitmap value to the file specified in the command line. If
the file already exists, the original file is first renamed to Jilename- (in the
manner of emacs(1) and other text editors).
If either the renaming or the writing cause an error, a dialog box will appear
asking if you want to write the file ItmplJilename instead. If you say yes, all
future Write Output commands are written to ItmplJilename as well. See File
Format below for the format of the output file.
Exits the bitmap program. If you have edited the bitmap and have not
invoked Write Output, or you have edited since the last time you invoked Write
Output, a dialog window appears, asking if you want to save changes before
quitting. "Yes" does a Write Output before exiting. "No" just exits, losing the
edits. "Cancel" means you decided not to quit after all and you can continue
with your editing.
You can also terminate bitmap by typing Ctrl-C or q anywhere in the window.
If you have edited the bitmap and have not invoked Write Output, a dialog
window appears, asking if you want to save changes before quitting.
X Window System User's Guide 275
System Bitmap Editor (continued) bltmap
fight:
i0010001 00000100
ii001010 00000110
i0000100 00000100
i0001010 00000100
i0010001 00000100
0x91 0x04
0xca 0x06
0x84 0x04
0x8a 0x04
0x91 0x04
The characrarray canenbegeneratedbyreadingeach row om left to fight, top tobouom:
static char name bits[] = {
--
0x91, 0x04, 0xca, 0x06, 0x84,
0x04, 0x8a, 0x04, 0x91, 0x04
};
The brntoa program may be used to convert bitmap files into arrays of characters for printing or
including in text files. The atobrn program can be used to convert strings back to bitrnap for-
mal
Using Bitmaps in Programs
To define a bitmap or pointer in an X program, include (#include) a bitmap file and refer to its
variables. For instance, to use a pointer defined in the files this.cursor and this_mask.cursor,
#include "this. cursor"
#include "this mask. cursor"
--
XColor foreground background;
Pixmap source = XCreateBitmapFromData (display, drawable, this bits,
--
this_width, this_height) ;
Pixmap mask = XCreateBitmapFromData (display, drawable, this mask bits,
-- _
this_mask_width, this_mask_height) ;
Cursor cursor = XCreatePixmapCursor (display, source, mask, foreground,
background, this x hot, this y hot);
where foreground and background are XColor vslues.
Additional routines are available for reading in bitmap files and returning the data in the file in
Bitmap (single-plane Pixmap for use with routines that require stipples) or full depth Pixmaps
(often used for window backgrounds and borders). Applications writers should be careful to
understand the difference between Bitmaps and Pixmaps so that their programs function cor-
rectly on color and monochrome displays.
For backward compatibility, bitmap will also accept X10 format bitmap files. However, when
the file is written out again it will be in X11 format.
Resources
The bitmap program accepts the following resources. The foreground, background, and high-
light colors are ignored unless you specify new values for all three options.
Background Determines the window's background color. Bits which are 0 in the bitmap
are displayed in this color. Default is white.
X Window System User's Guide 277
bitmap (continued) System Bitmap Editor
BodyFont
BorderColor
BorderWidth
Dashed
Foreground
Highlight
Mouse
Geometry
Dimensions
Determines the text font. Default isftxed, a 6x13 pixel mono-spaced font.
Determines the color of the border. Default is black.
Determines the border width. Default is 2 pixels.
Determines whether dashed or solid lines are used for the bitmap grid. (On
specifies dashed lines, off specifies solid.) Default is on. (Available as of
Release 4.)
Determines the foreground color. Bits which are 1 in the bitmap are
displayed in this color. Default is black.
Determines the highlight color, bitmap uses this color to show the hot spot
and to indicate rectangular areas that are affected by the Move Area, Copy
Area, Set Area, Clear Area, and Invert Area commands. If a highlight color is
not given, then bitmap highlights by inverting. For example, if you have a
black rectangular area selected for a move, white X's appear in the rectangle.
Determines the pointer's color. Default is black.
Determines the size and location of the bitmap window.
Determines the WIDTHxHEIGHT of the checkerboard grid within the bitmap
window. Default is 16x16.
Flies
Many standard bitmaps can be found in the directory lusr/includelX11/bitmaps.
Bugs
The old command line arguments aren't consistent with other X programs.
If you move the pointer too fast while holding a pointer button down, some squares may be
missed. This is caused by limitations in how frequently the X server can sample the pointer
location.
There is no way to write to a file other than the one specified on the command line.
There is no way to change the size of the bitmap once the program has started.
There is no Undo command.
Author
bitmap by Ron Newman, IV[IT Project Athena; bmtoa and atobm by Jim Fulton, IV[IT X Consor-
tium.
See Also
Chapter 6 of this guide; Volume One, Xlib Programmer's Guide; XmuReadBitmapDataFrom-
File.
278 X Window System User's Guide
m Llst Wldget Resources
jr listres
Name
listres - list resources in widgets.
Syntax
listres [opti ons]
Description
Available as of Release 4, the listres program generates a list of a widget's resource database.
The class in which each resource is first defined, the instance and class name, and the type of
each resource is listed. If no specific widgets or the -all switch are given, a two-column list
of widget names and their class hierarchies is printed.
Options
listres accepts all
-all
of the standard X Toolkit command line options, along with the following:
Indicates that listres should print information for all known widgets and
objects.
-nosuper Indicates that resources that are inherited from a superclass should not be
listed. This is useful for determining which resources are new to a subclass.
-variable Indicates that widgets should be identified by the names of the class record
variables rather than the class name given in the variable. This is useful for
distinguishing subclasses that have the same class name as their superclasses.
-top name Specifies the name of the widget to be treated as the top of the hierarchy.
Case is not significant, and the name may match either the class variable
name or the class name. The default is core.
-format printf_string
Specifies the printf-style format string to be used to print out the name,
instance, class, and type of each resource.
See Also
X, xrdb; Volume Four, X Toolkit Intrinsics Programming Manual; Volume Five, X Toolkit
Intrinsics Reference Manual; appropriate widget documents
Bugs
On operating systems that do not support dynamic linking of run-time routines, this program
must have all of its known widgets compiled in. The sources provide several tools for automat-
ing this process for various widget sets.
Author
Jim Fulton, MIT X Consortium.
x Window System User's Guide 279
mkfontdir
Create fonts.dir Files m
Name
mkfontdir - creates afonts.dir file for each specified directory of font files.
Syntax
mkfontdir [directory-names]
Description
For each directory argument, mkfontdir reads all of the font files in the directory and searches
for properties named "FONT", or (failing that) the name of the file stripped of its suffix. These
are used as font names, which are written out to the filefonts.dir in the directory, along with the
name of the font file.
The kinds of font files read by mkfontdir depend on configuration parameters, but typically
include SNF (suffix .snf), compressed SNF (suffix .snf.Z), BDF (suffix .bdf), and compressed
BDF (suffix .bdf.Z). If a font exists in multiple formats, the most efficient format will be used.
Font Name Aliases
The file fonts.alias, which can be put in any directory of the font path, is used to map new
names to existing fonts, and should be edited by hand. The format is straight forward enough,
two white-space separated columns, the first containing aliases and the second containing font-
name patterns.
When a font alias is used, the name it references is searched for in the normal manner, looking
through each font directory in turn. This means that the aliases need not mention fonts in the
same directory as the alias file.
To embed white-space in either name, simply enclose them in double-quote marks. To embed
double-quote marks (or any other character), precede them with back-slash:
"magic-alias with spaces" '%"fontnameV' with quotes"
regular alias fontname
If the string FILE_NAMES_ALIASES stands alone on a line, each filename in the particular
directory (stripped of it's .snf suffix) will be used as an alias for that font.
Usage
Xserver looks for both fonts.dir and fonts.alias in each directory in the font path each time the
font path is set (see xset).
See Also
X, Xserver, xset
280 X Window System User's Guide
oclock (continued) Analog Clock
-noshape
Causes the clock not to reshape itself and ancestors to exactly fit the outline
of the clock.
Colors
Although the default colors for the Clock widget are black and white, the widget was designed
in color; unfortunately, the toolkit makes specifying these colors in a device-independent man-
ner difficult. If you want to see the correct colors, add the following lines to your resource file:
Clock*Background: grey
Clock*BorderColor: light blue
Clock*hour: yellow
Clock*jewel: yellow
Clock*minute: yellow
See Also
X; Volume Four, X Toolkit Intrinsics Programming Manual; Volume Five, X Toolkit Intrinsics
Reference Manual
Author
Keith Packard, MIT X Consortium.
282 X Window System User's Guide
resize (continued) Reset Terminal for Window Size
Bugs
There should be some global notion of display size; termcap and terminfo need to be rethought
in the context of window systems. (Fixed in 4.3BSD and Ultrix-32 1.2.)
Authors
Mark Vandevoorde (MIT-Athena), Edward Moy (Berkeley).
Copyright (c) 1984, 1985 by Massachusetts Institute of Technology.
See X for a complete copyright notice.
284 X Window System User's Guide
twm
Tab Window Manager
Name
twm - Tab Window Manager for the X Window System.
Syntax
twin [options]
Description
twm is a window manager for the X Window System. It has been made the official window
manager in the standard distribution in Release 4. twm provides titlebars, shaped windows,
several forms of icon management, user-defined macro functions, click-to-type and pointer-
driven keyboard focus, and user-specified key and pointer button bindings.
This program is usually started by the user's session manager or startup script. When used from
xdm or xinit without a session manager, twm is frequently executed in the foreground as the last
client. When run this way, exiting twm causes the session to be terminated (i.e., logged out).
By default, application windows are surrounded by a "frame" with a titlebar at the top and a
special border around the window. The titlebar contains the window's name, a rectangle that is
lit when the window is receiving keyboard input, and function boxes known as "titlebuttons"
at the left and right edges of the titlebar.
Pressing pointer Button1 (usually the left-most button unless it has been changed with xmod-
map) on a titlebutton will invoke the function associated with the button. In the default inter-
face, windows are iconified by clicking (pressing and then immediately releasing) the left
titlebutton (which looks like a small X). Conversely, windows are deiconified by clicking in
the associated icon or entry in the icon manager (see description of the variable ShowTcon-
Manager and of the function f. showiconmgr).
Windows are resized by pressing the right titlebutton (which resembles group of nested
squares), dragging the pointer over edge that is to be moved, and releasing the pointer when the
outline of the window is the desired size. Similarly, windows are moved by pressing in the title
or highlight region, dragging a window outline to the new location, and then releasing when the
outline is in the desired position. Just clicking in the title or highlight region raises the window
without moving it.
When new windows are created, twm will honor any size and location information requested by
the user (usually through -geomet ry command line argument or resources for the individual
applications). Otherwise, an outline of the window's default size, its titlebar, and lines dividing
the window into a 3x3 grid that track the pointer are displayed. Clicking pointer Buttonl will
position the window at the current position and give it the default size. Pressing pointer But-
ton2 (usually the middle pointer button) and dragging the outline will give the window its cur-
rent position but allow the sides to be resized as described above. Clicking pointer Button3
(usually the right pointer button) will give the window its current position but attempt to make
it long enough to touch the bottom the screen.
Options
twm accepts the following command line options:
286 X Window System User's Guide
Tab Window Manager (continued) twm
-f twmfile
-display host [ : server] [. screen]
Allows you to specify the host, server and screen to connect to. host speci-
fies the machine, server specifies the server number, and screen specifies
the screen number. For example,
twin -display your_node" O. 0
specifies screen 0 of server 0 on the machine your node. Either or both the
host and screen elements to the display specification can be omitted. If
host is omitted, the local machine is assumed. If screen is omitted, screen
0 is assumed (and the period is unnecessary). The colon and server are
necessary in all cases.
-s Indicates that only the default screen (as specified by -display or by the
DISPLAY environment variable) should be managed. By default, twm will
attempt to manage all screens on the display.
Specifies the name of the startup file to use. By default, twm will look in the
user's home directory for files named .twmrc.num (where hum is a screen
number) or .twmrc.
-v Indicates that twm should print error messages whenever an unexpected X
Error event is received. This can be useful when debugging applications but
can be distracting in regular use.
Customization
Much of twm's appearance and behavior can be controlled by providing a startup file in one of
the following locations (searched in order for each screen being managed when twm begins):
$HOME/.twmrc.screennumber
The screennumber is a small positive number (e.g. 0, 1, etc.) representing the
screen number (e.g. the last number in the DISPLAY environment variable
host:displaynum.screennum) that would be used to contact that screen of the
display. This is intended for displays with multiple screens of differing visual
types.
$HOME/.twmrc This is the usual name for an individual user's startup file.
/urlliblX111twrnlsystern.twrnrc
If neither of the preceding files are found, twm will look in this file for a
default configuration. This is often tailored by the site administrator to pro-
vide convenient menus or familiar bindings for novice users.
If no startup files are found, twm will use the built-in defaults described above. The only
resource used by twm is bitmapFilePath for a colon-separated list of directories to search
when looking for bitmap files. (For more information, see the Athena Widgets manual and
xrdb).
twm startup files are logically broken up into three types of specifications: variables, bindings,
and menus. The variables section must come first and is used to describe the fonts, colors, cur-
sors, border widths, icon and window placement, highlighting, autoraising, layout of titles,
|-
X Window System User's Guide 287
twrn (continued) Tab Window Manager
supplied, only those windows will be prevented from being squeezed.
ForceTcons Indicates that icon pixmaps specified in the Tcons variable should override
any client-supplied pixmaps.
F rameP adding pi xel s
Specifies the distance between the titlebar decorations (the button and text)
and the window frame. The default is 2 pixels.
IconBackground string [{ win list }]
Specifies the background color of icons, and may only be specified inside of a
Color or Monochrome list. The optional win_list is a list of window
names and colors so that per-window colors may be specified. See the
BorderColor variable for a complete description of the win list. The
--
default is white.
IconBorderColor string [{ win list }]
Specifies the color of the border used for icon windows, and may only be
specified inside of a Color or Monochrome list. The optional win_list
is a list of window names and colors so that per-window colors may be speci-
fied. See the BorderColor variable for a complete description of the
win lis t. The default is black.
--
I conBo rde rWidt h pixel s
Specifies the width in pixels of the border surrounding icon windows. The
default is 2.
IconDirectory string
Specifies the directory that should be searched if if a bitmap file cannot be
found in any of the directories in the bitmapFilePath resource.
IconFont string
Specifies the font to be used to display icon names within icons. The default
is 8x13.
IconForeground string [{ win list }]
Specifies the foreground color to be used when displaying icons, and may
only be specified inside of a Color or Monochrome list. The optional
win list is a list of window names and colors so that per-window colors
may be specified. See the BorderColor variable for a complete descrip-
tion of the win 1 i s t. The default is black.
IconifyByUnmapping [ { win_list } ]
Indicates that windows should be iconified by being unmapped without trying
to map any icons. This assumes that the user is will remap the window
through the icon manager, the f. warpto function, or the TwmWindows
menu. If the optional win list is provided, only those windows will be
--
iconified by simply unmapping. Windows that have both this and the Tcon-
ManagerDontShow options set may not be accessible if no binding to the
TwmWindows menu is set in the user's startup file.
292 X Window System User's Guide
Tab Window Manager (continued) twm
IconManagerBackground string [{ win_list }]
Specifies the background color to use for icon manager entries, and may only
be specified inside of a Color or Monochrome list. The optional
win_list is a list of window names and colors so that per-window colors
may be specified. See the BorderColor variable for a complete descrip-
tion of the win list. The default is white.
IconManagerDontShow [{ win_list }]
Indicates that the icon manager should not display any windows. If the
optional win_list is given, only those windows will not be displayed. This
variable is used to prevent windows that are rarely iconified (such as xcl ock
or xl oad) from taking up space in the icon manager.
IconManagerFont string
Specifies the font to be used when displaying icon manager entries. The
default is 8x 13.
IconManagerForeground string [{ win_list }]
Specifies the foreground color to be used when displaying icon manager
entries, and may only be specified inside of a Color or Monochrome list.
The optional win_list is a list of window names and colors so that per-
window colors may be specified. See the BorderColor variable for a com-
plete description of the win_list. The default is black.
IconManagerGeometry string [ col umns ]
Specifies the geometry of the icon manager window. The string argument
is standard geometry specification that indicates the initial full size of the
icon manager. The icon manager window is then broken into columns
pieces and scaled according to the number of entries in the icon manager.
Extra entries are wrapped to form additional rows. The default number of
columns is 1.
IconManagerHighlight string [{ win_list }]
Specifies the border color to be used when highlighting the icon manager
entry that currently has the focus, and can only be specified inside of a
Color or Monochrome list. The optional win_list is a list of window
names and colors so that per-window colors may be specified. See the
BorderColor variable for a complete description of the win_list. The
default is black.
IconManagers { iconmgr_list }
Specifies a list of icon managers to create. Each item in the i conmgr_list
has the following format:
"winname" ["iconname"] "geometry" columns
where winname is the name of the windows that should be put into this icon
manager, iconname is the name of that icon manager window's icon,
geometry is a standard geometry specification, and columns is the num-
ber of columns in this icon manager as described in
i-
X Window System User's Guide 293
twm (continued) Tab Window Manager
and constrains the move to be either horizontal or vertical depending on
which grid line is crossed. To abort a move, press another button before
releasing the first button.
f. next iconmgr
Warps the pointer to the next icon manager containing any windows on the
current or any succeeding screen.
f.nop Does nothing and is typically used with the DefaultFunction or
WindowFunction variables or to introduce blank lines in menus.
f. p revic onmgr
Warps the pointer to the previous icon manager containing any windows on
the current or preceding screens.
f. quit Causes twm to restore the window's borders and exit. If twm is the first client
invoked from xdm, this will result in a server reset.
f. raise Raises the selected window.
f. raiselower
Raises the selected window to the top of the stacking order if it is occluded
by any windows, otherwise the window will be lowered.
f. refresh Causes all windows to be refreshed.
f. resize Displays an outline of the selected window. Crossing a border (or setting
AutoRelativeResize) will cause the outline to begin to rubber band
until the invoking button is released. To abort a resize, press another button
before releasing the first button.
f. restart Kills and restarts twm.
f. righticonmgr
Similar to f. nexticonmgr, except that wrapping does not change rows.
f. rightzoom Similar to the f. bottomzoom function, except that the selected window is
only resized to the right half of the display.
f. saveyourself
Sends a %VM_SAVEYOURSELF message to the selected window if it has
requested the message in its %VM_PROTOCOLS window property. Clients
that accept this message are supposed to checkpoint all state associated with
the window and update the %VM_COMMAND property as specified in the
ICCCM. If the selected window has not selected for this message, the key-
board bell will be rung.
f. showiconmgr
Maps the current icon manager.
f. sort iconrngr
Sorts the entries in the current icon manager alphabetically. See the variable
Sort IconManager.
304 X Window System User's Guide
uwm
X Window Manager--
Name
uwm - a window manager for X.
Syntax
uwm [options]
Description
The uwm program is a window manager client application of the window server. In releases
prior to 4, uwm is the standard X window manager. As of Release 4, uwm has been moved to
the user-contributed pan of the distribution and replaced in the standard distribution by twm.
When uwm is invoked, it searches a predefined search path to locate any uwm startup files. If
no startup files exist, uwm initializes its built-in defaults.
If startup files exist in any of the following locations, it adds the variables to the default vari-
ables. In the case of contention, the variables in the last file found override previous specifica-
tions. Files in the uwm search path are:
lusrllib/X11 luwrrdsystern, uwmrc
$ H O M E/.uwmrc
To use only the settings defined in a single startup file, include the variables, resetbind-
ings, resetmenus, resetvariables at the top of that specific smnup file.
Options
-f filename Names an alternate file as a uwm startup file.
-display [host] : server[, screen]
Allows you to specify the host, server, and screen on which to run the window
manager, host specifies the machine, server specifies the server number,
and screen specifies the screen number. For example,
uwm -display your_node: O. 1
specifies screen 1 on server 0 on the machine your_node. If the host is
omitted, the local machine is assumed. If the screen is omitted, the screen 0
is assumed; the server and colon (:) are necessary in all cases.
Startup File Variables
Variables are typically entered first, at the top of the startup file. By convention, resetbind-
ings, resetmenus, and resetvariables head the list.
autoselect/noautoselect
Places the menu cursor in first menu item. If unspecified, the menu cursor is
placed in the menu header when the menu is displayed.
background=color
Specifies the default background color for popup sizing windows, menus, and
icons. The default is to use the WhitePixel for the current screen.
308 X Window System User's Guide
X Window Manager (continued) uwm
bordercolor=color
Specifies the default border color for popup sizing windows, menus, and
icons. The default is to use the BlackPixo'l for the current screen.
bo rde rwidt h=pixel s
Specifies the default width in pixels for borders surrounding icons.
de it a=pixel s
Indicates the number of pixels the cursor is moved before the action is inter-
preted by the window manager as a command. (Also refer to the delta
mouse action.)
foreground=color
Specifies the default foreground color for popup sizing windows, menus, and
icons. The default is to use the BlackPixel for the current screen.
freeze/no freeze
Locks all other client applications out of the server during certain window
manager tasks, such as move and resize.
grid/nogrid Displays a finely-ruled grid to help you position an icon or window during
resize or move operations.
hiconpad=pixel s
Indicates the number of pixels to pad an icon horizontally. The default is five
pixels.
hmenupad=pixel s
Indicates the number of pixels to pad each menu item to the left and right of
the text.
iconfont=fon tname
Names the font that is displayed within icons. Font names for a given server
can be obtained using xlsfonts.
maxcolors=n Limits the number of colors the window manager can use in a given invoca-
tion. If set to zero, or not specified, uwm assumes no limit to the number of
colors it can take from the color map. maxcolors counts colors as they are
included in the file.
mborderwidth=pixel s
Indicates the width in pixels of the border surrounding menus.
norma li/nono rma li
Places icons created with f. newiconify within the root window, even if
they are placed partially off the screen. With nonormali the icon is placed
exactly where the cursor leaves it.
no rma lw/nono rma lw
Places window created with f. newiconify within the root window, even
if they are placed partially off the screen. With nonormalw the window is
placed exactly where the cursor leaves it.
X Window System User's Guide 309
uwm (continued) X Window Manager
volume=n
push=n Moves a window n number of pixels or a l/n times the size of the window,
depending on whether pushabsolute or pushrelative is specified.
Use this variable in conjunction with f.pushup, f.pushdown,
f. pushright, or f. pushleft.
pushabsolute/pushrelative
pushabsolute indicates that the number entered with push is equivalent to
pixels. When an f .push (left, right, up, or down) function is called, the
window is moved exactly that number of pixels.
pushrelative indicates that the number entered with the push variable
represents a relative number. When an f. push function is called, the win-
dow is invisibly divided into the number of pans you entered with the push
variable, and the window is moved one pan.
resetbindings, resetmenus, resetvariables
Resets all previous function bindings, menus, and variables entries, specified
in any startup file in the uwm search path, including those in the default envi-
ronment. By convention, these variables are entered first in the startup file.
re s i ze font =fon tname
Identifies the font of the indicator that displays in the comer of the window as
you resize windows. See xlsfonts for obtaining font names.
resizerelat ive/noresizerelative
Indicates whether or not resize operations should be done relative to a mov-
ing edge or edges. By default, the dynamic rectangle uses the actual pointer
location to define the new size. (Available as of Release 3.)
reverse / noreve rse
Defines the display as black characters on a white background for the window
manager windows and icons.
viconpad=pixel s
Indicates the number of pixels to pad an icon vertically. Default is five pix-
els.
vme nupad=pi xel s
Indicates the number of pixels to pad each menu item vertically (i.e., above
and below the text).
Increases or decreases the base level volume set by the xset(1) command.
Enter an integer from 0 to 7, 7 being the loudest.
zap/nozap Causes ghost lines to follow the window or icon from its previous default
location to its new location during a move or resize operation.
Binding Syntax
function=[control key (s) ] : [context] : mouse events : "menu name"
Function and mouse events are required input. Menu name is required with the f. menu func-
tion definition only.
310 X Window System User's Guide
X Window Manager (continued) uwm
Function
f. beep Emits a beep from the keyboard. Loudness is determined by the volume vari-
able.
f. circledown
Causes the top window that is obscuring another window to drop to the bot-
tom of the stack of windows.
f. circleup Exposes the lowest window that is obscured by other windows.
f. continue Releases the window server display action after you stop action with the
f. pause function.
f. focus Directs all keyboard input to the selected window. To reset the focus to all
windows, invoke f. focus from the root window.
f. iconify When implemented from a window, this function converts the window to its
respective icon. When implemented from an icon, f. iconify converts the
icon to its respective window.
f. kill Kills the client that created a window.
f. lower Lowers a window that is obstructing a window below it.
f. menu Invokes a menu. Enclose 'menu name' in quotes if it contains blank charac-
ters or parentheses.
f. move Moves a window or icon to a new location, which becomes the default loca-
tion.
f. moveopaque
Moves a window or icon to a new screen location. When using this function,
the entire window or icon is moved to the new screen location. The grid
effect is not used with this function.
f. newiconify
Allows you to create a window or icon and then position the window or icon
in a new default location on the screen.
f. pause Temporarily stops all display action. To release the screen and immediately
update all windows, use the f. continue function.
f. pushdown Moves a window down. The distance of the push is determined by the push
variables.
f .pushleft Moves a window to the left. The distance of the push is determined by the
push variables.
f. pushright Moves a window to the right. The distance of the push is determined by the
push variables.
f. pushup Moves a window up. The distance of the push is determined by the push vari-
ables.
X Window System User's Guide 311
uwm (continued) X Window Manager
co1 or4
color5
color6
Background color of the highlighter.
Foreground color for the individual menu item.
Background color for the individual menu item.
Color Defaults
Colors default to the colors of the root window under any of the following conditions:
If you run out of color map entries, either before or during an invocation of uwm. If you spec-
ify a foreground or background color that does not exist in the RGB color database of the
server (see/usrllib/X111rgb.txt for a sample) both the foreground and background colors default
to the root window colors. If you omit a foreground or background color, both the foreground
and background colors default to the root window colors. If the total number of colors speci-
fied in the startup file exceeds the number specified in the maxcolors variable. If you specify
no colors in the startup file.
Sample .mwmrc File
The following sample startup file shows the use of window manager options:
# Global variables
#
resetbindings;resetvariables;resetmenus
autoselect
delta=25
freeze
grid
hiconpad=5
hmenupad=6
iconfont=oldeng
menufont=timroml2b
resizefont=9xl5
viconpad=5
vmenupad=3
volume=7
#
# Mouse button/key maps
#
#FUNCTION KEYS
#
f.menu = meta
f.menu = meta
f.move = meta
f.circleup = meta
#
# Menu specifications
#
menu = "WINDOW OPS" {
"(De)Iconify":
Move:
CONTEXT BUTTON
:wli
:root
:left down
:middle down
:right down
:right down
f.iconify
f.move
MENU (if any)
: "WINDOW OPS"
:"EXTENDED WINDOW OPS"
314 X Window System User's Guide
X Window Manager (continued) uwm
Resize:
Lower:
Raise:
}
f.resize
f.lower
f.raise
menu = "EXTENDED WINDOW OPS" {
Create Window:
Iconify at New Position:
Focus Keyboard on Window:
Freeze All Windows:
Unfreeze All Windows:
Circulate Windows Up:
Circulate Windows Down:
)
!"xterm &"
f.lowericonify
f.focus
f.pause
f.continue
f.circleup
f.circledown
Restrictions
The color specifications have no effect on a monochrome system.
Files
lusrlliblX111uwmlsystem.uwmrc
$HOME/.uwmrc
See Also
X, Xserver, xset, xlsfonts
Copyright
Copyright 1985, 1986, 1987, 1988 Digital Equipment Corporation, Maynard, MA.
Author
M. Gancarz, DEC Ultrix Engineering Group, Merrimack, New Hampshire, using some algo-
rithms originally by Bob Scheifler, MIT Laboratory for Computer Science.
i-
X Window System User's Guide 315
Protocol Converter (continued) xl Otoxl I
variable DISPLAY set to your_node : 1 (but they should still work even if
your X10 clients use your_node : 1.0).
MinimumTileSize=n
Sets minimum acceptable tile size to n. There is a difference in semantics
between X10's XQueryShape and Xll's XQueryBestSize such that
Xll will allow any tile size but will return the optimum whereas X10
enforced a minimum tile size. Usually this minimum tile size was 16 and this
is the default for xlOtoxll. If you find that this makes your X10 clients break,
then you can override it with this option.
help Prints out a usage message and exits.
NoOve r rideRedi rect
Insucts xlOtoxll to make every effort not to use OverrideRedirect
when creating and mapping windows. Normally, xlOtoxll creates all win-
dows with the OverrideRedirect attribute set to true. Placing this
option on the command line will cause xlOtoxll not to use Override-
Redirect except for windows that look like they might be menus. This
will allow window managers that provide titlebars to do so. Unfortunately, it
is impossible to determine ahead of time what an X10 client intends to do
with windows. In addition, X10 clients are known to spontaneously unmap
their windows which upsets Xll window managers unless the Override-
Redirect attribute is true. Further, some Xll window managers may
refuse to resize or move windows that are marked with Override-
Redirect. This may be fixed to some extent when an Inter Client Commu-
nications Convention Manual (ICCCM) is adopted by the X 11 community.
See Also
X, Xserver
Bugs
There are limitations with respect to emulating Version 10 through a Version 11 server. See the
file/usr/lib/X/xlOtoxl l.help for more details.
Some window managers may refuse to move, resize, or perform any operations on X10 client
windows.
If the source is compiled with certain flags, there are significant debugging facilities available.
Using the help option will tell you whether debugging facilities are available, xlOtoxll
marks them with OverrideRedirect. See "Options" above.
Copyright
Cop)right 1988, Tektronix Inc.
io
X Window System User's Guide 317
xl Otoxl I (continued) Protocol Converter
Permission to use, copy, modify, and distribute this software and its documentation for any pur-
pose and without fee is hereby granted, provided that the above copyright notice appear in all
copies and that both that copyright notice and this permission notice appear in supporting
documentation.
Author
Todd Brunhoff, Visual Systems Laboratory, Tektronix.
318 X Window System User's Guide
Authority File Utility
f xauth
Name
xauth - X authority file utility
Syntax
xauth [options] [command arguments]
Description
Available as of Release 4, the xauth program is used to edit and display the authorization infor-
mation used in connecting to the X server. This program is usually to extract authorization
records from one machine and merge them in on another (as is the case when using remote
logins or to grant access to other users). Commands (described below) may be entered interac-
tively, on the xauth command line, or in scripts. Note that this program does not contact the X
server.
Options
The following options may be used with xauth. They may be given individually (for example,
-q -5.) or may combined (for example, -qs.):
-f authfile
Specifies the name of the authority file to use. By default, xauth will use the
file specified by the XAUTHORITY environment variable or .Xauthority in
the user's home directory.
-q
-v
-i
Indicates that xauth should operate quietly and not print unsolicited status
messages. This is the default if an xauth command is is given on the com-
mand line or if the standard output is not directed to a terminal.
Indicates that xauth should operate verbosely and print status messages indi-
cating the results of various operations (for example, how many records have
been read in or written out). This is the default if xauth is reading commands
from its standard input and its standard output is directed to a terminal.
Indicates that xauth should ignore any authority file locks. Normally, xauth
will refuse to read or edit any authority files that have been locked by other
programs (usually xdm or another xauth).
-b
Indicates that xauth should attempt to break any authority file locks before
proceeding and should only be used to clean up stale locks.
Commands
The following commands may be used to manipulate authority files:
add displayname protocolname hexkey
An authorization entry for the indicated display using the given protocol and
key data is added to the authorization file. The data is specified as an even-
lengthed string of hexadecimal digits, each pair representing one octet. The
first digit gives the most significant 4 bits of the octet and the second digit
gives the least significant 4 bits. A protocol name consisting of just a single
period is treated as an abbreviation for MIT-MAGIC-COOKIE-1.
X Window System User's Guide 319
Mail Notification (continued) xblff
sot: ( ) Causes the widget to raise the flag until user resets it.
The default translation is:
<ButtonPress> : unset ( )
See Also
X, xrdb, stat(2)
Author
Jim Fulton, MIT X Consortium;
Additional hacks by Ralph Swick, DEC/MIT Project Athena.
X Window System User's Guide 325
xclipboard
X Clipboard Client--
Name
xclipboard - X clipboard client.
Syntax
xclipboard [options]
Description
The xclipboard program is used to collect and display text selections that are sent to the CLIP-
BOARD by other clients. It is typically used to save CLIPBOARD selections for later use.
Since xclipboard uses a Text Widget to display the contents of the clipboard, text sent to the
CLIPBOARD may be re-selected for use in other applications.
Release 4 Specifics
The Release 4 version of xclipboard stores each CLIPBOARD selection as a separate string,
each of which can be selected. Each time CLIPBOARD is asserted by another application, xclip-
board transfers the contents of that selection to a new buffer and displays it in the text window.
Buffers are never automatically deleted, so you'll want to use the delete button to get rid of
useless items.
xclipboard also responds to requests for the CLIPBOARD selection from other clients by send-
ing the entire contents of the currently displayed buffer.
An xclipboard window has the following buttons across the top:
quit When this button is pressed, xclipboard exits.
delete When this button is pressed, the current buffer is deleted and the next one
displayed.
new Creates a new buffer with no contents. Useful in constructing a new CLIP-
BOARD selection by hand. ,
next Displays the next buffer in the list.
previous Displays the previous buffer.
Release 3 Specifics
The Release 3 version of xclipboard has the following buttons across the top:
quit When this button is pressed, xclipboard exits.
erase When this button is pressed, the contents of the text window are erased. (The
erase button is not functional.)
Options
The xclipboard program accepts all of the standard X Toolkit command line options as well as
the following:
-w Indicates that lines of text that are too long to be displayed on one line in the
clipboard should wrap around to the following lines.
-nw Indicates that long lines of text should not wrap around. This is the default
behavior.
334 X Window System User's Guide
--Analog/Digital Clock
jr xclock
Name
xclock - continuously display the time in either analog or digital form.
Syntax
xclock [options]
Description
xclock continuously displays the time of day, either in digital or analog form. In digital form,
xclock displays the time using a 24-hour clock. It also displays the day, month, and year. In
analog form, xclock displays a standard 12-hour clock face. You can set up more than one
clock simultaneously.
The default clock is an analog clock with a black foreground on a white background. If you
want to change the clock's appearance, type in the appropriate options. For example,
xclock -bd slateblue -fg navyblue -hl darkslategrey &
sets up a conventional 12-hour clock with a slate blue window border, navy blue tick marks,
and dark slate grey hands.
By default, the clock is positioned in the upper-left comer of your background window. If you
are running twm, you can place the clock using the pointer.
Options
xclock accepts all of the standard X Toolkit command line options along with the additional
options listed below:
-he lp Displays a brief summary of xclock's calling syntax and options.
-analog Draws a conventional 12-hour clock face with tick marks for each minute and
stroke marks for each hour. This is the default.
-digital or -d
Displays the date and time in digital format. Note that -display must be
used to specify a display.
-chime Indicates that the clock should chime once on the half hour and twice on the
hour.
-hal col or Specifies the color of the hands on an analog clock. The default is black.
-hl col or Specifies the color of the edges of the hands on an analog clock. Only useful
on color displays. The default is black.
-padding pixels
Specifies the width in pixels of the space between the window border and any
portion of the xclock display. The default is 10 pixels in digital mode and 8
pixels in analog mode.
-update seconds
Specifies the frequency in seconds with which xclock updates its display. If
the xclock window is obscured and then exposed, xclock overrides this setting
X Window System User's Guide 337
xclock (continued) Analog/Digital Clock
and redisplays immediately. A value of less than 30 seconds will enable a
second hand on an analog clock. The default is 60 seconds.
The following standard X Toolkit options are commonly used with xclock:
-bg col or Determines the background color of the window. The default is white.
-bd co2 or Determines the border color of the window. The default is black.
-bw pixels Specifies the width in pixels of the border around the xclock window. The
default is 2 pixels.
-fg col or Determines the color of the text in digital mode, and the color of the tick and
stroke marks in analog mode. The default is black.
-fn font Specifies the font to be used in digital mode. Any fixed width font may be
used. The default is 6x 10.
-rv Indicates that reverse video should be simulated by swapping the foreground
and background colors.
-geometry geometry
Sets xclock window size and location according to the geometry specifica-
tion. The -geometry option can be (and often is) abbreviated to -g, unless
there is a conflicting option that begins with "g." The argument to the geom-
etry option (geometry) is referred to as a "standard geometry string," and
has the form wi dt hxh ei gh t+_xof f-l_yof f.
In digital mode, height and width are determined by the font in use, unless
otherwise specified. In analog mode, width and height defaults are 164 pix-
els, unless otherwise specified. The default value for any unspecified x or y
offset is -0. All values are in pixels. If you do not specify the geometry,
xclock asks you for window window.
-display [host] : server[, screen]
Allows you to specify the host, server and screen on which to create the
xclock window, host specifies which machine to create the xclock window
on, server specifies the server number and screen specifies the screen
number. For example,
x:lock -display your_node: O. I
creates an xclock display on screen 1 on server 0 on the machine
your_node. If the host is omitted, the local machine is assumed. If the
screen is omitted, the screen 0 is assumed; the server and colon (:) are neces-
sary in all cases.
Note that -display cannot be abbreviated to -d, which is shorthand for the
-digital option.
-xrm resourcestring
Specifies a resource string to be used. This is especially useful for setting
resources that do not have separate command line options.
338 X Window System User's Guide
Analog/Digital Clock (continued) xclock
Resources
xclock uses the Athena Clock widgeL It understands all of the core resource names and classes
as well as:
width (class Width)
Specifies the width of the clock.
height (class Height)
Specifies the height of the clock.
update (class Interval)
Specifies the frequency in seconds at which the time should be redisplayed.
background (class Background)
Determines the background color. The default is white.
fo reground (class FO reground)
Specifies the color for the tick marks and stroke marks. Using the class speci-
fies the color for all things that normally would appear in the foreground
color. The default is black since the core default for background is white.
hands (class Foreground)
Specifies the color of the insides of the clock's hands. The default is the
fo reground color.
highlight (class Foreground)
Specifies the color used to highlight the clock's hands. The default is the
foreground color.
analog (class Boolean)
Specifies whether or not an analog clock should be used instead of a digital
one. The default is true.
chime (class Boolean)
Specifies whether or not a bell should be rung on the hour and half hour. The
default is false.
padding (class Margin)
Specifies the amount of internal padding in pixels to be used. The default is
8.
font (class Font)
Specifies the font to be used for the digital clock. Note that variable width
fonts currently will not always display correctly.
reve rseVideo (class Reve rseVideo)
Specifies that the foreground and background colors should be reversed.
Widgets (Release 4)
In order to specify resources, it is useful to know the hierarchy of the widgets which compose
xclock. In the notation below, indentation indicates hierarchical structure. The widget class
name is given first, followed by the widget instance name.
X Window System User's Guide 339
xclock (continued) Analog/Digital Clock
XCIock xclock
Clock clock
Flies
/usrllib/Xl 1/app-defaults/XClock
Specifies default resources (as of Release 4).
Bugs
xclock believes the system clock.
When in digital mode, the string should be centered automatically.
No way to exit the program.
See Also
X, oclock, xrdb, time(3C), Athena Clock widget
Authors
Tony Della Fera (MIT-Athena, DEC);
Dave Mankins (MIT-Athena, BBN);
Ed Moy (UC Berkeley).
340 X Window System User's Guide
Cut Buffer/Selection Interchange (continued) xcutsel
See Also
X, xclipboard, xtcrrn; Chapter 4 of this guide; text widget documentation, including Volume
Four, X Toolkit Intrinsics Programming Manual
Author
Ralph R. Swick, DEC/MIT Project Athena.
X Window S.vstem User's Guide 343
xditvlew (continued) Display ditroff Files
Authors
Portions of this program originated in xtroff which was derived from suntroff.
Keith Packard (MIT X Consortium);
Richard L. Hyde (Purdue);
David Slattengren (Berkeley);
Malcom Slaney (Schlumberger Palo Alto Research);
Mark Moraes (University of Toronto).
346 X Window System User's Guide
xdm (continued) X Display Manager
ments to the terminal; it also disables the DisplayManager .daemon-
Mode resource, forcing xdm to run synchronously. To interpret these debug-
ging messages, a copy of the source code for xdm is almost a necessity. No
attempt has been made to rationalize or standardize the output.
-error error_log_file
Spifies the value for the DisplayManager. errorLogFile resource.
This file contains errors from xdm as well as anything written to standard
error by the various scripts and programs run during the progress of the
session.
-nodaemon Specifies "false" as the value for the DisplayManager.daemonMode
resource.
-resources resource file
Specifies the value for the DisplayManager*resources resource. This
file is loaded using xrdb to specify configuration parameters for the authenti-
cation widget.
-server server_entry
Specifies the value for the DisplayManager. servers resource. (See
"Resources" below.)
-udpPort port_number
Specifies the value for the DisplayManager. requestPort resource.
This sets the port-number which XDM will monitor for XDMCP requests. As
XDMCP uses the registered well-known udp port 177, this resource should
probably not be changed except for debugging. (Available as of Release 4.)
-ses s ion sessi on_program
Spifies the value for the DisplayManager*session resource. This
indicates the program to run when the user has logged in as the session.
(Available as of Release 4.)
-xrm resource_specifi cati on
Allows an arbitrary resource to be specified, just as most toolkit applications.
Resources
At many stages the actions of xdm can be controlled through the use of the configuration file,
which is in the familiar X resource format. See Jim Fulton's article on resource files
(doc/tutorials/resources.txt) for a description of the format. Some resources modify the behav-
ior of xdm on all displays, while others modify its behavior on a single display. Where actions
relate to a specific display, the display name is inserted into the resource name between
"DisplayManager" and the final resource name segment. For example, Display-
Manager. expo_0, startup is the name of the resource that defines the startup shell file on
the "expo:0" display. Because the resource manager uses colons to separate the name of the
resource from its value and dots to separate resource name parts, xdm substitutes underscores
348 X Window System User's Guide
X Display Manager (contihued) xdm
scores for the dots and colons when generating the resource name. (If you are running Release
3, DisplayManager.expo. 0. startup is the resource. In Release 3, xdm substitutes
dots for the colons when generating the resource name.)
DisplayManager. servers
Specifies either a filename full of server entries, one per line, or a single
server entry. Each entry indicates a display that should constantly be man-
aged and that is not using XDMCP. (If the resource value begins with a slash,
it is assumed to be the name of a file containing the list.) Each entry consists
of at least three parts: a display name, a display class (Release 4 only), a dis-
play type, and (for local servers) a command line to start the server. (The pro-
gram name should be an absolute UNIX pathname, since xdm does not search
through the directories of the PATH environment variable.) Foreign servers
can have a comment in place of the command line. A typical entry for local
display number 0 would be:
:0 Digital-QV local /usr/bin/Xll/X :0
The display types are:
local
foreign
A local display, i.e., one that has a server program to run
A remote display, i.e., one that has no server program to run
If you're running the Release 3 version of xdm, the following display types
are also acceptable:
localTransient A locai display that has only one session run
t ransient A remote display that has only one session run
The display name must be something that can be passed in the -display
option to any X program. This string is used in the display-specific resources
to specify the particular display, so be careful to match the names (e.g., use
:0 local /usr/bin/Xll/X :0 instead of localhost:O local
/usr/bin/Xll/X : 0 if your other resources are specified as Display-
Manager. O.session).
The display class portion can also be used in display-specific resources, as the
class portion of the resource. This is useful if you have a large collection of
similar displays (perhaps several X terminals) and would like to set resources
for groups of them. When using XDMCP, the display is required to specify
the display class. Your X terminal documentation should describe a reason-
ably standard display class string for your device.
DisplayManager. requestPort
Indicates the UDP port number which xdm uses to listen for incoming
XDMCP requests. Unless you need to debug the system, leave this with its
default value of 177. (Available as of Release 4.)
X Window System User's Guide 349
X Display Manager (continued) xdm
xlogin. Login. foreground
The color used to display the typed-in user name.
xlogin. Login. font
The font used to display the typed-in user name.
xlogin. Login. greeting
A string which identifies this window. The default is "Welcome to the X
Window System".
xlogin. Login. unsecureGreeting
When X authorization is requested in the configuration file for this display
and none is in use, this greeting replaces the standard greeting. Its default
value is "This is an unsecure session". (Available as of Release 4.)
xlogin. Login. greetFont
The font used to display the greeting.
xlogin. Login. greetColor
The color used to display the greeting.
xlogin. Login. namePrompt
The string displayed to prompt for a user name. xrdb strips trailing white
space from resource values, so to add spaces at the end of the prompt (usually
a nice thing), add spaces escaped with backslashes. (In Release 3, Control-A
should work.) The default is "Login:".
xlogin. Login. passwdPrompt
The string displayed to prompt for a password. The default is "Pass-
word:".
xlogin. Login. promptFont
The font used to display both prompts.
xlogin. Login. promptColor
The color used to display both prompts.
xlogin. Login. fail
A message which is displayed when the authentication fails. The default is
"Login Failed, please try again".
xlogin. Login. failFont
The font used to display the failure message.
xlogin. Login. failColor
The color used to display the failure message.
xlogin. Login. failTimeout
The time (in seconds) that the fail message is displayed. The default is 30
seconds.
X Window System User's Guide 355
X Display Manager (continued) xdm
restart-session
insert-char
set-session-argument
allow -all-access
Resets the X server and starts a new session. This can be
used when the resources have been changed and you want
to test them, or when the screen has been overwritten with
system messages.
Inserts the character typed.
Specifies a single word argument which is passed to the
session at startup. See 'I'he Xsession File" and 'I'ypical
Usage" below.
Disables access control in the server, this can be used when
the .Xauthority file cannot be created by xdm. Be very
careful when using this; it might be better to disconnect the
machine from the network first. (Available as of Release 4.)
The Xstartup File
This file is typically a shell script. It is run as "root" and should be very careful about security.
This is the place to put commands which make fake entries in/etc/utmp, mount users' home
directories from file servers, display the message of the day, or abort the session if logins arc
not allowed. Various environment variables arc set for the use of this script:
DISPLAY is set to the associated display name.
HOME is set to the home directory of the user.
USER is set to the user name.
PATH is set to the value of DisplayManager. DISPLAY. systemPath.
SHELL is set to the value of DisplayManager. DISPLAY. systemShell.
XAUTHOR1TY may be set to a non-standard authority file (Release 4).
No arguments of any kind are passed to the script, xdm waits until this script exits before start-
ing the user session. If the exit value of this script is non-zero, xdm discontinues the session
immediately and starts another authentication cycle.
The Xsession File
This is the script that is run as the user's session. It is run with the permissions of the author-
ized user, and has several environment variables specified:
DISPLAY
HOME
USER
PATH
SHELL
XAUTHOR1TY
is set to
is set to
is set to
is set to
the associated display name.
the home directory of the user.
the user name.
the value of DisplayManager. DISPLAY. userPath.
is set to the user's default shell (from/etclpasswd).
may be set to a non-standard authority file (Release 4).
X Window System User's Guide 357
xdm (continued) X Display Manager
fi
exit 0
The most interesting script is Xsession. This version recognizes the special "failsafe" mode,
specified in the translations in the Xresources file above, to provide an escape from the ordinary
session:
# !/bin/sh
#
# Xsession
#
This is the program that is run as the client
for the display manager. This example is
quite friendly as it attempts to run a per-user
.xsession file instead of forcing a particular
session layout
case $# in
i)
case $i in
failsafe)
exec xterm -geometry 80x24-0-0 -is
;;
esac
esac
startup=$HOME/.xsession
resources=$HOME/.Xresources
check for a user-specific session and execute it
Note: the -x flag to test is not supported in all versions of
unix, check with local authorities before proceeding...
if [ -f $startup ]; then
if [ -x $startup ]; then
exec $startup
else
exec /bin/sh $startup
fi
else
#
# a simple default session. Check to see
# if the user has created a default resource file
360 X Window System User's Guide
Dump Window Directly to Printer (continued) xdpr
prints a dump of an X window from screen 1 of server 0 on the machine
your__node. If the host is omitted, the local machine is assumed. If the
screen is omitted, screen 0 is assumed; the server and colon (:) are necessary
in all cases.
Any other arguments will be passed to the xwd, xpr, and lpr(1) commands as appropriate for
each.
Environment Variables
PRINTER Specifies which printer to use by default.
See Also
X, xwd, xpr, xwud, lpr(1)
Authors
Paul Boutin, MIT Project Athena;
Michael R. Gretzinger, MIT Project Athena;
Jim Gettys, MIT Project Athena.
X Window System User's Guide 363
xdpyinfo (continued) Display Information Utility
red, green, blue masks: 0x7, 0x38, 0xc0
significant bits in color specification:
visual:
visual id: 0x8006a
class: TrueColor
depth: 8 planes
size of colormap: 8 entries
red, green, blue masks: 0x7, 0x38, 0xc0
significant bits in color specification:
number of mono multibuffer types:
visual id, max buffers, depth:
visual id, max buffers, depth:
visual id, max buffers, depth:
visual id, max buffers, depth:
visual id, max buffers, depth:
visual id, max buffers, depth:
number of stereo multibuffer types:
screen #i:
8 bits
8 bits
6
0x80065, 0, 8
0x80066, 0, 8
0x80067, 0, 8
0x80068, 0, 8
0x80069, 0, 8
0x8006a, 0, 8
0
ButtonReleaseMask
SubstructureRedirectMask
i152x900 pixels (325x254 millimeters)
1 bits
0x80064, 0, 1
0
dimensions:
resolution: 90x90 dots per inch
depths (i): 1
root window id: 0x80070
depth of root window: 1 plane
number of colormaps: minimum i, maximum 1
default colormap: 0x8006c
default number of colormap cells: 2
preallocated pixels: black i, white 0
options: backing-store YES, save-unders YES
current input event mask: 0xd0801d
KeyPressMask ButtonPressMask
EnterWindowMask ExposureMask
PropertyChangeMask ColormapChangeMask
number of visuals: 1
default visual id: 0x80064
visual:
visual id: 0x80064
class: StaticGray
depth: 1 plane
size of colormap: 2 entries
red, green, blue masks: 0x0, 0x0, 0x0
significant bits in color specification:
number of mono multibuffer types: 1
visual id, max buffers, depth:
number of stereo multibuffer types:
366 X Window System User's Guide
xd pyi nfo (continued) Display Information Utility
current input event mask: OxO
number of visuals: 1
default visual id: 0x80066
visual:
visual id: 0x80066
class: PseudoColor
depth: 8 planes
size of colormap: 256 entries
red, green, blue masks: OxO, OxO, OxO
significant bits in color specification:
8 bits
See Also
X, xwininfo, xprop, xrdb
Bugs in Release 3
Due to a bug in the Xlib interface, there is no portable way to determine the depths of pixmap
images that are supported by the server.
Author
Jim Fulton, MIT X Consortium.
368 X Window System User's Guide
--Text Editor for X / xedit
Name
xedit - simple text editor for X.
Syntax
xedit [ opt i on s] [ fi I ename]
Description of the Release 4 Client
The Release 4 version of xedit provides a window consisting of the following four areas:
Commands Section
A set of commands that allow you to exit xedit, save the file, or load a new
file into the edit window.
Message Window
Displays xedit messages. In addition, this window can be used as a scratch
pad.
Filename Display
Displays the name of the file currently being edited, and whether this file is
Read - Write or Read Only.
Edit Window Displays the text of the file that you are editing or creating.
Editing (Release 4)
The Athena Text widget is used for the three sections of this application that allow text input.
The characters typed will go to the Text widget that the pointer cursor is currently over. If the
pointer cursor is not over a text widget then the keypresses will have no effect on the applica-
tion. This is also true for the special key sequences that popup dialog widgets, so typing Con-
trol-S in the filename widget will enable searching in that widget, not the edit widget.
Both the message window and the edit window will create a scrollbar if the text to display is
too large to fit in that window. Horizontal scrolling is not allowed by default, but can be turned
on through the Text widget's resources, see Athena Widget set documentation for the exact
resource definition.
Commends (Release 4)
Quit Quits the current editing session. If any changes have not been saved, xedit
displays a warning message, allowing the user to save the file.
Save If file backups are enabled (see "Resources") xedit stores a copy of the origi-
nal, unedited file in <prefix>file<suffix>, then overwrites the file with the
contents of the edit window. The filename is retrieved from the Text widget
directly to the right of the Load button.
Load Loads the file named in the text widget immediately to the right of the this
button and displays it in the Edit Window. If the currently displayed file has
been modified a warning message will ask the user to save the changes, or
press Load again.
Description of the Release 3 Client
The Release 3 version of xedit provides a window consisting of the following three areas:
X Window System User's Guide 369
xf d (continued) Font Displayer
ground. This permits determining exactly how XDrawImageString will draw any given
character. If -gray has not been supplied, the characters will simply be drawn using the fore-
ground color on the background color.
All the characters in the font may not fit in the window at once. To see additional characters,
click the right mouse button on the window. This will cause the next window full of characters
to be displayed. Clicking the left mouse button on the window will cause the previous window
full of characters to be displayed, xfd will beep if an attempt is made to go back past the 0th
character.
Note that if the font is a 8 bit font, the characters 256-511 (0xl00-0xlff in hexidecimal),
512-767 (0x200-0x2f0, etc., will display exacdy the same as the characters 0-255 (0x00-0xf0.
xfd by default creates a window big enough to display the first 256 characters using a 16 by 16
grid. In this case, there is no need to scroll forward or backward window fulls in order to see
the entire contents of a 8 bit font. Of course, this window may very well not fit on the screen.
Clicking the middle button on a character will cause that character's number to be displayed in
both decimal and hexidecimal at the bottom of the window. If verbose mode is selected, addi-
tional information about that particular character will be displayed as well. The displayed
information includes the width of the character, its left bearing, right bearing, ascent, and
descent. If verbose mode is selected, typing '<' or '>' into the window will display the mini-
mum or maximum values respectively taken on by each of these fields over the entire font.
The fontname is interpreted by the X sewer. To obtain a list of all the fonts available, use
xlsfonts.
The window stays around until the xfd process is killed or one of 'q', 'Q', ' ', or Control-C is
typed into the xfd window.
Options (Release 4)
The Release 4 version of xfd accepts all of the standard X Toolkit command line options, as
well as the following additional options. The option -en font is required.
-fn font Specifies the font to be displayed.
-box Indicates that a box outlining the area that would be filled with background
color by an ImageText request.
-center Indicates that each glyph should be centered in its grid.
-start char num
Specifies that character number char_num should be the first character
displayed. (It appears in the upper left hand comer of the grid.) This option
is used to view characters at arbitrary locations in the font. The default is 0.
-bc col or Specifies the color to be used if ImageText boxes are drawn.
Options (Release 3)
The Release 3 version ofxfd accepts the following options. The option -fn font is required.
-fn font Specifies the font to be displayed.
376 X Window System User's Guide
Font Displayer (continued) xf d
Author
Release 4 version by Jim Fulton, MIT X Comortium;
Release 3 version by Mark Lillibridge, MIT Project Athena.
X Window System User's Guide 379
xfontsel
Preview and Select Fonts--
Name
xfontsel - point and click interface for selecting display font names.
Syntax
xfontsel [opti ons]
Description
Available as of Release 4, xfontsel provides a simple way to display the fonts known to your X
server, examine samples of each, and retrieve the X Logical Font Description (XLFD) full
name for a fonL
If -pattern is not specified, nil fonts with XLFD 14-part names will be selectable. To work
with only a subset of the fonts, specify -pattern followed by a partially or fully qualified
font name. For example,
% xfontsel -pattern *medium*
will select the subset of fonts that contain the string medium somewhere in their font name.
Be careful about escaping wildcard characters in your shell.
If -print is specified on the command line the selected font specifier will be written to stan-
dard output when the quit button is activated. Regardless of whether or not -print was
specified, the font specifier may be made the (text) selection by activating the select button.
Clicking any pointer button in one of the XLFD field names will pop up a menu of the cur-
rently-known possibilities for that field. If previous choices of other fields were made, only
values for fonts which matched the previously selected fields will be selectable; to make other
values selectable, you must deselect some other field(s) by choosing the "*" entry in that field.
Unselectable values may be omitted from the menu entirely as a configuration option; see the
ShowUnselectable resource, below. Whenever any change is made to a field value,
xfontsel will assert ownership of the PRIMARY_FONT selection. Other applications (such as
xterm) may then retrieve the selected font specification.
Clicking the left pointer button in the select widget will cause the currently selected font name
to become the PRIMARY text selection as well as the PRIMARY_FONT selection. Then you can
paste the string into other applications. The select button remains highlighted to remind you
of this fact, and de-highlights when some other application takes the PRIMARY selection away.
The select widget is a toggle; pressing it when it is highlighted will cause xfontsel to release
the selection ownership and de-highlight the widget. Activating the select widget twice is the
only way to cause xfontsel to release the PRIMARY_FONT selection.
380 X Window System User's Guide
xfontsel (continued) Preview and Select Fonts
printOnQuit (class PrintOnQuit)
If True, the currently selected font name is printed to standard output when
the quit button is activated. Equivalent to the -print option.
Widget-specific resources:
showUnselectable (class ShowUnselectable)
For each field menu, specifies whether or not to show values that are not cur-
rently selectable, based upon previous field selections. If shown, the
unselectable values are clearly identified as such and do not highlight when
the pointer is moved down the menu. The full instance name of this resource
is fieldN, menu. options, showUnselectable, class Menu-
Button. SimpleMenu.Options. ShowUnselectable; where N is
replaced with the field number (starting with the left-most field numbered 0).
The default is True for all but field 11 (average width of characters in font)
and False for field 11. If you never want to see unselectable entries,
*menu. options, showUnselectable : False is a reasonable thing
to specify in a resource file.
Flies
lusrllib/Xlllapp-defaultslXFontSel - Specifies default resources.
See Also
xrdb
Bugs
Sufficiently ambiguous patterns can be misinterpreted and lead to an initial selection string
which may not correspond to what the user intended and which may cause the initial sample
text output to fail to match the proffered string. Selecting any new field value will correct the
sample output, though possibly resulting in no matching font.
Should be able to return a font for the PRIMARY selection, not just a string.
Any change in a field value will cause xfontsel to assert ownership of the PRIMARY_FONT
selection. Perhaps this should be parameterized.
When running on a slow machine, it is possible for the user to request a field menu before the
font names have been completely parsed. An error message indicating a missing menu is
printed to standard error, but otherwise nothing happens.
382 X Window System User's Guide
Preview and Select Fonts (continued) xfontsel
Author
Ralph R. Swick, Digital Equipment Corpomtion/MIT Project Athena.
|o
X Window System User's Guide 383
xinit
Window System Initializer--
Name
xinit - X Window System initializer.
Syntax
xinit [[cli en t] options] [-- [server_program]
[-display [host] : server[, screen]] options]
Description
The xinit program is used to start the X Window System server program and a first client pro-
gram (usually a terminal emulator) on systems that cannot start X directly from letclinit or in
environments that use multiple window systems. When this first client exits, xinit will kill the
X server program and then terminate.
If no specific client program is given on the command line, xinit will look in the user's home
directory for a file called .xinitrc to run as a shell script to start up other client programs. If no
such file exists, xinit will use the following xterra command line as a default:
xterm -geometry +1+1 -n login -display : 0
If no specific server program is given on the command line, xinit will look in the user's home
directory for a file called .xserverrc to run as a shell script to start up the server. If no such file
exists, xinit will use the following as a default server specification:
X :0
Note that this assumes that there is a server program called X in the current search path. How-
ever, servers are usually named Xdisplaytype, where displaytype is the type of graphics display
which is driven by the server (for example, Xsun). The site administrator should therefore
make a link to the appropriate type of server on the machine (see Chapter 2, Getting Started, in
Part One of this guide for delails), or create a shell script that runs xinit with the appropriate
server.
Note that programs run by .xinitrc and by .xserverrc should be run in the background if they do
not exit right away, so that they don't prevent other programs from starting up. However, the
last long-lived program started (usually a window manager or terminal emulator) should be left
in the foreground so that the script won't exit (which indicates that the user is done and that
xinit should exit).
An alternate client and/or server may also be specified on the command line. The desired client
program and its arguments should be given as the first command line arguments to xinit. To
specify a particular server program, append a double dash (--) to the xinit command line (after
any client and arguments) followed by the desired server program.
Both the client program name and the server program name must begin with a slash (/) or a
period (.); otherwise, they are treated as an arguments to be appended to their respective startup
lines. This makes it possible to add arguments (for example, foreground and background
colors) without having to retype the whole command line.
If an explicit server name is not given and the first argument following the double dash (--) is a
colon followed by a digit, xinit will use that number as the display number instead of zero. All
remaining arguments are appended to the server command line.
386 X Window System User's Guide
xkill (continued) Kill a Client
Resources
Button
Specifies a pointer button number to use when selecting the window to be
removed. If the word any is specified, any button on the pointer can be used.
See Also
X, xwininfo; Volume One, Xlib Programming Manual
Author
Jim Fulton, MIT X Consortium;
Dana Chee, Bellcore.
390 X Window System User's Guide
--Dlsplay Load Average
xload
Name
xload - display system load average.
Syntax
xload [options]
Description
The xload program displays a periodically updating histogram of the system load average.
Options
xload accepts all of the standard X Toolkit command line options along with the additional
options listed below:
-scale integer
Specifies the minimum number of tick marks in the histogram, where one
division represents one load average point. If the load goes above this num-
ber, xload will create m.ore divisions, but it will never use fewer than this
number. The default is 1.
-update seconds
Specifies the frequency in seconds at which xload updates its display. If the
load average window is uncovered (by moving windows with a window man-
ager or by the xrefresh program), the graph will also be updated. In Release
4, the minimum amount of time allowed between updates is 1 second (the
default is 5 seconds). In Release 3, the minimum amount of time allowed
between updates is 5 seconds (which is also the default).
-hl color or
-highlight color
Specifies the color of the scale lines in Release 4. Specifies the color of the
label and scale lines in Release 3.
-jumpscroll pixels
Specifies the number of pixels to shift the graph to the left when the graph
reaches the fight edge of the window. The default value is 1/2 the width of
the current window. Smooth scrolling can be achieved by setting it to 1.
(Available as of Release 4.)
-label string
Specifies the text string for the label above the load average. (Available as of
Release 4.)
-nolabel
Specifies that no label be displayed above the load graph. (Available as of
Release 4.)
The following standard X Toolkit options are commonly used with xload:
-bd co2 or Specifies the border color. The default is black.
-bg co2 or Specifies the background color. The default is white.
X Window System User's Guide 391
xload (continued) Display Load Average
Bugs
This program requires the ability to open and read Mevlionem. Sites that do not allow general
access to this file should make xload belong to the same group as Idev/kmem and turn on the set
group id permission flag.
Reading Idevlkmem is inherently non-portable. Therefore, the routine
(;et:_a.oad. c) must be potted to each new operating system.
Border color has to be explicitly specified when reverse video is used.
used to read it
Authors
K. Shane Hartman (MIT-LCS) and Stuart A. Malone (MIT-LCS);
with features added by Jim Gettys (MIT-Athena), Bob Scheifler (MIT-LCS), Tony Della Fera
(MIT-Athena), and Chris Peterson (MIT-LCS).
394 X Window System User's Guide
--Llst Interned Atoms
jr xlsatoms
Name
xlsatoms - list interned atoms defined on server.
Syntax
xlsatoms [options]
Description
Available as of Release 4, xlsatoms lists the interned atoms. By default, all atoms starting from
1 (the lowest atom value defined by the protocol) are listed until unknown atom is found. If an
explicit range is given, xlsatoms will try all atoms in the range, regardless of whether or not any
are undefined.
Options
-display host [: server] [. screen]
Allows you to specify the host, server and screen to connect to. host speci-
fies the machine, server specifies the server number, and screen specifies
the screen number. For example,
xlsatoms -display your_node" O . 1
specifics screen 1 of server 0 on the machine your_node. Either or both the
host and screen elements to the display specification can be omitted. If
host is omitted, the local machine is assumed. If screen is omitted, screen
0 is assumed (and the period is unnecessary). The colon and server are
necessary in all cases.
-format printf_string
Specifies a printf-style string used to list each atom <value, name> pair,
printed in that order (val ue is an unsigned long and name is a char *). xlsa-
toms will supply a newline at the end of each line. The default is %ld\t%s.
-range [i ow]-[high]
Specifies the range of atom values to check. If 1 ow is not given, a value of 1
assumed. If high is not given, xlsatoms will stop at the first undefined atom
at or above 1 ow.
-name string
Specifies the name of an atom to list. If the atom does not exist, a message
will be printed on the standard error.
See Also
X, Xserver, xprop
Author
Jim Fulton, MIT X Consortium.
X Window System User's Guide 397
xlsclients
List Running Clients--
Name
xlsclicnts - list client applications running on a display.
Syntax
xlsclients [options]
Description
Available as of Release 4, xlsclients is a utility for listing information about the client applica-
tions running on a display. It may be used to generate scripts representing a snapshot of the the
user's current session.
Options
-display host [ : server] [. screen]
Allows you to specify the host, server and screen to connect to. host speci-
fies the machine, server specifies the server number, and screen specifies
the screen number. For example,
xlsclients -display your_node: O. 1
specifies screen 1 of server 0 on the machine your_node. Either or both the
host and screen elements to the display specification can be omitted. If
host is omitted, the local machine is assumed. If screen is omitted, screen
0 is assumed (and the period is unnecessary). The colon and server are
necessary in all cases.
-a Specifies that clients on all screens should be listed. By default, only those
clients on the default screen are listed.
-1 Requests a long listing showing the window name, icon name, and class hints
in addition to the machine name and command string in the default listing.
-m maxcmdl ength
Specifies the maximum number of characters in a command to list. The
default is 1000.
See Also
X, xprop, xwininfo
Author
Jim Fulton, MIT X Consortium.
398 X Window System User's Guide
xlsfonts (continued) List Available Fonts
Author
Mark Lillibridge, MIT Project Athena;
Jim Fulton, MIT X Consortium;
Phil Karlton, SGI.
400 X Window System User's Guide
Magnify Screen Portions (continued) xmag
the user to select an area of the screen. The size of the source is used with the
desired magnification to compute the default enlargement window size.
Therefore, only one of -geometry size and -mag magfactor options
may be specified if a source size is given with this option.
-magma gfa c t o r
This option specifies an integral factor by which the source region should be
enlarged. The default magnification is 5. This is used with the size of the
source to compute the default enlargement window size. Therefore, only one
of -geometry size and -source geom options may be specified if a
magnification factor is given with this option.
-bw pixels This option specifies the width in pixels of the border surrounding the enlarge-
ment window.
-bd co2 or This option specifies the color to use for the border surrounding the enlarge-
ment window.
-bg col or_or_pixel_val ue
This option specifies the name of the color to be used as the background of
the enlargement window. If the name begins with a percent size (%), it is
interpreted to be an absolute pixel value. This is useful when displaying large
areas since pixels that are the same color as the background do not need to be
painted in the enlargement. The default is to use the BlackPixel of the
screen.
-fn fontname
-z
This option specifies the name of a font to use when displaying pixel values
(used when button 1 is pressed in the enlargement window).
This option indicates that the server should be grabbed during the dynamics
and the call to XGet Tmage. This is useful for ensuring that clients don't
change their state as a result of entering or leaving them with the pointer.
Resources
The xmag program uses the following X resources:
geomet ry (class Geomet ry)
Specifies the size and/or location of the enlargement window.
source (class Source)
Specifies the size and/or location of the source region on the screen.
magnification (class Magnification)
Specifies the enlargement factor.
borderWidth (class BorderWidth)
Specifies the border width in pixels.
borderColor (class BorderColor)
Specifies the color of the border.
X Window System User's Gutde 403
xmag (continued) Magnify Screen Portions
background (class Background)
Specifies the color or pixel value to be used for the background of the
enlargement window.
font (class Font)
Specifies the name of the font to use when displaying pixel values when the
user presses button 1 in the enlargement window.
See Also
X, xwd
Bugs
This program will behave strangely on displays that support windows of different depths.
Because the window size equals the source size times the magnification, you only need to spec-
ify two of the three parameters. This can be confusing.
Being able to drag the pointer around and see a dynamic display would be very nice.
Another possible interface would be for the user to drag out the desired area to be enlarged.
Author
Jim Fulton, MIT X Consortium.
404 X Window System User's Guide
xman (continued) Display Man Pages
-bw pixel s or -borderwidth pixel s
Specifies the width of the border for all windows in xman.
-bd col or or -bordercolor col or
Specifies the color of the borders of all windows in xman.
-fg col or or -foreground col or
Specifies the foreground color to be used.
-bg col or or -background col or
Specifies the background color to be used.
-fn font or -font font
Specifies the font to use for all buttons and labels.
-name name Specifies the name to use when retrieving resources.
-t it le ei e./e Specifies the tide of this application.
-xrm resources
Allows a resource to be specified on the command line.
Resources (Release 3 and Release 4)
The resources in this section are valid for both Release 3 and Release 4, unless otherwise
indicated.
The xman program uses the following X Toolkit resources: foreground, background,
width, height, borderWidth, and borderColor.
In addition, xman has application-specific resources that allow unique xman customizations.
manualFontNormal (class Font)
The font to use for normal text in the manual pages.
manualFontBold (class Font)
The font to use for bold text in the manual pages.
manualFontltalic (class Font)
The font to use for italic text in the manual pages.
directoryFontNormal (class Font)
The font to use for the directory text.
bothShown (class Boolean)
Either true or false, specifies whether or not you want both the directory and
the manual page shown at start up.
directoryHeight (class DirectoryHeight)
The height in pixels of the directory, when the directory and the manual page
are shown simultaneously.
topCursor (class Cursor)
The cursor to use in the top box.
408 X Window System User's Guide
Display Man Pages (continued) xman
Bugs in Release 3
The -fn and -font options only specify the fonts for the command button and not the text of
the manpages or directories.
Protocol error upon selecting Remove This Manpage.
See Also
X, apropos(l), catman(8), man(l), Athena Widget set
Authors
Chris Peterson, MIT X Consortium from the V10 version written by Barry Shein formerly of
Boston University.
X Window System User's Guide 413
X Interface to mh (Release 4) (continued) xmh
Basic Screen Layout
xmh starts out with a single window, divided into four main areas: Six buttons with pull-down
command menus. A collection of buttons, one for each top level folder. New users of mh will
have two folders, "drafts" and "inbox". A listing, or Table of Contents, of the messages in
the open folder. Initially, this will show the messages in "inbox". A view of one of your mes-
sages. Initially this is blank.
xmh and the Athena Widget Set
xmh uses the X Toolkit Intrinsics and the Athena Widget Set. Many of the features described
below (scrollbars, buttonboxes, etc.) are actually part of the Athena Widget Set, and are
described here only for completeness. For more information, see the Athena Widget Set docu-
mentation.
Scrollbars
Some parts of the main window will have a vertical area on the left containing a grey bar. This
area is a scrollbar. They are used whenever the data in a window takes up more space than can
be displayed. The grey bar indicates what portion of your data is visible. Thus, if the entire
length of the area is grey, then you are looking at all your data. If only the first half is grey,
then you are looking at the top half of your data. The message viewing area will have a hori-
zontal scrollbar if the text of the message is wider than the viewing area.
You can use the pointer in the scrollbar to change what part of the data is visible. If you click
with the middle button, then the top of the grey area will move to where the pointer is, and the
corresponding portion of data will be displayed. If you hold down the middle button, you can
drag around the grey area. This makes it easy to get to the top of the data: just press with the
middle, drag off the top of the scrollbar, and release.
If you click with button 1, then the data to the right of the pointer will scroll to the top of the
window. If you click with pointer button 3, then the data at the top of the window will scroll
down to where the pointer is.
Buttonboxes, Buttons, and Menus
Any area containing many words or short phrases, each enclosed in a rectangle or rounded
boundary, is called a buttonbox. Each rectangle or rounded area is actually a button that you
can press by moving the pointer onto it and pressing pointer button 1. If a given buttonbox has
more buttons in it than can fit, it will be displayed with a scrollbar, so you can always scroll to
the button you want.
Some buttons have pull-down menus. Pressing the pointer button while the pointer is over one
of these buttons will pull down a menu. Holding the button down while moving the pointer
over the menu, called dragging the pointer, will highlight each selectable item on the menu as
the pointer passes over it. To select an item in the menu, release the pointer button while the
item is highlighted.
Adjusting the Relative Sizes of Areas
If you're not satisfied with the sizes of the various areas of the main window, they can easily be
changed. Near the right edge of the border between each region is a black box, called a grip.
Simply point to that grip with the pointer, press a pointer button, drag up or down, and release.
Exactly what happens depends on which pointer button you press.
X Window System User's Guide 415
xmh (conined) X Interface to mh (Release 4)
In both of these operations, the selected folder or sequence and the viewed folder or sequence
are not changed.
xmh defines the following keyboard accelerators over the surface of the main window, except in
the view area while editing a message:
Mota-I Incorporate new mail.
Meta-C Commit changes.
Meta-R Rescan folder.
Meta-P Pack folder.
Meta-S Sort folder.
Meta-space View next message.
Meta-c Mark copy.
Meta-d Mark deleted.
Meta4 Forward the selected or current message.
Meta-m Mark move.
Meta-n View next message.
Meta-p View previous message.
Meta-r Reply to the selected or current message.
Meta-u Unmark.
ControI-V Scroll the table of contents forward.
Meta-V Scroll the table of contents backward.
Control-v Scroll the view forward.
Meta-v Scroll the view backward.
Text Editing Commands
All of the text editing commands are actually defined by the Text widget in the Athena Widget
Set. The commands may be bound to different keys than the defaults described below through
the X Toolkit Intrinsics key re-binding mechanisms. See the X Toolkit Intrinsics and the
Athena Widget Set documentation for more details.
Whenever you are asked to enter any text, you will be using a standard text editing interface.
Various control and meta keystroke combinations are bound to a somewhat Emacs-like set of
commands. In addition, the pointer buttons may be used to select a portion of text or to move
the insertion point in the text. Pressing pointer button 1 causes the insertion point to move to
the pointer. Double-clicking button 1 selects a word, triple-clicking selects a line, quadruple-
clicking selects a paragraph, and clicking rapidly five times selects everything. Any selection
may be extended in either direction by using pointer button 3.
In the following, a line refers to one displayed row of characters in the window. A paragraph
refers to the text between carriage returns. Text within a paragraph is broken into lines for
422 X Window System User's Guide
X Interface to mh (Release 4) (continued) xmh
display based on the current width of the window. When a message is sent, text is broken into
lines based upon the values of the SendBreakW:i.dt:h and SendWJ.dt:h application-specific
resources.
The following keystroke combinations are defined:
Control-a
Control-b
Control-d
Control-e
Control-f
Contml-g
Control-h
Control-j
Control-k
Control-I
Control-m
Control-n
Control-o
Control-p
Control-r
Control-s
Control-t
Control-u
ControI-v
Control-w
Control-y
Control-z
Meta-B
Meta-d
Meta-D
Meta-f
Meta-h
Meta-H
Move to the beginning of the current line.
Move backward one character.
Delete the next character.
Move to the end of the current line.
Move forward one character.
Multiply reset.
Delete previous character.
Create a new paragraph with the same indentation as the previous one.
Kill the rest of the current line.
Refresh window.
New paragraph.
Move down to the next line.
Break this paragraph into two.
Move up to the previous line.
Search/replace backward.
Search/replace forward.
Transpose characters.
Multiply by 4.
Move down to the next screenful of text.
Kill the selected text.
Insert the last killed text.
Scroll the text up one line.
Move backward one word.
Delete the next word.
Kill the next word.
Move forward one word.
Delete the previous word.
Kill the previous word.
X Window System User's Guide 423
xmh (continued) X Interface to mh (Release 4)
Meta-i Insert file.
Meta-k Kill to end of paragraph.
Meta-q Form paragraph.
Meta-v Move up to the previous screenful of text.
Meta-y Insert current text selection.
Meta-z Scroll one line down.
Meta-< Move to the beginning of the file.
Meta-> Move to the end of the file.
Meta-] Move forward one paragraph.
Meta-[ Move backward one paragraph.
Meta-Delete Delete previous word.
Mota-Shift Delete Kill previous word.
Mota-Backspaco Delete previous word.
Meta-Shift Backspace
Kill previous word.
In addition, the pointer may be used to cut and paste text:
Button 1 Down Start selection.
Button 1 Motion
Button 1 Up
Button 2 Down
Button 3 Down
Button 3 Motion
Button 3 Up
Adjust selection.
End selection (cut).
Insert current selection (paste).
Extend current selection.
Adjust selection.
End selection (cut).
Confirmation Dialog Boxes
Whenever you press a button that may cause you to lose some work or is otherwise dangerous,
a popup dialog box will appear asking you to confirm the action. This window will contain an
Abort or No button and a Confirm or Yes button. Pressing the No button cancels the operation,
and pressing the Yes will proceed with the operation.
Some dialog boxes contain messages from mh. Clicking on the message field will cause the
dialog box to resize so that you can read the entire message.
Messag e-Sequences
An mh message sequence is just a set of messages associated with some name. They are local
to a particular folder;, two different folders can have sequences with the same name. In all fold-
ers, the sequence "all" is predefined; it consists of the set of all messages in that folder. As
424 X Window System User's Guide
X Interface to mh (Release 4) (continued) xmh
many as nine sequences may be defined for each folder, including the predefined "all"
sequence. (The sequence "cur" is also usually defined for every folder;, it consists of only the
current message, xmh hides "cur" from the user, instead placing a "+" by the current mes-
sage. Also, xmh does not support the "unseen" sequence, so that one is also hidden from the
user.)
The message sequences for a folder (including one for "all") are displayed in the Sequence
menu, below the sequence commands. The table of contents (also known as the "toe") is at
any one time displaying one message sequence. This is called the "viewed sequence", and its
name will be displayed in the toc title bar just after the folder name. Also, at any time one of
the sequences in the menu will have a check mark next to it. This is called the "selected
sequence". Note that the viewed sequence and the selected sequence are not necessarily the
same. (This all pretty much corresponds to the way the folders work.)
The Open Sequence, Add to Sequence, Remove from Sequence, and Delete Sequence com-
mands are active only if the viewed folder contains message-sequences.
Note that none of the above actually affect whether a message is in the folder. Remember that
a sequence is a set of messages within the folder;, the above operations just affect what mes-
sages are in that seL
To create a new sequence, select the Pick menu entry. A new window will appear, with lots of
places to enter text. Basically, you can describe the sequence's initial set of messages based on
characteristics of the message. Thus, you can define a sequence to be all the messages that
were from a particular person, or with a particular subject, and so on. You can also connect
things up with boolean operators, so you can select all things from "weissman" with the sub-
ject "xmh"
Hopefully, the layout is fairly obvious. The simplest cases are the easiest: just point to the
proper field and type. If you enter in more than one field, it will only select messages which
match all non-empty fields.
The more complicated cases arise when you want things that match one field or another one,
but not necessarily both. That's what all the "or" buttons are for. If you want all things with
the subject "xmh" or "xterm", just press the "or" button next to the "Subject:" field.
Another box will appear where you can enter another subject.
If you want all things either from "weissman" or with subject "xmh", but not necessarily
both, select the "-Or-" button. This will essentially double the size of the form. You can then
enter "weissman" in a from: box on the top half, and "xmh" in a subject: box on the lower
part.
If you select the Skip button, then only those messages that don't match the fields on that row
are included.
Finally, in the bottom part of the window will appear several more boxes. One is the name of
the sequence you're defining. (It defaults to the name of the selected sequence when Pick was
pressed, or to "temp" if "all" was the selected sequence.) Another box defines which
sequence to look through for potential members of this sequence; it defaults to the viewed
sequence when Pick was pressed.
X Window System User's Guide 425
xmh (continued) X Interface to mh (Release 4)
Two more boxes define a date range; only messages within that date range will be considered.
These dates must be entered in 822-style format: each date is of the form "dd mmm yy
hh:mm:ss zzz", where dd is a one or two digit day of the month, mmm is the three-letter abbre-
viation for a month, and yy is a year. The remaining fields are optional: hh, mm, and ss specify
a time of day, and zzz selects a time zone. Note that if the time is left out, it defaults to mid-
night; thus if you select a range of "7 nov 86" - "8 nov 86", you will only get messages from
the 7th, as all messages on the 8th will have arrived after midnight.
Date field specifies which date field in the header to look at for this date range; it probably
won't be useful to anyone. If the sequence you're defining already exists, you can optionally
merge the old set with the new; that's what the Yes and No buttons are all about. Finally, you
can OK the whole thing, or Cancel it.
In general, most people will rarely use these features. However, it's nice to occasionally use
Pick to find some messages, look through them, and then hit Delete Sequence to put things back
in their original state.
Widget Hierarchy
In order to specify resources, it is useful to know the hierarchy of widgets which compose xmh.
In the notation below, indentation indicates hierarchical structure. The widget class name is
given first, followed by the widget instance name. The application class name is Xmh.
The hierarchy of the main toc and view window is identical for additional toc and view win-
dows, except that a topT.evelShell widget is inserted in the hierarchy between the applica-
tion shell and the Parted widget.
Xmh xmh
Paned xmh
$impleMenu
folderHenu
SmeBSB open
SmeBSB openInNew
SmeBSB create
SmeBSB delete
SmeLine line
SmeBSB close
$impleMenu tocMenu
SmeBSB inc
SmeBSB commit
SmeBSB pack
SmeBSB sort
SmeBSB rescan
$impleMenu messageMenu
SmeBSB compose
SmeBSB next
SmeBSB prey
SmeBSB delete
SmeBSB move
SmeBSB copy
SmeBSB unmark
SmeBSB viewNew
426 X Window System User's Guide
X Interface to mh (Release 4) (continued) xmh
SmeBSB reply
SmeBSB forward
SmeBSB useAsComp
SmeBSB print
SimpleMenu sequenceMenu
SmeBSB pick
SmeBSB openSeq
SmeBSB addToSeq
SmeBSB removeFromSeq
SmeBSB deleteSeq
SmeLine line
SmeBSB all
SimpleMenu viewMenu
SmeBSB reply
SmeBSB forward
SmeBSB useAsComp
SmeBSB edit
SmeBSB save
SmeBSB print
SimpleMenu optionMenu
SmeBSB reverse
Viewport.Core menuBox.clip
Box menuBox
MenuButton folderButton
MenuButton tocButton
MenuButton messageButton
MenuButton sequenceButton
MenuButton viewButton
MenuButton optionButton
Grip grip
Label folderTitlebar
Grip grip
Viewport.Core folders.clip
Box folders
MenuButton inbox
MenuButton drafts
SimpleMenu menu
SmeBSB <folder name>
--
Grip grip
Label tocTitlebar
Grip grip
Text toc
Scrollbar vScrollbar
Grip grip
Label viewTitlebar
Grip grip
X Window System User's Guide 427
xmh (continued) X Interface to mh (Release 4)
Text view
Scrollbar vScrollbar
Scrollbar hScrollbar
The hierarchy of the Create Folder popup dialog box:
transientShell prompt
Dialog dialog
Label label
Text value
Command okay
Command cancel
The hierarchy of the Notice dialog box, which reports messages from mh:
transientShell notice
Dialog dialog
Label label
Text value
Command confirm
The hierarchy of the ConJirmation dialog box:
transientShell confirm
Dialog dialog
Label label
Command yes
Command no
The hierarchy of the dialog box which reports errors:
transientShell error
Dialog dialog
Label label
Command OK
The hierarchy of the composition window:
topLevelShell xmh
Paned xmh
Label composeTitlebar
Text comp
Viewport.Core compButtons.clip
Box compButtons
Command close
Command send
Command reset
Command compose
Command save
Command insert
428 X Window System User's Guide
X Interface to mh (Release 4) (continued) xmh
The hierarchy of the view window:
topLevelShell
Paned
xmh
xmh
Label viewTitlebar
Text view
Viewport.Core viewButtons.clip
Box viewButtons
Command close
Command reply
Command forward
Command useAsComp
Command edit
Command save
Command print
The hierarchy of the pick window:
(Unnamed widgets have no name.)
topLevelShell xmh
Paned xmh
Label pickTitlebar
Viewport.core pick.clip
Form form
Form
Thefrst6rowsofthepkwindow haveidemicalsucture:
Form
Toggle
Toggle
Label
Text
Command
Form
Form
Viewport.core pick.clip
Form form
From
Form
Toggle
Toggle
Text
Text
Command
Command
Label
Text
Label
Text
X Window System User's Guide 429
xmh (continued) X Interface to mh (Release 4)
Form
Form
Form
Label
Text
Label
Text
Label
Text
Label
Toggle
Toggle
Command
Command
Application-specific Resources
Resource instance names begin with a lower case letter but are otherwise identical to the class
name.
If TocGeometry, ViewGeometry, CompGeometry, or PickGeometry are not speci-
fied, then the value of Geomet ry is used instead. If the resulting height is not specified (e.g.,
.... , "=500", "+0-0"), then the default height of windows is calculated from fonts and line
counts. If the width is not specified (e.g., '"', "=x300", "-0+0), then half of the display width is
used. If unspecified, the height of a pick window defaults to half the height of the display.
Any of these options may also be specified on the command line by using the X Toolkit Inlxin-
sics resource specification mechanism. Thus, to run xmh showing all message headers,
% xmh -xrm ' *HideBoringHeader : off'
The following resources are defined:
Banner A short string that is the default label of the folder, Table of Contents, and
view. The default is:
xmh MIT X Consortium R4
BlockEvent sOnBusy
Whether to disallow user input and show a busy cursor while xmh is busy pro-
cessing a command. Default is true.
BusyCursor
The name of the symbol used to represent the position of the pointer,
displayed if BlockEventsOnBusy is true, when xmh is processing a time-
consuming command. The default is watch.
BusyPointerColor
The reound color of the busy cursor.
Foreground.
Deult is XtDefault-
430 X Window System User's Guide
xm h (continued) X Interface to mh (Release 4)
XmhPushFolder ( [foldername, . . . ] )
Pushes each of its argument(s) onto a stack of foldemames. If no arguments
are given, the selected folder is pushed onto the stack.
XmhPopFolder ( )
Pops one foldemame from the stack and sets the selected folder.
XmhPopupFolderMenu ( )
Should always be taken when the user selects a folder button. A folder button
represents a folder and zero or more subfolders. The menu of subfolders is
built upon the first reference, by this routine. If there are no subfolders, this
routine will mark the folder as having no subfolders, and no menu will be
builL In that case the menu button emulates a toggle button. When subfold-
ers exist, the menu will popup, using the menu button action PopupMonu ( ).
XmhSetCurrentFolder ( )
Allows menu buttons to emulate toggle buttons in the function of selecting a
folder. This action is for menu button widgets only, and sets the selected
folder.
XmhLeaveFolderBut ton ( )
Insures that the menu button behaves properly when the user moves the
pointer out of the menu button window.
XmhPushSequence ( [sequencename, . . . ] )
Pushes each of its arguments onto the stack of sequence names. If no argu-
ments are given, the selected sequence is pushed onto the stack.
XmhPopSequence ( )
Pops one sequence name from the stack of sequence names, which then
becomes the selected sequence.
XmhP romptOkayAct ion ( )
Equivalent to pressing the okay button in the Create Folder popup.
XmhCancelPick ( )
Equivalent to pressing the cancel button in the pick window.
Customization Using mh
The initial text displayed in a composition window is generated by executing the corresponding
mh command; i.e., comp, repl, orforw, and therefore message components may be customized
as specified for those commands, comp is executed only once per invocation of xmh and the
message template is re-used for each successive new composition.
Flies
-Cail
-I.mh_proJile - mh profile
/usr/local/mh6 - mh commands
-/Maill <folder> /.xmhcache - scan folder
434 X Window System User's Guide
X Interface to mh (Release 4) (continued) xmh
-/Maill <folder> /.mh_sequences - sequence definitions
Itmp - temporary files
See Also
X, xrdb, mh(1), enscript(1); Athena Widget Set; Volume Four, X Toolkit lntrinsics Program-
ming Manual; Volume Five, X Toolkit lntrinsics Reference Manual
Bugs
Printing support is minimal.
Should handle the "unseen" message-sequence.
Should determine by itself if the user hasn't used mh before, and offer to create the .mh_pro.file,
instead of hanging on inc.
Still a few commands missing (rename folder, remail message).
A bug in mh limits the the number of characters in .mh_sequences to BUFSIZ. When the limit is
reached, the .mh_sequences file often becomes corrupted, and sequence definitions may be lost.
Except for the icon, there isn't an indication that you have new mail.
There should be a resource, ShoraOn'rnc, which when true, would show the current message in
the view after incorporating new mail.
The Check'requency resource should be split into two separate resources.
WM_SAVE_YOURSELF protocol is ignored.
WM_DELETE_WINDOW protocol doesn't work right when requesting deletion of the first toc
and view, while trying to keep other xmh windows around.
Doesn't support annotations when replying to messages.
Copyright
Copyright 1988, 1989, Digital Equipment Corporation.
Cop)night 1989, Massachusetts Institute of Technology
See X for a full statement of rights and permissions.
Author
Terry Weissman, Digital Western Research Laboratory;
Modified by Donna Converse, MIT X Consortium.
X Window System User's Guide 435
X Interface to mh (Release 3) (continued) xmh
Delete Folder Deslroys the selected folder. You will be asked to confirm this action (see
"Confirmation Windows").
Highlighted Messages, Selected Messages and the Current Message
It is possible to highlight a set of messages in the list of messages for the viewed folder. To
highlight a message, just click on it with pointer button 1. To highlight a range of messages,
click on the first one with pointer button 1 and on the last one with pointer button 3.
The selected messages are the same as the highlighted messages, if any. If no messages are
highlighted, then the selected messages are considered the same as the current message.
The current message is indicated by a "+" next to the message number. It usually corresponds
to the message currently being viewed.
Message Commands
The third buttonbox (fourth if you have message-sequences displayed) contains commands to
deal with messages:
Incorporate New Mail
Adds any new mail received to your inbox folder, and set the current message
to be the first new message. (This button is selectable only if "inbox" is the
folder being viewed.)
View Next Message
Views the first selected message. If no messages are highlighted, view the
current message. If current message is already being viewed, view the first
unmarked message after the current message.
View Previous Message
Views the last selected message. If no messages are highlighted, view the
current message. If current message is already being viewed, view the first
unmarked message before the current message.
Mark Deleted
Mark Move
Mark Copy
Marks the selected messages for deletion. If no messages are highlighted,
then this will automatically display the next unmarked message.
Marks the selected messages to be moved into the current folder. (If the cur-
rent folder is the same as the viewed folder, this command will just beep.) If
no messages are highlighted, then this will automatically display the next
unmarked message.
Marks the selected messages to be copied into the current folder. (If the cur-
rent folder is the same as the viewed folder, this command will just beep.)
Unmark
Removes any of the above three marks from the selected messages.
View in New Window
Creates a new window containing only a view of the first selected message.
Reply Creates a composition window in reply to the first selected message.
X Window System User's Guide 439
X Interface to mh (Release 3) (continued) xmh
Composition Windows
Aside from the normal text editing functions, there are six command buttons associated with
composition windows:
Close
Send
Reset
Compose
Save
Insert
Closes this composition window. If changes have been made since the most
recent Save or Send, you will be asked to confirm losing them.
Sends this composition.
Replaces the current composition with an empty message. If changes have
been made since the most recent Send or Save, you will be asked to confirm
losing them.
Brings up another new composition window.
Saves this composition in your drafts folder. (If you do not have a folder
named "drafts", one will be created.) Then you can safely close the compo-
sition. At some future date, you can continue working on the composition by
opening your drafts folder, selecting the message, and using the Use as Com-
position command.
Inserts a related message into the composition. If the composition window
was created with'a Reply button, the related message is the message being
replied to, otherwise no related message is defined and this button is inactive.
The message will be filtered before being inserted; see ReplyInsert-
F i 1 t e r under "Resources" below.
Text Editing Commands
All of the text editing commands are actually defined by the Text widget in the X Toolkit. The
commands may be bound to different keys than the defaults described below through the stan-
dard X Toolkit key re-binding mechanisms. See the X Toolkit and Athena Widgets documenta-
tion for more details.
Whenever you are asked to enter any text, you will be using a standard text editing interface.
Various control and meta keystroke combinations are bound to a somewhat Emacs-like set of
commands. In addition, the pointer buttons may be used to select a portion of text or to move
the insertion point in the text. Pressing pointer button 1 causes the insertion point to move to
the pointer. Double-clicking button 1 selects a word, triple-clicking selects a paragraph, and
quadruple-clicking selects everything. Any selection may be extended in either direction by
using pointer button 3.
In the following, a line refers to one displayed row of characters in the window. A paragraph
refers to the text between carriage returns. Text within a paragraph is broken into lines based
on the current width of the window.
The following keystroke combinations are defined:
ControI-A Move to the beginning of the current line.
Control-B, Control-H, Backspace
Move backward one character.
X Window System User's Guide 441
xm h (continued) X Interface to mh (Release 3)
ControI-D Delete the next character.
ControI-E Move to the end of the current line.
ControI-F Move forward one character.
Control-J, LineFeed
Create a new paragraph with the same indentation as the previous one.
ControI-K Kill the rest of this line.
Refresh window.
ControI-L
Control-M, Return
New paragraph.
ControI-N Move down to the next line.
ControI-O Break this paragraph into two.
ControI-P Move up to the previous line.
ControI-V Move down to the next screenful of text.
ControI-W Kill the selected text.
ControI-Y Insert the last killed text.
ControI-Z Scroll the text one line up.
Meta-< Move to the beginning of the document.
Meta-> Move to the end of the document.
Meta-[ Move backward one paragraph.
Meta-] Move forward one paragraph.
Meta-B Move backward one word.
Meta-D Kill the next word.
Meta-F Move forward one word.
Meta-H, Meta-Delete
Kill the previous word.
Insert a file. If any text is selected, use the selected text as the filename.
Otherwise, a box will appear in which you can type the desired filename.
Move up to the previous screenful of text.
Stuff the last selected text here. Note that this can be text selected in some
other text subwindow. Also, if you select some text in an xterm window, it
may be inserted in an xmh window with this command. Pressing pointer but-
ton 2 is equivalent to this.
Scroll the text one line down.
Meta-I
Meta-V
Meta-Y
Meta-Z
442 X Window System User's Guide
X Interface to mh (Release 3) (continued) xmh
Delete
Delete the previous character.
Confirmation Windows
Whenever you press a button that may cause you to lose some work or is otherwise dangerous,
a window will appear asking you to confirm the action. This window will contain an Abort or
No button and a Confirm or Yos button. Pressing the Abort button cancels the operation, and
pressing the "'Confirm" will proceed with the operation. (A very handy shortcut exists: if you
press the original, offending button again, it will be interpreted as a Confirm. If you press any
other command button, it will be interpreted as an Abort.)
Message-Sequences
An mh message sequence is just a set of messages associated with some name. They are local
to a particular folder, two different folders can have sequences with the same name. In all fold-
ers, the sequence "all" is predefined; it consists of the set of all messages in that folder. (The
sequence "cur" is also usually defined for every folder, it consists of only the current message.
xmh hides "cur" from the user, instead placing a "+" by the current message. Also, xmh does
not support the "unseen" sequence, so that one is also hidden from the user.)
The message sequences for a folder are displayed as buttons containing the names of the
sequences (including one for "all"). The table of contents (aka "toc") is at any one time dis-
playing one message sequence. This is called the "viewed sequence"; if it's not "all", its
name will be displayed in the title bar just after the folder name. Also, at any time one of the
sequence buttons will be highlighted. This is called the "selected sequence". Note that the
viewed sequence and the selected sequence are not necessarily the same. (This all pretty much
corresponds to the way the folder buttons work.)
The Open Sequence, Add to Sequence, Remove from Sequence, and Delete Sequence buttons
are active only if the viewed folder contains message-sequences.
Note that none of the above actually effect whether a message is in the folder. Remember that
a sequence is a set of messages within the folder, the above operations just affect what mes-
sages are in that seL
To create a new sequence, press the Pick button. A new window will appear, with lots of places
to enter text. Basically, you can describe the sequence's initial set of messages based on charac-
teristics of the message. Thus, you can define a sequence to be all the messages that were from
a particular person, or with a particular subject, and so on. You can also connect things up with
boolean operators, so you can select all things from "weissman" with the subject "xmh".
Hopefully, the layout is fairly obvious. The simplest cases are the easiest: just point to the
proper field and type. If you enter in more than one field, it will only select messages which
match all non-empty fields.
The more complicated cases arise when you want things that match one field or another one,
but not necessarily both. That's what all the "or" buttons are for. If you want all things with
the subject "xmh" or "xterm", just press the "or" button next to the "Subject:" field.
Another box will appear where you can enter another subject.
X Window System User's Guide 443
X Interface to mh (Release 3) (continued) xmh
The initial text displayed in a composition window is generated by executing the corresponding
mh command; i.e., comp, repl, orforw and therefore message components may be customized
as specified for those commands, comp is executed only once per invocation of xmh and the
message template is re-used for each successive new composition.
Files
"Cail
"l.mh__proJile
See Also
X, xrdb, mh - the mh Message Handler
Bugs
Printing support is minimal.
Keyboard shortcuts for commands would be nice.
Should handle the "unseen" message-sequence.
Should determine by itself if the user hasn't used mh before, and offer to set things up for him
or her.
Still a few commands missing (rename folder, remail message).
Needs sub-folder support.
Copyright
Copyright 1988, Digital Equipment Corporation.
See X for a full statement of rights and permissions.
Author
Terry Weissman, Digital Western Research Laboratory.
X Window System User's Gutde 447
xmodmap
Keyboard Modifier Utility--
Name
xmodmap - keyboard and pointer modifier utility.
Syntax
xmodmap [options] [ f il ename]
Description
xmodmap is a utility for displaying and altering the X keyboard modifier map and keymap table
on the specified server and host. It is intended to be run from a user's X startup script to setup
the keyboard according to personal tastes.
With no arguments, xmodmap displays the current map.
Options
-display
[ host] : server[, screen]
Allows you to specify the host, server and screen to use. For example,
xmodmap -display your_node: O. 0
specifies the screen 0 on server 0 on the machine your_node. If the host is
omiued, the local machine is assumed. If the screen is omitted, the screen 0
is assumed; the server and colon (:) are necessary in all cases.
-help
Indicates that a brief description of the command line arguments should be
printed on the standard error. This will be done whenever an unhandled argu-
ment is given to xmodmap.
-grammar
-verbose
-quiet
-n
Indicates that a help message describing the expression grammar used in files
and with -e expressions should be printed on the standard error.
Indicates that xmodmap should print logging information as it parses its input.
Turns off the verbose logging. This is the default.
Indicates that xmodmap should not change the mappings, but should display
what it would do, like make(l) does when given this option. (Cannot be used
with expressions to change the pointer mapping.)
-e expressi on
Specifies an expression to be executed. Any number of expressions may be
specified from the command line.
-pm
Indicates that the current modifier map should be printed on the standard
output.
-pk
Indicates that the current keymap table should be printed on the standard
output.
-pp
Indicates that the current pointer map should be printed on the standard
OUtpUL
448 X Window System User's Guide
Keyboard Modifier Utility (continued) xmodmap
Some keyboards do not automatically generate less than and greater than characters when the
comma and period keys are shifted. This can be remedied with xmodmap by resetting the bind-
ings for the comma and period with the following scripts:
!
' make shift-, be < and shift-, be >
keysym comma = comma less
keysym period = period greater
One of the more irritating differences between keyboards is the location of the Control and
Shift Lock keys. A common use of xmodmap is to swap these two keys as follows:
!
! Swap Caps_Lock and Control_L
remove Lock = Caps_Lock
remove Control = Control L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control L
--
The keycode command is useful for assigning the same keysym to multiple keycodes.
Although unportable, it also makes possible to write scripts that can reset the keyboard to a
known state. The following script sets the backspace key to generate Delete (as shown above),
flushes all existing caps lock bindings, makes the CapsLock key a control key, makes F5 gener-
ate Escape, and makes Break/Reset be a shift lock.
I
! On the HP, the following keycodes have key caps as listed:
!
' i01 Backspace
' 55 Caps
! 14 Ctrl
' 15 Break/Reset
' 86 Stop
' 89 F5
keycode i01 = Delete
keycode 55 = Control R
clear Lock
add Control = Control R
keycode 89 = Escape
keycode 15 = Caps_Lock
add Lock = Caps_Lock
X Window System User's Guide 451
xmodmap (continued) Keyboard Modifier Utility
See Also
Bugs
Every time a keycode expression is evaluated, the server generates a MappingNotify
event on every client. This can cause some thrashing. All of the changes should be batched
together and done at once. Clients that receive keyboard input and ignore MappingNotify
events will not notice any changes made to keyboard mappings.
xmodmap should generate add and remove expressions automatically whenever a keycode
that is already bound to a modifier is changed.
There should be a way to have the remove expression accept keycodes as well as keysyms for
those times when you really mess up your mappings.
Authors
Rewritten by Jim Fulton, MIT X Consortium, from an earlier version by David Rosenthal of
Sun Microsystems.
452 X Window System User's Guide
xpr (continued) Print X Window Dump
-width inches
Specifies the maximum width of the page.
-left inches
Specifics the left margin in inches. Fractions arc allowed. By default, the
window is centered on the page.
-top inches Specifies the top margin for the picture in inches. Fractions are allowed. By
default, the window is centered on the page.
-header header
Specifies a header string to be printed above the window. Default is no
header.
-trailer trailer
Specifies a trailer string to be printed below the window. Default is no trailer.
-landscape Prints the window in landscape mode. By default, a window is printed such
that its longest side follows the long side of the paper.
-portrait Prints the window in portrait mode. By default, a window is printed such that
its longest side follows the long side of the paper.
-rv Reverses the foreground and background colors.
-compact Compresses white pixels on PostScript printers.
-output filename
Specifies an output filcnamc. If this option is not specified, standard output is
used.
-append filename
Specifics a filcname previously produced by xpr to which the window con-
tents are to be appended.
-noff When specified in conjunction with -append, the window appears on the
same page as the previous window.
-split n Allows you to split a window onto several pages. This might be necessary for
large windows that would otherwise cause the printer to overload and print
the page in an obscure manner.
-plane number
Specifies which bit plane to use in an image. The default is to use the entire
image and map values into black and white based on color intensities.
(Available as of Release 4.)
-gray 21 31 a
Uses a simple 2x2, 3x3, or 4x4 gray scale conversion on a color image, rather
than mapping to strictly black and white. This doubles, triples, or quadruples
the effective width and height of the image. (Available as of Release 4.)
-psfig Suppress translation of the PostScript picture to the center of the page.
(Available as of Release 4.)
454 X Window System User's Guide
Print X Window Dump (continued) xpr
-density dpi Indicates what dot-per-inch density should be used by the HP printer. (Avail-
able as of Release 4.)
-cutoff level
Changes the intensity level where colors are mapped to either black or white
for monochrome output on a LaserJet printer. (Available as of Release 4.)
The level is expressed as percentage of full brightness. Fractions are
allowed. (Available as of Release 4.)
-noposition Causes header, trailer, and image positioning command generation to be
bypassed for LaserJet, PaintJet and PaintJet XL printers. (Available as of
Release 4.)
-gamma correction
Changes the intensity of the colors printed by PaintJet XL printer. The cor-
rection is a floating point value in the range 0.00 to 3.00. Consult the
operator's manual to determine the correct value for the specific printer.
(Available as of Release 4.)
-render algori thm
Allows PaintJet XL printer to render the image with the best quality versus
performance tmdeoff. Consult the operator's manual to determine which
al qori thms are available. (Available as of Release 4.)
-slide Allows overhead transparencies to be printed using the PaintJet and PaintJet
XL printers. (Available as of Release 4.)
Limitations
The current version of xpr can generally print out on the LN03 most X windows that are not
larger than two-thirds of the screen. For example, it will be able to print out a large emacs win-
dow, but it will usually fail when trying to print out the entire screen. The LN03 has memory
limitations that can cause it to incorrectly print very large or complex windows. The two most
common errors encountered are "band too complex" and "page memory exceeded." In the
first case, a window may have a particular band (a row six pixels deep) that contains too many
changes (from black to white to black). This will cause the printer to drop part of the line and
possibly parts of the rest of the page. The printer will flash the number '1' on its front panel
when this problem occurs. A possible solution to this problem is to increase the scale of the
picture, or to split the picture onto two or more pages. The second problem, "page memory
exceeded," will occur if the picture contains too much black, or if the picture contains complex
half-tones such as the background color of a display. When this problem occurs the printer will
automatically split the picture into two or more pages. It may flash the number '5' on its from
panel. There is no easy solution to this problem. It will probably be necessary to either cut and
paste, or rework the application to produce a less complex picture.
There are several limitations on the use of xpr with the LA100: the picture will always be
printed in portrait mode, there is no scaling, and the aspect ratio will be slightly off.
Support for PostScript output currently cannot handle the -append, -noff or -split
options.
X Window System User's Guide 455
xpr (continued) Print X Window Dump
The -compact option is only supported for PostScript output. It compresses white space but
not black space, so it is not useful for reverse-video windows.
For color images, should map directly to PostScript image support.
HP
Printer Specifics (Release 4)
If no -density is specified on the command line, 300 dots per inch will be assumed for l jet
and 90 dots per inch for pjet. Allowable densi ty values for a LaserJet printer are 300, 150,
100, and 75 dots per inch. Consult the operator's manual to determine densities supported by
other printers.
If no -scale is specified the image will be expanded to fit the printable page area.
The default printable page area is 8x10.5 inches. Other paper sizes can be accommodated using
the -height and -width options.
Note that a 1024x768 image fits the default printable area when processed at 100 dpi with
scale=l, the same image can also be printed using 300 dpi with scale=3 but will require con-
siderably more data be transferred to the printer.
xpr may be tailored for use with monochrome PCL printers other than the LaserJet. To print on
a ThinkJet (HP2225A) xpr could be invoked as:
% xpr -density 96 -width 6.667 filename
or for black-and-white output to a PaintJct:
% xpr -density 180 filename
The monochrome intensity of a pixel is computed as 0.30*R + 0.59"G + 0.11*B. If a pixel's
computed intensity is less than the -cutoff level it will print as white. This maps
light-on-dark display images to black-on-white hardcopy. The default cutoff intensity is 50%
of full brightness. Example: specifying -cutoff 87.5 moves the white/black intensity
point to 87.5% of full brightness.
A LaserJet printer must be configured with sufficient memory to handle the image. For a full
page at 300 dots per inch approximately 2MB of printer memory is required.
Color images are produced on the PaintJet at 90 dots per inch. The PaintJet is limited to sixteen
colors from its 330 color palette on each horizontal print line. xpr will issue a warning message
if more than sixteen colors are encountered on a line. xpr will program the PaintJet for the first
sixteen colors encountered on each line and use the nearest matching programmed value for
other colors present on the line.
Specifying the -rv, reverse video, option for the PaintJet will cause black and white to be
interchanged on the output image. No other colors are changed.
Multiplane images must be recorded by xwd in ZPixmap format. Single plane (monochrome)
images may be in either XYPixmap or ZPixmap format.
Some PCL printers do not recognize image positioning commands. Output for these printers
will not be centered on the page and header and trailer strings may not appear where expected.
456 X Window System User's Guide
Print X Window Dump (continued) xpr
The -gamma and -render options are supported only on the PainLlet XL printers.
The -s 1 ide option is not supported for LaserJet printers.
The -split option is not supported for HP printers.
See Also
xwd, xdpr, xwud, X
Copyright
Copyright 1988, Massachusetts Institute of Technology.
Copyright 1986, Marvin Solomon and the University of Wisconsin.
Copyright 1988, Hewlett-Packard Company.
See X for a full statement of rights and permissions.
Authors
Michael R. Gretzinger, MIT Project Athena;
Jose Capo, MIT Project Athena (PP3812 support);
Marvin Solomon (University of Wisconsin);
Bob Scheifler, MIT;
Angela Bock and E. Mike Durbin, Rich Inc. (grayscale);
Larry Rupp, Hewlett-Packard (HP printer support).
X Window System User's Guide 457
xprop (continued) Display Properties for X
Examples
To display the name of the root window: prop -root WM NAME
To display the window manager hints for the clock: xprop -name xclock WM HINTS
To display the start of the cut buffer: xprop -root -len 100 CUT BUFFER0
To display the point size of the fixed font: xprop -font fixed POINT SIZE
To display all the properties of window # 0x200007: xprop -id 0x2 0 0 0 0 7
Environment Variables
XPROPFORMATS
Specifies the name of a file from which additional formats are to be
obtained.
See Also
X, xwininfo
Author
Mark Lillibridge, MIT Project Athena.
462 X Window System User's Guide
reCreate Pseudo Root Window
xpseudoroot
Name
xpseudoroot - create a pseudo root window.
Syntax
xpseudoroot [opti ons]
Description
This client is available in Release 3 only. It is experimental and should be used with cau-
tion. (Please see Warning below.) xpseudoroot has been removed from the X distribution as
of Release 4.
The xpseudoroot program allows you to create pseudo root windows as outlined in the Inter-
Client Communications Conventions Manual. By default it just makes a copy of the normal
root window, but command line options may be used to alter much of the screen-related infor-
mation.
The command line argument property_name specifies the name of a property on the
screen's real root window in which to store the pseudo root information. Applications can be
run within the pseudo root window by appending .property_name to the
server, screen pan of the display name; for example: expo : 0.0. property_name.
Warning
This is experimental code for implementing pseudo root windows as specified by the Inter-Cli-
ent Communications Conventions Manual. The interfaces that it provides should be considered
private to the MIT implementation of Xlib and will change in the next release. The interfaces
that it provides should not be incorporated into any toolkits or applications. No effort will be
made to provide backward compatibility.
Options
-display [host] : server[, screen]
Allows you to specify the host, sewer and screen to connect to. host speci-
fies the machine, server specifies the server number, and screen specifies
the screen number. For example,
xpseudoroot -display your_n ode:O.l
specifies screen 1 of server 0 on the machine your_node. Either or both the
host and screen elements to the display specification can be omitted. If
host is omitted, the local machine is assumed. If screen is omitted, screen
0 is assumed (and the period is unnecessary). The colon and server are
necessary in all cases.
-geometry geometry
The xpseudoroot window is created with the specified size and location deter-
mined by the supplied geometry specification. The -geometry option can
be (and often is) abbreviated to -g, unless there is a conflicting option that
begins with "g." The argument to the geometry option (geometry) is
referred to as a "standard geometry string," and has the form widthx-
h ei gh t+_xo ff_yoff.
X Window System User's Guide 463
xpseudoroot (continued) Create Pseudo Root Window
-visuals visualid
Specifies a list of visuals to support on the pseudo root window. Any number
of numeric visual identifies (in hex, octal, or decimal) may be supplied using
the -visuals option.
-colormap col ormapid
Specifies the numeric colormap identifier to be associated with the pseudo
root window.
-Colormap visualid
Specifies a numeric visual identifier to be used in creating a new colormap for
the pseudo root window. If this option is given, xpseudoroot will create a
new colormap from the given visual and set the black and white pixel fields
to the desired colors.
-white pixel
Specifies the numeric pixel value to use for WhitePixel when creating a
new colormap with -Colormap. The default is to copy the real screen's
WhitePixel.
-White colorname
Specifies the color to use when setting WhitePixel in newly created color-
maps. It may be used with -white to create arbitrary WhitePixels.
-black pixel
Specifies the numeric pixel value to use for BlackPixel when creating a
new colormap with -Colormap. The default is to copy the real screen's
BlackPixel.
-Black colorname
Specifies the color to use when setting BlackPixel in newly created color-
maps. It may be used with -black to create arbitrary BlackPixels.
-empty Indicates that any colormaps created with -Colormap should not have
BlackPixel and WhitePixel preallocated (although the values may still
be set with -black and -white). This leaves as much room as possible for
running applications that would otherwise not find enough colors. This is not
for general use as it guarantees that an application will be displayed in incor-
rect colors.
-max number Specifies the maximum number of installed colormaps that will be allowed on
this screen. The default is to use the real screen's value.
-rain number Specifies the minimum number of installed colormaps that will be allowed on
this screen. The default is to use the real screen's value.
-backingstore when
Specifies when backing store window attributes will be honored and takes
one of the following arguments: NotUseful, WhenMapped, or Always.
The default is to use the real screen's value.
464 X Window System User's Guide
Create Pseudo Root Window (continued) xpseudoroot
-saveunders boolean
Specifies whether or not this screen supports save-unders and takes one of the
following arguments: yes or no.
-name string
Specifies the name to be used for the pseudo root window.
See Also
X, xdpyinfo, xwininfo, xprop; Volume One, Xlib Programming Manual
Bugs
This is a sample program that is primarily intended as a testbed for ICCCM pseudo roots. It
should not be incorporated into any toolkit or application.
Author
Jim Fulton, MIT X Consortium.
X Window System User's Guide 465
xrdb
L Server Resource Database Utlllty--
Name
xrdb - X server resource database utility.
Syntax
xrdb [options] [ f i l ename]
Description
xrdb is used to get or set the contents of the RESOURCE_MANAGER property on the root win-
dow of screen 0. You would normally run this program from your X startup file.
The resource manager (used by the Xlib routine XGetDefault(3X) and the X Toolkit) uses the
RESOURCE_MANAGER property to get user preferences about color, fonts, and so on for appli-
cations. Having this information in the server (where it is available to all clients) instead of on
disk, solves the problem in previous versions of X that required you to maintain defaults files
on every machine that you might use. It also allows for dynamic changing of defaults without
editing files.
For compatibility, if there is no RESOURCE_MANAGER property defined (either because xrdb
was not run or the property was removed), the resource manager will look for a file called .Xde-
faults in your home directory.
The fi/ename (or the standard input if- or no input file is given) is optionally passed through
the C preprocessor with the following symbols defined, based on the capabilities of the server
being used:
SERVERHOST=hostname
HOST=hostname
The hostname portion of the display to which you are connected.
WIDTH=number
The width of the default screen in pixels.
HEIGHT=number
The height of the default screen in pixels.
X RESOLUTION=number
--
The x resolution of the default screen in pixels per meter.
Y RESOLUTION=number
--
The y resolution of the default screen in pixels per meter.
PLANES=number
The number of bit planes (the depth) of the root window of the default screen.
CLAS S=vi sual cl a ss
One of StaticGray, GrayScale, StaticColor, PsuedoColor,
TrueColor, DirectColor. This is the visual class of the root window
of the default screen.
COLOR Defined only if CLASS is one of StaticColor, PsuedoColor, True-
Color, or DirectColor.
466 X Window System User's Guide
X Server Resource Database Utility (continued) xrdb
BITS PER RBG=number
The number of significant bits in an RGB color specification. This is the log
base 2 of the number of distinct shades of each primary that the hardware can
generate. Note that it is usually not related to the number of PLANES.
CLIENTHOST=hostname
The name of the host on which xrdb is running. (Available as of Release 4.)
RELEASE=number
The vendor release number for the server. The interpretation of this number
will vary depending on VENDOR. (Available as of Release 4.)
REVI S ION=n umber
The X protocol minor version supported by this server (currently 0).
VERS I ON=n umber
The X protocol major version supported by this server (should always be 11).
VENDOR=n umber
A string specifying the vendor of the server. (Available as of Release 4.)
Lines that begin with an exclamation mark (!) are ignored and may be used as comments.
Options
xrdb accepts the following options:
-help This option (or any unsupported option) will cause a brief description of the
allowable options and parameters to be printed.
-display [host] : server[.screen]
Allows you to specify the host, server and screen to connect to. host speci-
fies the machine, server specifies the server number, and screen specifies
the screen number. For example:
xrdb -display your_node" O. 0
specifies screen 0 of server 0 on the machine your_node. If the host is
omitted, the local machine is assumed. If the screen is omitted, screen 0 is
assumed; the server and colon (:) are necessary in all cases.
-cpp filename
Specifies the pathname of the C preprocessor program to be used. Although
xrdb was designed to use CPP, any program that acts as a filter and accepts
the -D, -I, and -U options may be used.
-nocpp Indicates that xrdb should not run the input file through a preprocessor before
loading it into the RESOURCE_MANAGER property.
-symbols Indicates that the symbols that are defined for the preprocessor should be
printed onto the standard output. This option can be used in conjunction with
-query, but not with the options that change the RESOURCE_MANAGER
property.
i-
X Window System User's Guide 467
xrdb (continued) X Server Resource Database Utility
-query Indicates that the current contents of the RESOURCE_MANAGER property
should be printed onto the standard output. Note that since preprocessor
commands in the input resource file are part of the input file, not part of the
property, they won't appear in the output from this option. The -edit
option can be used to merge the contents of the property back into the input
resource file without damaging preprocessor commands.
-load Indicates that the input should be loaded as the new value of the
RESOURCE_MANAGER property, replacing whatever was there (i.e., the old
contents are removed). This is the default action.
-me rge Indicates that the input should be merged with, instead of replacing, the cur-
rent contents of the RESOURCE_MANAGER property. Since xrdb can read
the standard input, this option can be used to the change the contents of the
RESOURCE_MANAGER property directly from a terminal or from a shell
script. Note that this option does a lexicographic sorted merge of the two
inputs, which is almost certainly not what you want, but remains for back-
ward compatibility.
-n Indicates that changes to the property (when used with -load) or to ',.he
resource file (when used with -edit) should be shown on the standard
output, but should not be performed. (Available as of Release 4.)
-quiet Indicates that warning about duplicate entries should not be displayed.
(Available as of Release 4.)
-remove Indicates that the RESOURCE_MANAGER property should be removed from
its window.
-retain Indicates that the server should be instructed not to reset ifxrdb is the first
client. (Available as of Release 4.)
-edit filename
Indicates that the contents of the RESOURCE_MANAGER property should be
edited into the given file, replacing any values already listed there. This
allows you to put changes that you have made to your defaults back into your
resource file, preserving any comments or preprocessor lines.
-backup string
Specifies a suffix to be appended to the filename used with -edit to gener-
ate a backup file.
-Dname [ =val ue ]
Is passed through to the preprocessor and is used to define symbols for use
with conditionals such as #ifdef.
-Uname IS passed through to the preprocessor and is used to remove any definitions of
this symbol.
-Idirectory Is passed through to the preprocessor and is used to specify a directory to
search for files that are referenced with #include.
468 X Window System User's Guide
X Server Resource Database Utility (continued) xrdb
Flies
Generalizes 7.Xdefaults files.
See Also
X, XGetDefault(3X), Xlib Resource Manager
Bugs
The default for no arguments should be to query, not to overwrite, so that it is consistent with
other programs.
Authors
Phil Karlton, rewritten from the original by Jim Gettys. Copyright 1988, Digital Equipment
Corporation.
X Window System User's Guide 469
Refresh X Screen (continued) xrefresh
Resources
The xrefresh program uses the routine XGetDefault(3X) to read defaults, so its resource names
are all capitalized.
Black, White, Solid, None, Root
Determines what sort of window background to use.
Geomet ry Determines the area to refresh. Not very useful.
See Also
X
Bugs
It should have just one default type for the background.
Author
Jim Gettys, Digital Equipment Corp., MIT Project Athena.
X Window System User's Guide 471
xset
'lsplay and Keyboard Preferences--
Name
xset - user preference utility for X.
Syntax
xset [opti ons]
Description
xset is used to set various user preference options of the display and keyboard.
Options
Note that not all X implementations are guaranteed to honor all of these options.
-display [host]:server[.screen]
Allows you to specify the host, server, and screen for which to set prefer-
ences, hose specifies the machine, server specifies the server number, and
screen specifies the screen number. For example,
-display your_node: O. 1 &
specifics screen l of server 0 on the machine your_node. If the host is
omitted, the local machine is assume(i If the screen is omitted, screen 0 is
assumed; the server and colon (:) are necessary in all cases.
b Controls bell volume, pitch, and duration. The b option accepts up to three
numerical parameters (vol ume, pi t ch, and durati on), a preceding dash
(-), or an on/off flag. If no parameters are given, or the on flag is used, the
system defaults will be used. If the dash or off are given, the bell will be
turned off. If only one numerical parameter is given, the bell vo2 ume will
be set to that value, as a percentage of its maximum. Likewise, the second
numerical parameter specifies the bell/9./tch, in hertz, and the third numeri-
cal parameter specifies the durat./on in milliseconds. Note that not all
hardware can vary the bell characteristics. The X server will set the charac-
teristics of the bell as closely as it can to the user's specifications.
-be Controls bug compatibility mode in the server, if possible. The option with a
bc preceding dash (-) disables the mode; the option alone enables the mode.
The need for this option is determined by the following circumstances. Vari-
ous pre-R4 clients pass illegal values in some protocol requests, and pre-R4
servers did not correctly generate errors in these cases. Such clients, when
run with an R4 server, will terminate abnormally or otherwise fail to operate
correctly. Bug compatibility mode explicitly reintroduces certain bugs into
the X server, so that many such clients can still be run.
This mode should be used with care; new application development should be
done with this mode disabled. Be aware that the server must support the MIT-
SUNDRY-NONSTANDARD protocol extension in order for this option to work.
472 X Window System User's Guide
xset (continued) Display and Keyboard Preferences
WhitePixel. Although these are often 0 and 1, they need not be. Also, a
server may choose to allocate those colors privately, in which case an error
will be generated. The map entry must not be a read-only color, or an error
will result.
Controls the autorepeat. If a preceding dash or the off flag is used,
autorepeat will be disabled. If no parameters or the on flag is used,
autorepeat will be enabled.
Controls the screen saver parameters. The s option accepts up to two numer-
ical parameters (time and cycle), a blank/noblank flag, an
expose/noexpose flag, an on/off flag, or the default flag. If no
parameters or the default flag is used, the system will be set to its default
screen saver characteristics. The on/off flags simply turn the screen saver
functions on or off. The blank flag sets the preference to blank the video (if
the hardware can do so) rather than display a background pattern, while
noblank sets the preference to display a pattern rather than blank the video.
The expose flag sets the preference to allow window exposures (the server
can freely discard window contents), while noexpose sets the preference to
disable screen saver unless the server can regenerate the screens without
causing exposure events. The time and cycle parameters for the screen
saver function determine how long the server must be inactive for screen sav-
ing to activate, and the period to change the background pattern to avoid burn
in, respectively. The arguments are specified in seconds. If only one numeri-
cal parameter is given, it will be used for the time.
Gives you information on the current settings. (In Release 3, the query
option can also be used.)
These settings will be reset to default values when you log out.
See Also
X, Xserver, xmodmap, xrdb, xsetroot
Authors
Bob Scheifler, MIT Laboratory for Computer Science;
David Krikorian, MIT Project Athena (X11 version).
474 X Window System User's Guide
Define Standard Colormaps
jr xstdcmap
Name
xstdcmap - X standard colormap utility.
Syntax
xstdcmap [options]
Description
Available as of Release 4, the xstdcmap utility can be used to selectively define standard color-
map properties. It is intended to be run from a user's X startup script to create standard color-
map definitions in order to facilitate sharing of scarce colormap resources among clients.
Where at all possible, colormaps are created with read-only allocations.
Options
The following options may be used with xstdcmap:
-display host [ : server] [. screen]
Allows you to specify the host, server and screen to connect to. host speci-
fies the machine, server specifies the server number, and screen specifies
the screen number. For example,
xstdcmap -display your_node: O. 1
specifies screen l of server 0 on the machine your_node. Either or both the
host and screen elements to the display specification can be omitted. If
host is omitted, the local machine is assumed. If screen is omitted, screen
0 is assumed (and the period is unnecessary). The colon and server are
necessary in all cases.
-all Specifies that all six standard colormap properties should be defined on each
screen of the display. Not all screens will support visuals under which all six
standard colormap properties are meaningful, xstdcmap will determine the
best allocations and visuals for the colormap properties of a screen. Any pre-
viously existing standard colormap properties will be replaced.
-best Specifies that the RGB_BEST_MAP should be defined.
-blue Specifies that the RGB_BLUE_MAP should be defined.
-default Specifies that the RGB_DEFAULT_MAP should be defined.
-delete map Specifies that a standard colormap property should be removed, map may be
one of: default, best, red, green, blue, or gray.
-gray Specifies that the RGB_GRAY_MAP should be defined.
-green Specifies that the RGB_GREEN_MAP should be defined.
-help Specifies that a brief description of the command line arguments should be
printed on the standard error. This will be done whenever an unhandled argu-
ment is given to xstdcmap.
X Window System User's Guide 477
xstdcmap (continued) Define Standard Colormaps
-red
-verbose
See Also
Specifies that the RGB_RED_MAP should be defined.
Specifies tlmt xstdcmap should print logging information as it parses its input
and defines the standard colormap properties.
Author
Donna Converse, MIT X Consortium.
478 X Window System User's Guide
mWindow Terminal Emulator
xterm
Name
xterm - window terminal emulator.
Syntax
xterm [options]
Description
The xterm program is a terminal emulator for the X Window System. It provides DEC VTI02
and Tektronix 4014 compatible terminals for programs that can't use the window system
directly. If the underlying operating system supports terminal resizing capabilities (for
example, the SIGWlNCH signal in systems derived from BSD 4.3), xterm will use the facilities to
notify programs running in the window whenever it is resized.
The VTI02 and Tektronix 4014 terminals each have their own window so that you can edit text
in one and look at graphics in the other at the same time. To maintain the correct aspect ratio
(height/width), Tektronix graphics will be restricted to the largest box with a 4014's aspect
ratio that will fit in the window. This box is located in the upper left area of the window.
Although both windows can be displayed at the same time, one of them is considered the active
window for receiving keyboard input and terminal output. This is the window that contains the
text cursor and whose border highlights whenever the pointer is in either window. The active
window can be chosen through escape sequences, the VT Options menu in the VTI02 window,
and the Tek Options menu in the 4014 window.
The Release 4 version of xterm provides four menus that allow you to manipulate the VTI02
and Tektronix windows: Main Options, VT Options, Tek Options, and VT Fonts. The first three
menus are available (with slight variations) in Release 3, but have the names xterm, Modes, and
Tektronix. The VT Fonts menu is available as of Release 4.
Options
xterm accepts all of the standard X Toolkit command line options along with the additional
options described below. Note that if the option begins with a + instead of a -, the option is
restored to its default value. (Specifying the default with +option can be useful for overrid-
ing the opposite value in an .Xresources file or other prior resource specification.)
-help Causes xterm to print out a verbose message describing its options.
-132 Causes the VT102 DECCOLM escape sequence, which switches between 80
and 132 column mode, to be recognized, enabling the xterm window to resize
properly. By default, the DECCOLM escape sequence is ignored. (See
Appendix C for more information on xterm escape sequences.)
(This option can be turned on and off from the xterm VT Options menu,
described below.)
-ah/+ah -ah specifies that xterm should always highlight the text cursor and window
borders. By default, xterm will display a hollow text cursor whenever the
focus is lost or the pointer leaves the window. +ah sets the default.
X Window System User's Guide 479
Window Terminal Emulator (continued) xterm
% ge ome try
#geometry
-n string
-r
-w pixels
-T string
This option has been superceded by the xdm program. Furthermore, -L
should never be specified by users when starting terminal windows. This
option has been eliminated in Release 4.
Specifies the preferred size and location of the Tektronix window. It is short-
hand for specifying the tekGeomet ry resource.
Specifies the preferred position of the icon. It is shorthand for specifying the
iconGeometry resource. The width and height values of the geometry
string are optional.
Specifies the icon name for the xterm window. It is shorthand for specifying
the *iconName resource. Note that this is not equivalent to the Toolkit
option -name. The default icon name is the name of a program run with the
-e option, if any, otherwise the application name.
Indicates that reverse video should be simulated by swapping the foreground
and background colors. It is equivalent to -rv.
Specifies the width in pixels of the border surrounding the window. It is
equivalent to -bw.
Specifies the title for the xterm window. It is equivalent to -t it le.
Resources
The program understands all of the core X Toolkit resource names and classes as well as:
iconGeomet ry (class IconGeomet ry)
Specifies the preferred size and position of the application when iconified. It
is not necessarily obeyed by all window managers.
t e rmName (class Te rmName)
Specifies the terminal type name to be set in the TERM environment variable.
title (class Title)
Specifies a string that may be used by the window manager when displaying
this application.
ttyModes (class TtyModes)
Specifies a string containing terminal setting keywords and the characters to
which they may be bound. (In Release 3, this resource is ignored when -L is
given since getty resets the terminal. The -L option has been eliminated in
Release 4.) Allowable keywords include: intr, quit, erase, kill, eof, eol,
swtch, start, stop, brk, susp, dsusp, rprnt, flush, weras, and lnext. Control
characters may be specified as "char (e.g., *c or "u), and "? may be used to
indicate delete. This is very useful for overriding the default terminal settings
without having to do an stty every time an xterm is started.
utmpInhibit (class UtmpInhibit)
Specifies whether or not xterm should try to record the user's terminal in
letclutmp.
.C
X Window System User's Guide 485
xterm (continued) Window Terminal Emulator
sunFunct ionKeys (class SunFunct ionKeys)
Specifies whether or not Sun Function Key escape codes should be generated
for function keys instead of standard escape sequences.
The following resources are specified as part of the vt 10 0 widget (class VT 10 0):
a 1 lowSendEvent s (class A1 lowSendEvent s)
Specifies whether or not synthetic key and button events (generated using the
X protocol SendEvent request) should be interpreted or discarded. The
default is false meaning they are discarded. Note that allowing such events
creates a very large security hole. (Available as of Release 4.)
a i ways H igh i ight (class Always High i ight)
Specifies whether or not xterm should always display a highlighted text cur-
sor. By default, a hollow text cursor is displayed whenever the pointer moves
out of the window or the window loses the input focus.
boldFont (class Font)
Specifies the name of the bold font to use instead of overstriking the normal
font.
c132 (class C132)
Specifies whether or not the VT102 DECCOLM escape sequence should be
honored. The default is false.
charClass (class CharClass)
Specifies comma-separated lists of character class bindings of the form
flow-]high:value. These are used in determining which sets of characters
should be treated the same when doing cut and paste. See "Character
Classes" below.
curses (class Curses)
Specifies whether or not the last column bug in the cursor should be worked
around. The default is false.
background (class Background)
Specifies the color to use for the background of the window. The default is
white.
foreground (class Foreground)
Specifies the color to use for displaying text in the window. Setting the class
name instead of the instance name is an easy way to have everything that
would normally appear in the "text" color change color. The default is black.
cursorColor (class Foreground)
Specifies the color to use for the text cursor. The default is black.
eightBit Input (class EightBit Input)
Specifies whether or not eight-bit characters should be accepted. The default
is true. (Available as of Release 4.)
486 X Window System User's Guide
Window Terminal Emulator (continued) xterm
tekGeomet ry (class Geometry)
Specifies the preferred size and position of the Tektronix window.
tekInhibit (class TekInhibit)
Specifies whether or not Tektronix mode should be disallowed. The default is
false.
tekSmall (class TekSmall)
Specifics whether or not the Tektronix mode window should sn in i smal-
lest size if no explicit geometry is given. This is useful when running xterm
on displays with small screens. The default is false. (Available as of Release
4.)
tekStartup (class TekStartup)
Specifies whether or not xterm should start up in Tektronix mode. The default
is false.
titeInhibit (class TiteInhibit)
Specifies whether or not xterm should remove t i or te termcap entries (used
to switch between alternate screens on startup of many screen-oriented pro-
grams) from the TERMCAP string.
translations (class Translations)
Specifies the key and button bindings for menus, selections, "programmed
strings," etc. See "Actions" below.
visualBell (class VisualBell)
Specifies whether or not a visible bell (i.e., flashing) should be used instead of
an audible bell when Control-G is received. The default is false.
waitForMap (class WaitForMap)
Specifies whether or not xterm should wait for the initial window map before
starting the subprocess. The default is false. (Available as of Release 4.)
The following resources are specified as part of the tek4 014 widget (class Tek4 014):
width (class Width)
Specifies the width of the Tektronix window in pixels.
height (class Height)
Specifies the height of the Tektronix window in pixels.
fontLarge (class Font)
Specifies the large font to use in the Tektronix window. (Available as of
Release 4.) This font is toggled using the Large Characters item on the Tek
Options menu.
font2 (class Font)
Specifies font number 2 to use in the Tektronix window. (Available as of
Release 4.) This font is toggled using the #2 Size Characters item on the Tek
Options menu.
X Window System User's Guide 489
Window Terminal Emulator (continued) xterm
quit (class SmeBSB)
Invokes the quit () action.
The vtMenu (dtle VT Options) has the following entries:
scrollbar (class SmeBSB)
Invokes the set-scrollbar (toggle) action.
jumpscroll (class SmeBSB)
Invokes the set-jumpscroll (toggle) action.
reversevideo (class SmeBSB)
Invokes the set-reverse-video (toggle) action.
autowrap (class SmeBSB)
Invokes the set-autowrap (toggle) action.
reversewrap (class SmeBSB)
Invokes the set-reversewrap (toggle) action.
autolinefeed (class SmeBSB)
Invokes the set-autolinefeed (toggle) action.
appcursor (class SmeBSB)
Invokes the set-appcursor (toggle) action.
appkeypad (class SmeBSB)
Invokes the set-appkeypad (toggle) action.
scrollkey (class SmeBSB)
Invokes the set-scroll-on-key (toggle) action.
scrollttyoutput (class SmeBSB)
Invokes the set-scroll-on-tty-output (toggle) action.
allow132 (class SmeBSB)
Invokes the set-allow132 (toggle) action.
cursesemul (class SmeBSB)
Invokes the set-cursesemul (toggle) action.
visualbell (class SmeBSB)
Invokes the set -vi sua ibe 11 (toggle) action.
marginbell (class SmeBSB)
Invokes the set-marginbell (toggle) action.
altscreen (class SmeBSB)
This entry is currently disabled.
linel (class SmeLine)
A separator.
softreset (class SmeBSB)
Invokes the soft-reset ( ) action.
X Window System User's Guide 491
Window Terminal Emulator (continued) xterm
Cursor Key
(Arrow)
Right
Left
Reset
(Cursor)
ESC [ A
ESC [ B
ESC [C
ESC [ D
Set
(Application)
ESC O A
ESC O B
ESC O C
ESC O D
Enable Application Keypad (Release 3: Application Keypad Mode)
Generates a control function rather than a numeric character when you
use the numeric keypad. Off by default.
Scroll to Bottom on Key Press
Indicates that pressing a key while using the scrollbar causes the cur-
sor to be repositioned at the bottom of the scroll region. For example,
if you have scrolled up the window to see past history, as soon as you
begin typing your next command the cursor jumps to the bottom of the
screen. Off by default.
Scroll to Bottom on Tty Output
Indicates that receiving output to the window (or pressing a key, if
st:t:y echo has been specified), while using the scrollbar causes the
cursor to be repositioned at the bottom of the scroll region. In Release
4, on by default. (In Release 3, off by default; on automatically if the
window has a scrollbar.) This mode can be toggled off, but is gener-
ally desirable to have.
Allow 80/132 Column Switching (Release 3: Allow 80/132 switching)
Allows xterm to recognize the DECCOLM escape sequence, which
switches the terminal between 80 and 132-column mode. The DEC-
COLM escape sequence can be included in a program (such as a
spreadsheet) to allow the program to display in 132-column format.
See Appendix E, xterm Control Sequences, for more information. Off
by default.
Enable Curses Emulation (Release 3: Curses Emulation)
Enables the curses fix. Several programs that use the curses cursor
motion package have some difficulties with VTl02-compatible termi-
nals. The bug occurs when you run the more program on a file con-
taining a line that is exactly the width of the window and that is fol-
lowed by a line beginning with a tab. The leading tabs may disappear.
This mode causes the tabs to be displayed correctly. Off by default.
Enable Visual Bell
Causes your terminal window to flash whenever an event occurs that
would ordinarily cause your terminal bell to ring. This item appears as
X Window System User's Guide 499
Window Terminal Emulator (continued) xterm
Large Characters
#2 Size Characters
#3 Size Characters
Small Characters
V'I" Window Showing
Tek Options Menu Mode Toggles (On/Off)
These modes can only be set from the Tek Options menu.
Selecting one of these four options sets the point size of text
displayed in the Tektronix window. The four options are
mutually exclusive.
Shows the current contents of the VT102 window; you cannot input
to that window until you choose Switch to VT Mode. This item is a
mode toggle on the equivalent Release 3 menu (Tektronix). In
Release 4, it has been renamed and moved to the commands section,
as described below.
Tek Options Menu Commands
PAGE Clears the Tektronix window.
RESET Closes down the Tektronix window.
COPY Writes a file of the Tektronix text and graphics commands.
Show VT Window (Release 3: VT Window Showing)
Shows the current contents of the VT102 window; you cannot input
to that window until you choose Switch to VT Mode. The Release 3
item appeared in the mode toggles section of the menu; the item has
been renamed and moved to the commands section in Release 4.
Switch to V'I" Mode (Release 3: Select V'I" Mode)
Makes the associated VT102 window active for input.
Hide Tek Window Removes the Tektronix window but does not destroy it. It can be
brought back by choosing Switch to Tek Mode from the V'I" Options
Menu menu.
VT
Fonts Menu (Release 4)
Added in Release 4, the VT Fonts menu enables you to change the VT102 display font dynami-
cally. The menu is displayed when the Control key and pointer button three are pressed in the
VT102 window. All items on the menu toggle different display fonts. The items are mutually
exclusive. A checkmark appears on the menu next to the current fonL
Default
Tiny
Small
Medium
Large
Selecting one of these five options sets the point size of text
displayed in the VT102 window. The Default font
is the font specified when the xterm was run.
Escape Sequence
Allows you to select a font previously toggled using an escape
sequence. See Chapter 5, Font Specification, for the escape
sequence to use.
X Window System User's Guide 501
Window Terminal Emulator (continued) xterm
This resource is simply a list of range : value pairs where the range is either a single number
or low-high in the range of 0 to 127, corresponding to the ASCI/code for the character or char-
acters to be set. The va2 ue is arbitrary, although the default table uses the character number
of the first character occurring in the set.
The default table is:
static int charClass[128] = {
/* NUL SOH STX ETX EOT ENQ ACK BEL */
32, i, i, i, I, i, i, I,
/* BS HT NL VT NP CR SO SI */
i, 32, I, I, i, I, I, i,
/* DLE DCI DC2 DC3 DC4 NAK SYN ETB */
i, I, I, I, I, I, I, I,
/* CAN EM SUB ESC FS GS RS US */
I, I, I, i, I, I, i, I,
/* SP ! " # $ % & " */
32, 33, 34, 35, 36, 37, 38, 39,
/* ( ) * + , - . / */
40, 41, 42, 43, 44, 45, 46, 47,
/* 0 1 2 3 4 5 6 7 */
48, 48, 48, 48, 48, 48, 48, 48,
/* 8 9 : ; < = > 9 */
48, 48, 58, 59, 60, 61, 62, 63,
/* @ A B C D E F G */
64, 48, 48, 48, 48, 48, 48, 48,
/* H I J K L M N O */
48, 48, 48, 48, 48, 48, 48, 48,
/* P Q R S T U V W */
48, 48, 48, 48, 48, 48, 48, 48,
I* X Y Z [ \ ] ^ *I
--
48, 48, 48, 91, 92, 93, 94, 48,
/* ' a b c d e f g */
96, 48, 48, 48, 48, 48, 48, 48,
/* h i J k 1 m n o */
48, 48, 48, 48, 48, 48, 48, 48,
/* p q r s t u v w */
48, 48, 48, 48, 48, 48, 48, 48,
/* x y z { I } - DEL */
48, 48, 48, 123, 124, 125, 126, I};
For example, the string "33:48,37:48,45-47:48,64:48" indicates that the exclamation mark,
percent sign, dash, period, slash, and ampersand characters should be treated the same way as
characters and numbers. This is very useful for cutting and pasting electronic mailing
addresses and UNIX filenames.
Actions (Release 4)
It is possible to rebind keys (or sequences of keys) to arbitrary strings for input, by changing the
translations for the vtl00 or tek4014 widgets. Changing the translations for events other
i-
X Window System User's Guide 503
xterm (continued) Window Terminal Emulator
quit ( )
Sends a SIGHUP to the subprogram and exits. It is also invoked by the quit entry in
ma inMenu.
set-scrollbar (onCffCoggle)
Toggles the scrollbar resource and is also invoked by the scrollbar entry in vt-
Menu.
set- jumpscroll ( on/off/toggl e)
Toggles the jumpscroll resource and is also invoked by the jumpscroll entry in
vtMenu.
set-reverse-video (onCffCoggle)
Toggles the reverseVideo resource and is also invoked by the reversevideo entry
in vtMenu.
set -aut owrap ( on/off/t oggl e)
Toggles automatic wrapping of long lines and is also invoked by the autowrap entry in
vtMenu.
set-reversewrap ( on/off /t oggl e)
Toggles the reversewrap resource and is also invoked by the reversewrap entry in
vtMenu.
set - aut o i ine feed ( on/off/t oggl e)
Toggles automatic insertion of linefeeds and is also invoked by the autolinefeed entry
in vtMenu.
set-appcursor ( on /o f f /t oggl e)
Toggles the application cursor key mode and is also invoked by the appcursor entry in
vtMenu.
set-appkeypad ( on/off /t oggl e)
Toggles the application keypad mode and is also invoked by the appkeypad entry in vt-
Menu.
set - sc rol l-on-key ( on/off/t oggl e)
Toggles the scrollKey resource and is also invoked from the scrollkey entry in vt-
Menu.
set-scroll-on-tty-output (onCffCoggle)
Toggles the scrollTtyOutput resource and is also invoked from the scrollt-
tyoutput entry in vtMenu.
set-allow132 (onCffCoggle)
Toggles the c132 resource and is also invoked from the allow132 entry in vtMenu.
set-cursesemul (onCffCoggle)
Toggles the curses resource and is also invoked from the cursesemul entry in vt-
Menu.
506 X Window System User's Guide
xterm (continued) Window Terminal Emulator
Shift <KeyPress> Prior:
Shift <KeyPress> Next:
Shift <KeyPress> Select:
Shift <KeyPress> Insert:
-Meta <KeyPress>:
Meta <KeyPress>:
Ctrl ~Meta <BtnlDown>:
-Meta <BtnlDown>:
-Meta <BtnlMotion>:
Ctrl -Meta <Btn2Down>:
-Ctrl -Meta <Btn2Down>:
~Ctrl -Meta <Btn2Up>:
Ctrl -Meta <Btn3Down>:
-Ctrl -Meta <Btn3Down>:
-Meta <Btn3Motion>:
-Ctrl -Meta
<BtnDown>:
scroll-back(l,halfpage)\n\
scroll-forw(l,halfpage)\n\
select-cursor-start()\
select-cursor-end (PRIMARY, CUT BUFFER0) \n\
--
insert-selection (PRIMARY, CUT_BUFFERO ) \ n \
insert-seven-bit()\n\
insert-eight-bit()\n\
popup-menu(mainMenu)\n\
select-start()\n\
select-extend()\n\
popup-menu (vtMenu) \n\
ignore () \n\
insert-selection (PRIMARY, CUT BUFFER0) \n\
--
popup-menu(fontMenu)\n\
start-extend()\n\
select-extend()\n\
<BtnUp>:
bell(0)
The default bindings in the Tektronix window are:
-Meta <KeyPress>:
Meta <KeyPress>:
Ctrl -Meta <BtnlDown>:
Ctrl -Meta <Btn2Down>:
Shift -Meta <BtnlDown>:
-Meta <BtnlDown>:
Shift -Meta <Btn2Down>:
-Meta <Btn2Down>:
Shift ~Meta <Btn3Down>:
-Meta <Btn3Down>:
insert-seven-bit ( ) \n\
insert-eight-bit ( ) \n\
popup-me nu (ma inMe nu ) \ n \
popup-menu (tekMenu) \n\
gin-press (L) \n\
gin-press (i) \n\
gin-press (M) \n\
gin-press (m) \n\
gin-press (R) \n\
gin-press (r)
Below is a sample how of the keymap ( ) action is used to add speci keys for entering com-
monly-typed works:
*VTl00.Translations: #override <Key>Fl3: keymap(dbx)
*VTl00.dbxKeymap.translations: \
<Key> FI4:
<Key> FI7:
<Key> FI8:
<Key> FI9:
<Key> F20:
keymap (None) \n\
string("next") string(0x0d)kn\
string ("step") string (0x0d) \n\
string ("continue") string (0x0d) \n\
string("print ") insert-selection (PRIMARY, CUT BUFFER0)
--
Actions (Release 3)
It is possible to rebind keys (or sequences of keys) to arbitrary strings for input, by changing the
translations for the vtl00 or tek4014 widgets. Changing the translations for events other
than key and button events is not expected, and will cause unpredictable behavior.
508 X Window System User's Guide
Window Terminal Emulator (continued) xterm
The actions available for key translations are:
insert ( )
Processes the key in the normal way; i.e., inserts the ASCII character code
corresponding to the keysym found in the keyboard mapping table into the
input stream.
string (string)
Rebinds the key or key sequence to the string value; that is, inserts the string
argument into the input stream. Quotation is necessary if the string contains
whitespace or non-alphanumeric characters. If the string argument begins
with the characters "0x", it is interpreted as a hex character constant and the
corresponding character is sent in the normal way.
keymap (name)
Takes a single string argument naming a resource to be used to dynamically
define a new translation table; the name of the resource is obtained by
appending the string Keymap to name. The keymap name None restores
the original translation table (the very first one; a stack is not maintained).
Upper/lower case is significant.
insert-selection ( name[,name] . . . )
Retrieves the value of the first (leftmost) named selection that exists or cut
buffer that is non-empty and inserts the value into the input stream, name is
the name of any selection, for example, PRIMARY or SECONDARY, or the
name of a cut buffer: CUT_BUFFER0 ..... CUT_BUFFER7. Upper/lower case
is significant.
For example, a debugging session might benefit from the following bindings:
*VTl00.Translations: #override <Key>Fl3: keymap(dbx)
*VTl00.dbxKeymap.translations : \
<Key>Fl4: keymap(None) \n\
<Key>Fl7: strlng("next") string(0x0d) \n\
<Key>Fl8: string ("step") strlng(0x0d) \n\
<Key>Fl9: strlng("contlnue") string(0x0d) \n\
<Key>F20 : string ("print") insert-selection (PRIMARY, CUT_BUFFER0)
Within the VT100 widget the key and button bindings for selecting text, pasting text, and
activating the menus are controlled by the translation bindings. In addition to the actions listed
above under Key Translations, the following actions are available:
mode-menu ( ) Posts one of the two mode menus, depending on which button is pressed.
select-start ( )
Unselects any previously selected text and begins selecting new texL
select-extend ( )
Continues selecting text from the previous starting position.
start-extend ( )
Begins extending the selection from the farthest (left or right) edge.
io
X Window System User's Guide 509
Window Terminal Emulator (continued) xterrn
Some versions of init have relatively small program name buffer sizes and treat all sharp signs
as comment delimiters. Sites that wish to list large numbers of options on the xterm line will
need to write a small shell script to execute the long xterm line. The best solution, of course, is
to use xdm.
Other Features
xterm automatically highlights the window border and text cursor when the pointer enters the
window (selected) and unhighlights them when the pointer loves the window (unsclected). If
the window is the focus window, then the window is highlighted no matter where the pointer is.
In VT102 mode, there are escape sequences to activate and deactivate an alternate screen buf-
fer, which is the same size as the display area of the window. When activated, the current
screen is saved and replaced with the alternate screen. Saving of lines scrolled off the top of
the window is disabled until the normal screen is restored. The termcap entry for xterm allows
the visual editor vi to switch to the alternate screen for edidng, and restore the screen on exit.
In either VT102 or Tektronix mode, there are escape sequences to change the name of the win-
dows and to specify a new log file name.
Environment
xterm sets the environment variables TERM and TERMCAP properly for the size window you
have created. It also uses and sets the environment variable DISPLAY to specify which bitmap
display terminal to use. The environment variable WlNDOWlD is set to the X window ID num-
ber of the xterm window.
Bugs
The class name is xaerm instead of xt:erm.
The -z option is no longer needed since the display manager, xdm, handles logging in much
more cleanly. No more trying to match colors in letclttys or worrying about an unwanted login
window. (The -L option has been removed in Release 4.)
xterm will hang forever if you try to paste too much text at one time. It is both producer and
consumer for the pty and can deadlock.
Variable-width fonts are not handled reasonably.
This program still needs to be rewritten. It should be split into very modular sections, with the
various emulators being completely separate widgets that don't know about each other. Ideally,
you'd like to be able to pick and choose emulator widgets and stick them into a single control
widgeL
The focus is considered lost if some other client (e.g., the window manager) grabs the pointer;
it is difficult to do better without an addition to the protocol.
There needs to be a dialog box to allow entry of the log file name and the COPY filename.
Many of the options are not resettable after xterm starts.
The Tek widget does not support key/button re-binding.
X Window System User's Guide 511
xterm (continued) Window Terminal Emulator
See Also
X, resize, pty(4), tty(4); Appendix E, xterm Control Sequences
Authors
Far too many people, including:
Loretta Guarino Reid (DEC-UEG-WSL), Joel McCormack (DEC-UEG-WSL), Terry Weissman
(DEC-UEG-WSL), Edward Moy (Berkeley), Ralph R. Swick (MIT-Athena), Mark Vande-
voorde (MIT-Athena), Bob McNamara (DEC-MAD), Jim Gettys (MIT-Athena), Bob Scheifler
(MIT X Consortium), Doug Mink (SAO), Steve Pitschke (Stellar), Ron Newman (MIT-
Athena), Jim Fulton (MIT X Consortium), Dave Serisky (I-if').
512 X Window System User's Guide
xwd (continued) Window Image Dumper
Author
Tony Della Fera, Digital Equipment Corp., MIT Project Athena;
William F. Wyatt, Smithsonian Astrophysical Observatory.
514 X Window System User's Guide
xwi ni nfo (continued) Window Information Utility
-stats
-bits
-events
-size
-metric
-english
-all
Causes various attributes of the selected window having to do with its loca-
tion and appearence to be displayed. Information displayed includes the
location of the window, its width, height, depth, border width, class, and map
state, colormap ID (if any), backing-store hint, and the location of its corners.
Ifxwininfo is run with no options, -stats is assumed.
Causes the display of various attributes pertaining to the selected window's
raw bits and how the selected window is to be stored to be displayed. Infor-
mation displayed includes the selected window's bit gravity, window gravity,
backing store hint, backing planes value, backing pixel, and whether or not
the window has save-under set.
Causes the selected window's event masks to be displayed. Both the event
mask of events wanted by some client and the event mask of events not to
propagate are displayed.
Causes the selected window's sizing hints to be displayed. Information
displayed includes: for both the normal size hints and the zoom size hints the
user supplied location if any; the program supplied location if any; the user
supplied size if any; the program supplied size if any; the minimum size if
any; the maximum size if any; the resize increments if any; and the minimum
and maximum aspect ratios if any.
Causes the selected window's window manager hints to be displayed. Infor-
mation displayed may include whether or not the application accepts input,
what the window's icon window # and name is, where the window's icon
should go, and what the window's initial state should be.
Causes all individual height, width, and x and y positions to be displayed in
millimeters, as well as number of pixels, based on what the server thinks the
resolution is. Geometry specifications that are in +x+y form are not changed.
Causes all individual height, width, and x and y positions to be displayed in
inches (and feet, yards, and miles if necessary), as well as number of pixels.
-metric and -english may be used at the same time.
A quick way to ask for all information possible.
Examples
The following is a sample summary taken with no options specified.
xwininfo ==> Please select the window you wish
--> information on by clicking the
==> mouse in that window.
xwininfo ==> Window id: 0x30000f (xterm)
==> Upper left X: 0
--> Upper left Y: 0
516 X Window System User's Guide
Window Information Utility (continued) xwlninfo
==> Width: 578
==> Height: 316
==> Depth: 1
==> Border width: 1
==> Window class: InputOutput
==> Colormap: 0x80065
==> Window Bit Gravity State: NorthWestGravity
==> Window Window Gravity State: NorthWestGravity
==> Window Backing Store State: NotUseful
==> Window Save Under State: no
==> Window Map State: IsUnviewable
==> window Override Redirect State: no
--> Corners: +0+0 -572+0 -572-582 +0-582
Bugs
Using-stats and-bitstogeth shows mercdundantifformafion.
See Also
X, xprop
Author
Mark Lillibridge, MIT Project Athena.
X Window System User's Guide 517
xwud (continued) Window Image Displayer
Files
XWDFile.h
X Window Dump File format definition file.
Bugs in Release 3
Does not attempt to do color translation when the destination screen does not have a colormap
exactly matching that of the original window.
See Also
X, xdpr, xpr, xstdcmap, xwd
Author
Release 4 version by Bob Scheifler, MIT X Consortium;
Release 3 version by Tony Della Fera, Digital Equipment Corp. and MIT Project Athena, and
William F. Wyatt, Smithsonian Astrophysical Observatory.
520 X Window System User's Guide
Part Four:
Appendices
This part of the book contains useful reference information.
System Management
The uwm Window Manager
The OSF/Motif Window Manager
Standard Cursors
Release 3 and 4 Standard Fonts
xterm Control Sequences
Standard Bitmaps
Translation Table Syntax
Glossary
Index
A
System Management
This appendix discusses various tasks involved in X Window System man-
agement, mostly from the UNIX point of view.
In This Chapter:
Including X in Your Search Path ........................................................... 526
Setting the Terminal Type .................................................................... 526
A Startup Shell Script ........................................................................... 527
What Should Go in the Script ........................................................... 527
Starting X ............................................................................................ 531
Starting X with the Display Manager, xdm (Release 4) ..................... 531
Getting Started with xdm on a Single Display ................................. 532
Setting Up the Configuration File and Other Special Files ............... 532
The Standard Login Session .......................................................... 535
Customizing xdm ............................................................................. 536
The Xservers File ........................................................................... 537
The Xsession File and .xsession Scripts ........................................ 538
The Xresources File ....................................................................... 538
The Error Log File .......................................................................... 539
The xdm-pid File (Release 4 Only) ................................................. 539
Xstartup and Xreset ....................................................................... 539
Security and the authorize Resource (Release 4 Only) .................. 539
Stopping xdm and the Server ........................................................... 540
X Terminals and the XDM Control Protocol (Release 4) ................... 540
Release 3 xdm ................................................................................. 541
Release 3 Special Files and the Config File ..................................... 541
Customizing the Release 3 xdm ....................................................... 542
Managing Multiple Displays: the Release 3 Xservers File .............. 543
Release 3 .xsession Scripts ........................................................... 544
Release 3 Xresources File ............................................................. 544
Release 3 Xstartup and Xreset ...................................................... 544
Starting X with xinit .......................................................................... 545
An Older Method of Starting X: /etc/ttys .......................................... 545
Server Access Control ......................................................................... 547
Host-based Access and the xhost Client .......................................... 547
User-based Access: xdm and the .Xauthority File (Release 4) ........ 548
Font Management ................................................................................ 549
Console Messages .............................................................................. 550
Log Files .............................................................................................. 550
Changing the Color Name Database .................................................... 550
Including X in Your Search Path
The various X clients are normally stored in the directory lusrlbinlXll. In order to invoke
them by name like any other UNIX program, you need to make this directory part of your
search path.*
This is normally done from your .cshrc (C shell) or .profile (Bourne shell) file, using a com-
mand similar to the following:
BourneSheH:
PATH=.:/usr/ucb:/bin:/usr/bin:/usr/bin/Xll:Other directories;
export PATH
C SheH:
set path=(. /usr/ucb /bin /usr/bin /usr/bin/Xll Other directories)
The exact list of directories will differ from system to system. You should be aware that
directories are searched in order from left to right, so a command with the same name in an
earlier directory will be found and used before one in a later directory. Many users take
advantage of this fact to run customized versions of programs by putting "." (the current
directory) or a local tools directory first in their search path. This works fine, but you should
be aware that this provides a security loophole that can be taken advantage of by an experi-
enced system cracker. It's much safer to put "." at the end of your path, or eliminate it
entirely.
If you have already logged in before adding the above line to your .projile or .cshrc file, you
should log out and log in again, or type in the path-setting command at your prompt, so that it
takes effect for your current session.
Setting the Terminal Type
Several termcap entries work with xterm, including "xterm," "vtl02," "vtl00," and "ansi."
The xterm program automatically searches the termcap file for these entries (in this order)
and sets the TERM and TERMCAP environment variables according to the entry it finds.
We've found that the termcap entry called "xterm," which comes with the standard X distri-
bution, provides very reliable emulation. We suggest you copy this entry from the xterm
source directory (the file is called termcap) and add it as the first entry in the letcltermcap file
on your system. This will allow you to set your terminal type to xterm.
*This topic isn't really part of system management, but since we assume most people know how to do it, we didn't
want to clutter up Chapter 2 with unnecessary discussion. On the other hand, the information is critical for those who
don't already know it, so we wanted to put it somewherel
526 X Window System User's Guide
Examp A- 1. Sup Bourne shefl script (continue
| Special-case the "bogus" non-network display names and
| make sure we can always execute remote clients
case $DISPLAY in
unix:0.01unix:01:0.0:0)DISPLAY="$cpu:0";;
esac
export DISPLAY
| Load resource definitions from .Xresources
xrdb -Dhostname=$cpu $HOME/.Xresources
| Set keyclick off and invoke the screen saver after
| seven minutes of idleness
xset c off s 420
| Start the twm window manager
twm &
| Now start up some xterms
| Start an xterm in bottom left corner
xterm -geometry 80x35+0-0 -display $DISPLAY &
| xterm next to it across the bottom
xterm -geometry 80x35+500-0 -display $DISPLAY &
| remote xterm in regular size just above, but below console xterm
| at top
rsh ora xterm -geometry -0-0 -display $DISPLAY &
| Now start up other clients
| digital xclock in upper right corner
xclock -digital -update 1 -geometry -0+0 &
| xcalc just below it; xclock 30 pixels high on sun, so offset by 30
xcalc -geometry -0+30 &
|xload 235 pixels below that, at bottom of xcalc
xload -geometry -0+265 &
#xbiff down another 120 pixels
xbiff -geometry -0+385 &
| Start a console xterm window.
| This is the only xterm that should be run in the foreground.
# Killing this window will shut down X.
# Use the following line with xinit; comment out if you use xdm
exec xterm -C -display $DISPLAY -geometry 80x5+0+0
| Uncomment this line if you use xdm
| exec xterm -C -is -display $DISPLAY -geometry 80x5+0+0
System Management 529
Table A- 1. xdm Special Files
File
xdm-conJig
Xservers
xdm-errors
xdm-pid
Xresources
Xsession
Xstartup
Xreset
What it specifies
Configuration parameters.
List of displays to manage.
xdm error log file.
Contains ID of the xdm parent process
(Release 4 only).
Resources to load (with xrdb).
Default login session.
Startup procedure.
Reset procedure.
As you can see, the file xdm-pid has been added in Release 4; it represents new functionality.
The Xstartup and Xreset files can still be used to affect xdm in Release 4, but there are no
default files. We'll discuss these and some of the other special files in greater detail later in
this appendix.
Each of the special files can be specified by an xdm command line option. However, it's
more efficient to specify the files--other than the single xdm configuration file--as resources
and put those resources in the configuration file itself. The configuration file shipped with the
standard version of X is called xdm-config. The Release 4 version of this file is shown in
Figure A-2:
DisplayManager.servers:
DisplayManager.errorLogFile:
DisplayManager.pidFile:
DisplayManager*resources:
DisplayManager*session:
DisplayManager. 0.authorize:
--
DisplayManager*authorize:
/usr/lib/Xll/xdm/Xservers
/usr/lib/Xll/xdm/xdm-errors
/usr/lib/Xll/xdm/xdm-pid
/usr/lib/Xll/xdm/Xresources
/usr/lib/Xll/xdm/Xsession
true
false
Figure A-2. Default xdm-config file, Release 4
The following three xdm-config file entries have been added in Release 4:
DisplayManager.pidFile : /usr/lib/Xl i/xdm/xdm-pid
DisplayManager. 0.authorize: true
--
DisplayManager* authorize : false
These entries represent new xdm functionality, which will be discussed later in this appendix.
If you are using Release 3, these entries are not applicable. (See "Release 3 xdm" for the
appropriate xdm-config file.)
In effect, most of the entries in the default configuration file are just pointers to the other spe-
cial files xdm uses. Notice also that, in most cases, the configuration file has the same syntax
as any resource file. Release 4 introduces a variation from traditional resource syntax, which
appears in the following line:
DisplayManager. 0.authorize: true
--
System Management 533
The Xservers File
The Release 4 xdm source directory contains two sample Xservers files, Xservers.ws and
Xservers.fs, which illustrate file entries for workstations and file servers (such as X
terminals), respectively. To run xdm on a single workstation, you should create an Xservers
file using the Xservers.ws file as a guide. As we'll see later, in most circumstances, you must
edit the Xservers file to specify additional displays for xdm to manage.
Each entry in the Xservers file usually has three or four elements: the display name, an
optional display class, the display type, and the server program name (and its arguments, typ-
ically the display number). (Since an X terminal runs its own server, the final argument can
be a comment, such as "Joe's X terminal.") Possible display types are described on the xdm
reference page in Part Three of this guide.
Most workstations have a single display numbered 0 of the type local, as illustrated by the
typical Xservers file entry for a workstation:
:0 local /usr/bin/X11/X
The display class part of the Xservers entry is new as of Release 4. The sample entry above
does not contain a display class, but it would normally be the second part, between the dis-
play name and type, as in the following:
:0 display_class local /usr/bin/X11/X
The display class is determined by the machine you are using and should be provided by the
hardware vendor. The use of the display class is related to an underlying feature of the
Release 4 xdm, the X Display Manager Control Protocol (XDMCP), which is described later
in this appendix. For now, suffice it to say that, in most circumstances, you do not have to
supply a class name within an Xservers file entry.
For xdm to run sessions on most X terminals, you must add specifications for these displays
to the Xservers file, using the sample file Xservers.fs from the xdm source directory as a tem-
plate. For instance, say you have two X terminals hooked up to a workstation. (As of
Release 4, most X terminals are of the display type foreign. In Release 3, most X terminals
are of the display type transient.) Your Xservers file might look like this:
:0 local /usr/bin/Xl i/X
visual:O foreign Lucy's Visual
ncd:O foreign Ricky' s NCDI6
Notice that the final element of each X terminal entry is a comment. Using this Xservers file,
xdm provides login windows on the two X terminals, as well as the workstation, and runs a
session for any user who logs on.
If you edit the Xservers file while the server is running, xdm will not be aware of the changes.
You can make xdm reread the Xservers file (or another file specified by the resource
DisplayManager. servers) by sending the xdm parent process a SIGHUP. Use the
UNIX ia'll command with the -HUP option (for SIGHUP) and the process ID number of xdm.
It's likely there will be multiple xdm processes, since the program forks a child process for
every display it's managing. As of Release 4, the ID of the parent process is stored in the file
specified by the resource DisplayHanager. pidFile--usually lusrlliblXlllxdmlxdm-
pid.
System Management 537
% kill -}{U process-ID
If a new entry has been added, the display manager starts a session on that display. If an
entry has been removed, the display manager terminates any session on that display without
notice and no new sessions will be started.
Once you edit the Xservers file to reflect the different displays you want to manage, you can
enter other display-specific resources in the configuration file.
Be aware that communication problems can arise between the display manager and many
autonomous displays (primarily X terminals). If the main display is powered off or reset,
xdm may not detect that the server has been stopped and restarted, and thus may not send new
login windows to connected displays. In the spring of 1989, the X Consortium proposed a
standard protocol between displays and display managers that would avert these problems.
The X Display Manager Control Protocol (XDMCP) has been adopted and is implemented by
the Release 4 xdm, but not all X terminals implement it yet. We'll discuss the goals of this
protocol at greater length in "X Terminals and the XDM Control Protocol" later in this
appendix. For now, be aware that the XDMCP will eventually eliminate the need for
Xservers file entries for X terminals. Currently, however, chances are that your X terminal
does not understand the XDMCP and requires an Xservers file entry.
The Xsession File and .xsesslon Scripts
Depending on the needs of your site, you can edit the Xsession file to make the default ses-
sion anything you want. You can specify an alternative window manager, perhaps even use
another program to load resources, and execute any combination of clients.
Another strength of xdm is that it provides for each user to design his own .xsession file. See
"A Startup Shell Script" earlier in this appendix for more information on writing a .xsession
file.
Be aware that if you're testing a .xsession script and it doesn't work, by default xdm will not
let you log in (using the normal method) to fix it. However, xdm does provide an escape
hatch for these situations, which is explained in "The Xresources File" below.
The Xresources File
The Xresources file is where you should specify resources for the authentication widget. See
the xdm reference page in Part Three of this guide for a complete list of resource variables.
As of Release 4, the default Xresources file contains the following event translations, which
allow users to log in if a .xsession script doesn't work:
xlogin*login.translations: #override\
<Key>Fl: set-session-argument(failsafe) finish-field()\n\
<Key>Return: set-session-argument() finish-field()
This translation table specifies that if you type the F1 key (rather than Return) after your
password when logging in, a "failsafe" session, consisting of a simple login xterm window,
will be executed. This will enable you to edit the non-functioning .xsession file. See the
xdm reference page in Part Three of this guide for more information. (See Chapter 9, Setting
Resources, and Appendix H, Translation Table Syntax, for a discussion of event translations.)
538 X Window System User's Guide
The Error Log File
xdm errors are normally printed to the console. It's wise to redirect them to a file. The
default configuration file sets the resource DisplayManager.errorLogFile to
lusrllib/X1 llxdmlxdm-errors. The xdm-errors file can be very helpful if you are testing vari-
ous xdm configurations.
The xdm-pid File (Release 4 Only)
Added to xdm as of Release 4, the xdm-pid file stores the ID number of the xdm parent pro-
cess. If you edit the Xservers file while the .server is running, xdm will not be aware of the
changes. You can make xdm reread the xdm-con.lig file and the Xservers file (or another file
specified by the resource DisplayManager. servers) by sending the xdm parent pro-
cess a SIGHUP.
To make xdm aware of changes to the Xservers file, use the UNIX kill command with the
-nUP option (for SIGHUP) and the process ID number ofxdm stored in the xdm-pid file. (See
"The Xservers File" earlier in this appendix for an example.)
Xstartup and Xreset
As stated previously, the Xstartup and Xreset files mentioned in Table A-1 can still be used to
affect xdm in Release 4, but there are no default files; thus, they are not specified in the
default configuration file.
The Xstartup file is intended to be a script that is run as root before starting the user session.
You might want to write a script containing commands to make fake entries in/etc/utmp,
mount users' home directories from file servers, display a message of the day, or abort the
session if logins are not currently allowed.
The Xreset file is intended to be a script that is run as root after a user session has been ended.
You might want to write a script to undo the effects of commands in Xstartup, perhaps
removing fake entries from/etc/utmp, or unmounting directories from file servers.
See the xdm reference page for more information about the Xstartup and Xreset files.
Security and the authorize Resource (Release 4 Only)
In addition to pointers to several special files, the xdm-con.lig file contains the following
resource specifications:
DisplayManager. 0.authorize : true
--
DisplayManager*authorize : false
Available as of Release 4, the authori ze resource represents a new method of security for
X, which xdm can be set up to provide. The first resource specification above sets a user-
based server access scheme to work on the local display. The second one tunas the scheme
off on all other displays. These defaults should be compatible with running X on the local
display and most X terminals that might be connected to it. See "User-based Access: xdm
and the .Xauthority File" later in this appendix and the xdm reference page in Part Three of
this guide for more about authorization.
System Management 539
If a new entry has been added, the display manager starts a session on that display. If an
entry has been removed, the display manager terminates any session on that display without
notice and no new sessions will be started.
If the xdm connection to an X terminal is interrupted, you should also be able to reestablish it
by sending a SIGHUP to the xdm parent process.
Once you edit the Xservers file to reflect the different displays you want to manage, you can
enter other display-specific resources in the configuration file.
Release 3 .xsession Scripts
Be warned that if you're testing a .xsession script and it doesn't work, by default xdm will not
let you log in (under the same login name) to fix it. While the default Release 4 version of
xdm provides an escape hatch for these situation, the Release 3 version does not. We strongly
suggest that you set one up using "The Xresources File."
Release 3 Xresources File
To give users a way to log in if a .xsession script doesn't work, place the following event
translations in the Xresources file:
xlogin* login, translations : #override\
<Key>Fl: set-session-argument(failsafe) finish-field()\n\
<Key>Return: set-session-argument () finish-field()
This translation specifies that if you type the F1 key (rather than Return) after your password
when logging in, a "failsafe" session, consisting of a simple login xterm window, will be exe-
cuted. This will enable you to edit the non-functioning .xsession file. [This translation table
has been added to the default Xresources file in Release 4.]
The Xresources file is also where you should specify resources for the authentication widget.
See the xdm reference page in Part Three of this guide for a complete list of resource vari-
ables. (See Chapter 9, Setting Resources, and Appendix H, Translation Table Syntax, for a
discussion of event translations.)
Release 3 Xstartup and Xreset
The Release 3 version of xdm includes default Xstartup and Xreset files that contain nothing
more than a comment. You can use these files to specify custom startup and reset proce-
dures. See "Xstartup and Xreset" under the discussion of the Release 4 xdm, earlier in this
appendix. Also see the xdm reference page in Part Three of this guide for more information
about the Xstartup and Xreset files.
544 X Window System User's Guide
Starting X with xinit
The xinit program is used to start the server and a first client program, by default an xterm
window. Starting X manually with xinit is described in Chapter 2, Getting Started. You can
also use xinit to start X automatically.
The easiest way to do this is to run xinit from your .login or .profile file. (If you are using
System V, this may be the only reliable way to run xinit.)
xinit will look in your home directory for a file called _xserverrc to run as a shell script to
start up the server. If there is no such script, xinit will start the server X on the display : 0.
xinit will also look in your home directory for a file called _xinitrc to run as a login script,
such as the one described earlier in this appendix. If no such script is found, it will execute a
login xterm window.
With System V only, you might try to run xinit from the terminal initialization file letclinit-
tab. This file is analogous to the BSD 4.3 letclttys. The letclinittab file normally has an entry
for each serial port on a system, plus several entries that are used during the boot process.
Note that the concept of pseudo-terminals, or ptys (which X relies on) is foreign to System V.
All System V servers will have had to do some system hacking to add support for ptys. How
this is done will vary from system to system. As a result, we're going to beg off on describ-
ing inittab in detail, and refer you to your system documentation. Again, it is also possible
that there will be problems with the controlling tty.
See the xinit reference page in Part Three of this guide for more information.
An Older Method of Starting X: /etc/ttys
For Release 3, this method was supported only for backwards compatibility with older
releases of X. As of Release 4, it is not supported. In either case, system administrators
should switch to xinit or xdm.
On BSD 4.3-derived systems, you can start X automatically from the/etc/ttys terminal initial-
ization file.* This file normally contains a list of terminals on which a login prompt should
be printed by the getty program. For X, this file can be used instead to start xterm for a
pseudo-terminal. A typical line to start X from the letclttys file might have the following
format:
*Note that the technique described here will not work on earlier BSD systems, Xenix, or other systems which use the
pre-BSD 4.3 ttys format.
System Management 545
BSD 4.3/etcAlys
devname command ttype
I I I
ttyvO "/etc/xterm -L -geometry -I+I -display :0" xterm
on secure window="/usr/bin/Xll/x :0 -c -i"
#Start X
Field Function in letclttys
devname
command
ttytype
status
comment
The name of the special file in the dev directory that corresponds to the device.
For X, the
pseudo-terminal with the highest minor device number (e.g. /dev/ttyq[ and
/devlptyqD is normally renamed /devlttyvO and /devlptyvO. For systems with
more than one display, the next highest pty is used for the second display, and so
on.
The command to be run by init. This is normally getty, but can be another com-
mand, such as the command to start a window system. In this example, xterm is
run with the -r. option, which causes getty to be run in the xterm window rather
than the shell. (The -r. option is not supported in Release 4.) The window is
placed in the top right comer of the screen. Since spaces and tabs are used to
separate fields in letclttys, the entire command must be quoted.
Note that some implementations of init have relatively small program name buf-
fer sizes, so you may find you can't list many xterm options. In addition,
because the # character is used as a comment symbol in letclttys, you may have
difficulty specifying colors (say for an xterm window background) using the hex-
adecimal color syntax. If you run into either of these problems, you may want to
write a small program that runs xterm with the desired arguments, and have init
run that instead.
The name of the terminal attached to the line. This should be the name as
defined in the letcltermcap terminal database. In the example above, it is speci-
fied as xterm.
Note that the presence of the terminal type field in the BSD 4.3 ttys replaces the
letclttytype file that was used for this purpose in earlier BSD versions.
The word on if the command is to be executed, or off if it is not. Additional flags
may be specified after on or off. The word secure must be present to allow root
to log in on a particular terminal. The flag window=" command" specifies a
window system command to be executed by init before it starts xterm. This
should be the command to start the X server, as shown in the example.
Comments can appear anywhere in the file. They are introduced by #, and are
terminated by a newline.
546 X Window System User's Guide
Server Access Control
X runs in a networked environment. Because of X's design, your workstation is no longer
your private preserve, but hypothetically, can be accessed by any other host on the network.
This is the true meaning of the server concept: your display can serve clients on any system,
and clients on your system can display on any other screen.
The possibilities for abuse are considerable. However, there are two access control mecha-
nisms, one host-based and one user-based. The host-based scheme involves a system file
(letclXn.hosts) and can be controlled using the xhost client. The user-based scheme involves
authorization capabilities provided by the display manager, xdm, as of Release 4, and
depends upon the newly introduced X Display Manager Control Protocol (XDMCP). As
we'll see, since most X terminals cannot interpret the XDMCP at this time, the usefulness of
this latter access control mechanism is currently somewhat limited.
These two access control methods are discussed briefly in the following sections. For more
information, see the Xserver, xhost, xdm, and xauth reference pages in Part Three of this
guide.
Host-based Access and the xhost Client
The letclXn.hosts file (where n is the number of the display) contains a list of systems that are
allowed to access the server. By default, this file contains only the name of the local host.
Edit this file so that it contains the list of systems you want to have access to your server on a
regular basis.
The xhost client can be used to give (or deny) systems access to the server interactively, pos-
sibly overriding the contents of letc/Xn.hosts. (The xhost client can also be run from a startup
script.) Note that this is really only sufficient for a single-user workstation environment,
however.
Specifying a host name (with an optional leading plus sign) allows the host to access the
server, and specifying a host name with a leading minus sign prevents a previously allowed
host from accessing the server. Multiple hosts can be specified on the same line. Running
xhost without any arguments prints the current hosts allowed to access your display.
For example, to add the hosts jupiter and saturn, and remove neptune:
% xhost +Jupiter saturn -neptune
It is possible to remove the current host from the access list. Be warned that you can't undo
this without logging out.
Note that when a remote system is denied access to your display, it means two things: that a
person working on the remote system can't display on your screen, and that you can't use
that remote system for running clients you want displayed on your screen.
System Management 547
User-based Access: xdm and the .Xauthority File (Release 4)
As of Release 4, the display manager and its control protocol (XDMCP) provide a user-based
access control mechanism, which can be used to supplement or replace the host-based access
mechanism discussed in the previous section. The Release 4 xdm can be set up to provide
user authorization on a particular display (see "Security and the authorize Resource" earlier
in this appendix). If authorization is enabled, when you log in, xdm places a machine-read-
able access code, known as a magic cookie, in a file called .Xauthority in your home direc-
tory. xdm also makes this magic cookie available to the server.
The magic cookie defined in a user's .Xauthority file is basically a secret code shared by the
server and a particular user logged in on a particular display. When the user runs a client on
the local display, the server checks to see whether the client program has access to the magic
cookie. All processes started by the user in question have that access, and thus the server
allows the client to be run on the display. Basically, under the magic cookie authorization
scheme, a display becomes user-controlled. (Once xdm creates an .Xauthority file for a user,
each time the user logs on, xdm merges in authorization codes (magic cookies).)
The access afforded by magic cookies is not as broad as that afforded by the host-based
mechanism. When a system relies entirely on host-based access, any machine on the list of
approved hosts can connect to the system. Thus, generally, any user logged on to an
approved host can access any display connected to the system. This is somewhat feeble secu-
rity. User-based access control is a little safer.
Be aware, however, that, currently, user-based access control cannot provide security for all
X terminal users. This method of access control relies on the X Display Manager Control
Protocol and few X terminals in the current market are programmed to understand the proto-
col. However, user-based access can be used effectively on workstations running Release 4
and on many of the newer X terminals.
The security mechanism provided by the magic cookie is evident in a situation in which
another user tries to run a client on your machine. The server requires the client run by the
other user to have access to the magic cookie shared exclusively between you and the server.
The other user cannot provide the proper authorization code, and thus cannot run a client on
your host.
Of course, in many cases, users in a network will want to run clients on several machines
(while displaying the client window on their local displays). This can be done if a user sup-
plies authorization information associated with his local machine (or X terminal display) to
the remote host. X developers have provided a new client, xauth, to allow users to transfer
this information. Basically, xauth is a utility to manipulate .Xauthority files.
The most common use for xauth is to extract a user's authorization information for the cur-
rent display, copy it to another machine, and merge it into the server's authorization records
on the remote machine, as in the following:
% xauth extract - $DISPLAY l rsh hot2 xauth merge -
The dash (-) arguments indicate that extracted authorization records should be written to the
standard output and that the xauth merge function should accept records from standard input.
This command supplies the remote server with authorization information, allowing the user
548 X Window System Users Guide
to run a remote shell on that host. See the xauth reference page in Part Three of this guide for
more information.
If an installation is using remote file sharing, such as NFS, then sharing authorization records
may not be an issue. If every user has a single home directory that is accessible to all
machines, the machines have access to the necessary .Xauthority files at all times. In such an
environment, users should be able to run programs on any of the networked machines without
using xauth.
When user-based access control fails (for example, when a null or invalid magic cookie is
offered to the server), host-based access takes over. To be more specific, say for example a
user is logged on at an X terminal that is not XDMCP compatible, and thus the user has no
.Xauthority file (i.e., magic cookie). If that user tries to open a window on the remote console
display, the client window cannot access a magic cookie. (The host interprets this as a null
cookie.) Then host-based access control takes over. If the user in question is working on a
system authorized in the letc/Xn.hosts file, he should be authorized to run a client on the con-
sole display.
Font Management
In Release 3, the X Consortium adopted the Bitmap Display Format (BDF) as the (non-exclu-
sive) standard font format. BDF font files must be compiled to produce SNF (Server Natural
Format) font files, which can be used by the server. (These font files have a .snfextension.)
The standard fonts shipped with X should already be compiled. If you add BDF font files to
the system, the files must be converted to SNF format using the program bdftosnf. The
showsnf program displays the SNF font file so you can check that it compiled properly. See
the bdftosnfand showsnfreference pages in Part Three of this guide for details.
Once a new font is moved to the directory you want (perhaps/usr/lib/Xll/fonts/misc), you
must add the font to the font database (]'onts.dir file) used by the server. To do this, run
mkfontdir with the directory as an argument, as in the following:
% mkfontdir /usr/lib/Xll/fonts/misc
An entry for the new font is added to the fonts.dir file. You should also edit the fonts.alias
file if you want to add an alias for the new font.
Then the server must be made aware of the new font. The command:
% xset fp rehash
makes the server reread the font databases and alias files in the current font path.
If you are using a server other than the standard release, the server developer should provide
a program to convert BDF font files to a format appropriate for the server.
System Management 549
Console Messages
On a single-user workstation, it is likely that the screen used for running X is also used as the
system console.
If X is started manually, the console will be the first window to appear on the screen. But if
X is started from your .login file, console messages from the kernel may sometimes appear on
the screen, overlaying the X windows. They make a nasty mess of the screen, but the display
can be refreshed and the console message erased by running the client xrefresh (described in
Part Three).
Some implementations of X support a -C option to xterm that redirects messages sent to
Idevlconsole to that xterm window. If this option is supported, you should add the -C option
to the console xterm in your startup file. After this window is mapped (displayed on the
screen), all such messages are displayed there.
Log Files
The X server creates log files useful in fixing a problem that might occur. These files are
located in lusrladm.
You should make provisions to trim these files periodically. As with all log files, you can do
this automatically with an entry in the crontab file.
Changing the Color Name Database
The X Window System comes with a predefined set of colors, listed in the file
lusrlliblXlllrgb.txt. You can use these color names to specify colors either on the command
line or in a resources file. If you have the X sources, you can customize the color name data-
base using the following procedure.
1. Edit the rgb.txt source file, which is located in the mitlrgb directory, to change or add
colors. The format of a line in the rgb.txt file is:
red green blue color name
--
The red, green, and blue values are integers in the range 0 to 255; the color name is case
insensitive, but must not include any special symbols. A typical entry in the rgb.txt file
is:
127 255 212aquamarlne
See Chapter 8, Command Line Options, for more about color specifications.
550 X Window System User's Guide
2. Run the rgb program using the makefile also located in the mit/rgb directory. This pro-
gram converts the text file (rgb.txt) to a UNIX dbm(1) format file (rgb.dir), which is used
as the color database. Just type:
% make
3. Then install the new rgb.dir file in/usr/lib/Xll by typing:
% make install
If the color name database gets corrupted in some way (e.g., written to accidentally), the
server may not be able to find any colors with which to display. On a black and white works-
tation, you may get error messages similar to the following:
X Toolkit Warning: Cannot allocate colormap entry for White
X Toolkit Warning: Cannot allocate colormap entry for Black
X Toolkit Warning: Cannot allocate colormap entry for white
X Toolkit Warning: Cannot allocate colormap entry for black
If you get errors of this sort, perform steps 2 and 3 in the procedure described above. This
will overwrite the corrupted rgb.dir file.
System Management 551
B
The uwm Window Manager
This appendix describes uwm, the Release 3 standard window manager,
which has been moved to the user-contributed distribution in Release 4. It
covers both the basics of using uwm and how to customize it.
In This Chapter:
Starting the Window Manager .............................................................. 556
The WindowOps Menu ......................................................................... 556
Creating New Terminal Windows ...................................................... 558
Refreshing the Screen ..................................................................... 559
Redrawing a Window ....................................................................... 560
Moving Windows and Icons ............................................................. 560
Resizing Windows ........................................................................... 561
Shuffling the Window Stack: Raise, Lower, CircUp, CircDown ......... 563
Raising Windows (bringing in front of others) ................................. 564
Lowering Windows (sending behind others) ................................... 564
Circulating Windows ...................................................................... 565
Displaying Windows as Icons ........................................................... 565
Changing Keyboard Focus ............................................................... 567
Freezing and UnFreezing the Server ................................................ 568
Restarting the Window Manager ...................................................... 568
Removing a Window ........................................................................ 569
Exiting the Window Manager ............................................................ 569
Button Control of Window Manager Functions ...................................... 569
Using uwm to Place Other Clients ........................................................ 570
The Preferences Menu ........................................................................ 571
Customizing uwm ................................................................................ 572
Setting .uwmrc Variables ..................................................................... 575
Button/Key Bindings ............................................................................ 576
Function Names .............................................................................. 576
Keys ................................................................................................ 576
Context ............................................................................................ 577
Mouse Buttons ................................................................................ 577
Action .............................................................................................. 578
Defining Menus .................................................................................... 579
Submenus ....................................................................................... 580
Slip off menus .................................................................................. 581
Executing System Commands from a Menu .................................... 581
Cut Buffer Strings ............................................................................ 582
Color Menus .................................................................................... 584
A Complete Revamp of uwm ............................................................... 585
The first half of this appendix discusses the default window manipulation functions provided
by uwm. The second half discusses how to customize the window manager to suit your
needs. First, however, let's take a look at starting uwm.
Starting the Window Manager
You start uwm from the command line by typing:
% uwm&
in an xterm window. If xdm (the display manager) is starting X on your system, the uwm
window manager is probably started automatically when you log on. (See the discussions of
xdm in Chapter 2, Getting Started, and Appendix A, System Management.) When uwm is
started, nothing visible will happen, but your terminal will beep once to indicate that uwm is
running on the current screen.
Note also that you can run xterm or other X clients without running a window manager, uwm
allows you to size and place client windows on the screen, but you can also use command
line options to do this. However, there is no way to change the size or location of windows
on the screen without a window manager.
The WindowOps Menu
The uwm WindowOps menu gives you access to many of the most frequently used window
manipulation functions. In the standard version of uwm shipped by MIT, you bring up this
menu by moving the pointer to the root window and holding down the middle pointer button.
The WindowOps menu and the menu pointer appear as shown in Figure B-1.
Note that the last two items, KillWindow and Exit, appear on the menu as of Release 3. If you
are running Release 2, your menu will not include these items. (However, the items that
appear on both Release 2 and Release 3 menus are identical in functionality; our discussions
of these common menu items apply to either release.)
Another Release 3 feature is that the "hand" pointer is used to indicate the window to be
acted upon (resized, refreshed, etc.). In Release 2, this function was performed by the "target
circle" pointer. The figures in this appendix depict Release 3 pointers, but the Release 2 and
3 pointers function in the same way.
556 X Window System User's Guide
% uwm&
% xclock&
..,I/I_;...E ..... -E;-ErT :.-
/ II II IIII II I III IIIIIII
New Window
RefreshScreen .......
Redraw
Move
-:...
Resize
Lower
Raise
CircUp
CircDown
Autolconify
Lowerlconify "
Newlconify
Focus :::.
Freeze t-
UnFreeze Ii .:
Restart
KillWindow
Exit
Figure B-1. WindowOps menu
The following pages explain the functions of the uwm WindowOps menu. Remember that all
of the window manager functions are customizable. Items can be added to or deleted from
this menu (and the Preferences menu) by modifying the .uwmrc window manager startup file,
as described in the section "Customizing uwm" later in this appendix. This appendix
describes the window manager as it is shipped with the standard release of the X Window
System from the MIT X Consortium.
To bring up the WindowOps menu, move the pointer to the root window and hold down the
middle button on the pointer. To select a menu item, continue to hold down the middle but-
ton and move the pointer to the desired menu item. A horizontal band, or highlighting bar,
follows the pointer. When you've highlighted the desired menu item, release the button. The
selected function will be executed. Note that you must keep the pointer within the menu as
you drag down to make a choice, or the menu will disappear and you'll have to start over.
Some of the functions on the menus can be invoked simply by pressing a combination of
pointer buttons and keyboard keys. We discuss these "'keyboard shortcuts" as appropriate
when discussing each menu function, and summarize them in Table B-1 later in this appen-
dix. These shortcuts all make use of the "Meta" modifier key. See Chapter 11, Setup Clients,
for a discussion of how to determine which key on your keyboard serves as the Meta key.
(For the Sun-3 keyboard, for example, Meta is either of the keys labeled "Left" or "Right.")
The uwm Window Manager 557
Figure B-3. A custom-size xterm window
Making a Maximum-Height Window. Move the comer to the desired position and
click the right button. A default-width by maximum-height (to the bottom of the
screen) window appears. See Figure B-4.
Refreshing the Screen
Refreshing your screen means redrawing its contents. This is useful if system messages from
outside the X window system appear on the screen, overlaying its contents. To refresh your
screen:
1. Bring up the WindowOps menu.
2. Select FlefreshScreen with the menu pointer. The screen redraws itself. You can use the
xrefresh client to achieve the same effect. Simply type xrefresh at the prompt in any
xterm window.
The uwm Window Manager 559
3. Move the hand pointer to the desired window or icon. Hold down the middle button. The
pointer changes to the cross pointer and a window outline appears. This outline tracks
the pointer movement.
4. Move the cross pointer with the window outline to the desired location on your screen.
5. Release the middle button. The window will move to the new location.
Figure B-5. Moving windows or icons
You can also move a window or icon simply by moving the pointer to the window or icon
you want to move, then pressing the right pointer button while holding down the Meta key.
The pointer at first changes to a small image of an icon. You can now let go of the Meta key.
Then, as you drag the pointer while holding down the button, the pointer changes to a cross,
while the window or icon changes to outline form. Drag the outline to the new location, and
let go of the right button. The window will be redrawn in the new location.
Resizing Windows
The Resize menu item resizes an existing window. See Figure B-6. To resize a window:
1. Bring up the WindowOps menu.
2. Select Rosizo with the menu pointer. The pointer changes to the hand pointer.
The uwm Wtndow Manager 561
3. Move the hand pointer to the window you want to resize. Place it near the border you
want to move. The opposite border remains in its current position.
4. Hold down the middle button. The pointer changes to the cross pointer.
5. Move the window's border to obtain the desired window size. As you resize the window,
a digital readout appears opposite the pointer showing the window size in pixels. (For the
xterm client, size is in characters and lines.) Release the middle button.
% uwm&
% xclock&
%
Figure B-6. Resizing a window
You can also resize a window without using the menu. Move the pointer so that it is within
the window you want to resize, placing the pointer near the window border you want to
change. With one hand, press and hold down the Meta key on the keyboard. With the other
hand, press and hold down the middle pointer button. The pointer starts as an icon pointer,
but as you drag the pointer, it changes to a cross and a window outline appears. Move the
pointer to resize the window. When the window is the proper size, release the middle button
and the Meta key.
Resizing an xterm window will not change the dimensions of the text currently in the win-
dow. (If you make the window smaller, for instance, some of the text may be obscured.)
However, if the operating system supports terminal resizing capabilities (for example, the
$IGWINCH signal in systems derived from BSD 4.3), xterm will use these facilities to notify
programs running in the window whenever it is resized. As you continue to work, perhaps
starting an editing session, the program will use the entire window. If you resize during an
562 X Window System User's Guide
Raising Windows (bringing In front of others)
The Raise menu item places a window at the top of a window stack.
bring a window to the front:
See Figure B-8. To
1. Bring up the WindowOps menu.
2. Select Raise with the menu pointer. The pointer changes to the hand pointer.
3. Move the hand pointer to the desired window.
4. Click the left or middle button. The window is raised to the top of the stack.
% uwm&
% xclock&
%
Raise
..... % xterm&
New Window
RefreshScreen
Redraw
Move
Resize
Lower
CircUp
CircDown
Autolconify
Lowerlconify
Newlconify
Focus
Freeze
UnFreeze
Restart
KillWindow
Exit
Figure B-8. Raising a window
Lowering Windows (sending behind others)
The Lower menu item places a window at the bottom of a window stack. To place a window
at the bottom:
1. Bring up the WindowOps menu.
2. Select Lower with the menu pointer. The pointer changes to the hand pointer.
3. Move the hand pointer to the appropriate window.
4. Click the left or middle button. The desired window is placed behind all windows except
the root window.
564 X Window System User's Guide
.... % xclock&
i:=ii New Window
RefreshScreen
Redraw
Move
Resize
Lower
Raise
...... CircUp
CircDown
Autolconify
Lowerlconify
.: Freeze
:|
UnFreeze
" L , Restar
KillWindow
I Ei I
xterm I
Iogin
Figure B-I O. The Iogin window is about to be deiconified
Changing Keyboard Focus
Normally, keyboard input goes to whichever window the pointer is currently in. The Focus
option causes keyboard input to go only to a selected window (the focus window) regardless
of the position of the pointer.
Focusing can be useful if you are working in one window for an extended period of time, and
want to move the pointer out of the way. It also prevents the annoying situation in which you
inadvertently knock the pointer out of the window while typing. (This can be very important
for touch typists who look infrequently at the screen while typing!)
To choose a focus window:
l. Bring up the WindowOps menu.
2. Select Focus with the menu pointer. The pointer changes to the hand pointer.
3. Move the hand pointer to the window you want to choose as the focus window.
4. Click the middle button to choose the window.
The uwm Window Manager 567
The focus window becomes highlighted with a dark border.
In order to take the focus away from the selected window (and reactivate "pointer focus"),
you must give the focus back to the root window. To do this, select Focus again, and click
anywhere on the root window. The keyboard focus will once again follow the pointer into
any window.
Freezing and UnFreezing the Server
The X server normally responds to requests from clients in a first-come first-served order.
There are times when you want one client (such as the window manager) to get priority treat-
ment. For example, if there are many active X clients, or if you are running X across a slow
network, you may find that uwm responds sluggishly while performing tasks such as moving
or resizing a window. If you select Freeze, the window manager "grabs the server," so that
no other clients have access. All events and requests to display to the screen by other clients
are queued, or "saved up," and will be performed when the server is unfrozen.
To freeze the server:
1. Bring up the WindowOps menu.
2. Select Freeze with the menu pointer.
Since only the window manager has access to the server, window manager operations will go
much more quickly. When you are finished moving or resizing windows (or whatever it was
you wanted the window manager to do more quickly), select Unfreeze to resume normal
operation.
Restarting the Window Manager
The Restart menu item restarts the window manager. This may occasionally become neces-
sary if the window manager functions improperly. To stop and restart the window manager:.
1. Bring up the WindowOps menu.
2. Select Restart with the menu pointer.
You may also want to restart the window manager if you edit your .uwmrc configuration file
to change the functionality of uwm. For more information, see the section "Customizing
uwm" later in this appendix.
Note that when the window manager is stopped, all icons revert to windows. This happens
because the window manager is what allows windows to be iconified. When the window
manager is restarted, you can iconify the windows again.
568 X Window System User's Guide
Removing a Window
The KillWindow menu item terminates a client window. Like other methods of 'killing' a pro-
gram (such as the xkill client), the KillWindow menu item can adversely affect underlying
processes.
Most windows can be removed in ways that do not harm relevant processes. For example,
you can generally remove an xterm window by typing the same command you use to log off
the system. KillWindow is intended to be used primarily after more conventional methods to
remove a window have failed.
To remove a stubborn window:
1. Bring up the WindowOps menu.
2. Select KillWindow with the menu pointer. The pointer changes to the hand pointer.
3. Move the hand pointer into the window you want to terminate.
4. Click any pointer button.
The window is removed.
Refer to the section on xkill in Chapter 7, Other Clients, for a more complete discussion of
the hazards of killing a client and a summary of alternatives.
Exiting the Window Manager
The Exit menu item stops the window manager. You may want to stop uwm in order to start
another window manager. To stop uwm:
1. Bring up the WindowOps menu.
2. Select Exit with the menu pointer.
The window manager is stopped. All icons revert to windows.
Button Control of Window Manager Functions
Table B-1 summarizes the keyboard shortcuts for window management functions. The first
column lists the desired function; the second, the required location for the pointer; and the
third, the button-key combination. In this column, "click" means to press and immediately
release the specified pointer button; "down" means to press and hold the pointer button, and
"drag" means to move the pointer while holding down the pointer button. In all cases, you
can let go of the keyboard key as soon as you have pressed the appropriate pointer button.
Note that these key "bindings" can be changed in your .uwmrc file as described later in this
appendix. The combinations described in Table B-1 work for the default.uwmrc file.
The uwm Window Manager 569
Table B-1. Keyboard Shortcuts for Window Manager Functions
Function
Move
Resize
Raise
Lower
Circulate up
Circulate down
Circulate down
Iconify and move
Deiconify and move
WindowOps menu
WindowOps menu
Preferences menu
Pointer Location
Window or icon
Window
Window or icon
Window or icon
Root
Root
Anywhere
Window or icon
Icon
Root
Anywhere
Anywhere
Keyboard Shortcut
Meta key, fight pointer button down and drag.
Meta key, middle pointer button down and drag.
Meta key, fight pointer button click.
Meta key, left pointer button click.
Meta key, right pointer button click.
Meta key, left pointer button click.
Meta-Shift key combination, left pointer button
click.
Meta key, left pointer button down and drag.
Meta key, middle pointer button click.
Meta key, middle pointer button down.
Meta-Shift key combination, middle pointer
button down.
Meta-Shift key combination, middle pointer
button down (must display WindowOps with
Meta-Shift middle down and slip off').
Using uwm to Place Other Clients
As described in Chapter 2, Getting Started, you can start another client simply by typing its
name at the command line prompt in an xterm window. Some clients have a default size
and/or location. A preferred size and location can also be specified in your .Xresources file,
as described in Chapter 9, Setting Resources.
When you start a client, you can also use the -geornet: ry command line option described in
Chapter 8, Command Line Options, to size and locate the window, overriding any defaults
that the client has.
If none of these geometry specifications has been provided, uwm steps in and requires you to
interactively size and locate the windows. You have already seen the process of interactively
sizing and positioning a window in Chapter 2, when we discussed how to start a second xterm
or an xclock window.
First, the pointer turns into a comer shape and the name of the client appears in the upper-left
comer of the screen followed by the digital size readout 0x0.
To place the default-size client, move the pointer to the desired upper-left comer position for
the new client. Click the left pointer button.
To both size and place the client, move the pointer to the desired upper-left comer position;
press and hold down the middle pointer button. The pointer changes to a lower-fight comer
shape. Move the pointer to the desired window size. Release the pointer button.
570 X Window System User's Guide
The Preferences Menu
The Preferences menu is generally included in the version of uwm provided with most sys-
tems. The Preferences menu lists options for setting bell volume, keyclick volume, whether
or not the Caps Lock key works, and the pointer tracking speed.* See Figure B- 11.
% uwm&
% xterm&
%
Bell Loud
Bell Normal
Bell Off
Click Loud
Click Soft
Click Off
Lock On
Lock Off
Mouse Fast
Mouse Normal
Mouse Slow
Figure B-11. Preferences menu
Without customizing the window manager, the only way to display the Preferences menu is
to first display the WindowOps menu by an alternative method. Instead of placing the pointer
on the root window and holding down the middle pointer button, place the pointer anywhere
on the screen, hold down both the Shift and Meta keys, and press the middle pointer button.
(See Chapter 11, Setup Clients, for a discussion of how to determine which key on your key-
board serves as the Meta key.) The WindowOps menu is displayed.
You can let go of the Shift and Meta keys, but keep holding down the middle pointer button.
Then drag the pointer off the right or left side of the WindowOps menu and the Preferences
menu will be displayed.
*The pointer tracking speed controls how much the pointer moves on the screen when you move the pointer. Experi-
ment with each setting and see which you are most comfortable with.
The uwm Window Manager 571
Example B-1. The default.uwmrc file from the MIT distribution (continued)
f.raise = mll
f.pushright= mll
f.pushleft = mlc
f.pushup= mll
f.pushdown = mlc
:windowlicon: left up
:windowlicon: right down
:windowlicon: right down
:windowlicon: middle down
:windowlicon: middle down
menu = "WindowOps" {
New Window: !"xterm&"
RefreshScreen: f.refresh
Redraw: f.redraw
Move: f.move
Resize: f.resize
Lower: f.lower
Raise: f.raise
CircUp: f.circleup
CircDown: f.circledown
AutoIconify: f.iconify
LowerIconify: f.newiconify
NewIconify: f.newiconify
Focus: f.focus
Freeze: f.pause
UnFreeze: f.continue
Restart: f.restart
.... : f.beep
KillWindow: f.kill
.... : f.beep
Exit: f.exit
}
menu = "Preferences" {
Bell Loud: !"xset b 7&"
Bell Normal: !"xset b 3&"
Bell Off: !"xset b off&"
Click Loud: !"xset c 8&"
Click Soft: !"xset c on&"
Click Off: !"xset c off&"
Lock On: !"xset led on&"
Lock Off: !"xset led off&"
Mouse Fast: !"xset m 4 2&"
Mouse Normal: !"xset m 2 5&"
Mouse Slow: !"xset m 1 l&"
}
If you wish to change the operation of the window manager, you shouldn't change the
default.uwmrc file. Instead, copy it to your home directory, under the name .uwmrc, and
make changes to that copy. Or else, if you are planning only small changes, you can create a
.uwmrc file from scratch. Settings in default.uwmrc and your own local .uwmrc file are
cumulative (unless you explicitly override default.uwmrc as explained in the next section), so
all you need to enter in your .uwmrc are values you wish to change.
574 X Window System User's Guide
The name of a button: left, middle or right. These must be in lower case, and can be
abbreviated 1, m and r.
The state of the button: down, up (just released), or delta (held down while the pointer is
moving). The distance in pixels the pointer must be moved in order to trigger the delta
state is set by the delta variable, and is set to 5 in default.uwmrc. The actual transla-
tion of pixels to distance will vary from system to system, and you will probably want to
experiment to find a value that you are comfortable with. The context for the delta state
is the context at the point the button was first pressed, not its position at the time it has
moved a delta number of pixels.
The button name and state can be specified in either order.
Going back to our sample function binding:
f.newiconify = meta :windowlicon: delta left
you can now understand that the f .newiconify function is invoked by moving the
pointer to either a window or an icon, pressing the Meta key and the left pointer button, and
dragging the pointer in any direction.
All of the other function definitions should be equally readable to you. Go back for a
moment and review the bindings shown in the default.uwmrc file in Example B-1.
You'll notice that it is possible to bind the same function to more than one set of keys, but-
tons and/or contexts. For example, the WindowOps menu can be invoked anywhere by press-
ing the Meta and Shift keys together with the middle button on the pointer. But when the
pointer is in the root window, the WindowOps menu can be invoked by pressing only the
middle button on the pointer. The reason for this becomes obvious if you realize that when
the pointer is on a window or an icon, the middle pointer button alone might have some other
meaning to the application running in that window. In order to avoid conflict with other
applications, uwm uses the more complex key/button combination. But when the pointer is
in the root window, there is no possibility of conflict, and it can take a more forgiving
approach.
Action
The fifth field, labeled "Action," is typically used only for the f .menu function, which
allows you to invoke menus. The fifth field specifies the name of a menu, whose contents are
defined in the third section of the .uwmrc file. If the menu name contains quotes, special
characters, parentheses, tabs, or blanks, it must be enclosed in double quotes. For consis-
tency, you may want to always quote menu names. For example:
f.menu= :root: middle down: "WindowOps"
f.menu= mls : : middle down: "WindowOps"
f.menu= mls : : middle down: "Preferences"
578 X Window System User's Guide
Example B-3. The Preferences menu
menu = "Preferences" {
Bell Loud: !"xset b 7&"
Bell Normal: !"xset b 3&"
Bell Off: !"xset b off&"
Click Loud: !"xset c 8&"
Click Soft: !"xset c on&"
Click Off: !"xset c off&"
Lock On: !"xset led on&"
Lock Off: !"xset led off&"
Mouse Fast: !"xset m 4 2&"
Mouse Normal:!"xset m 2 5&"
Mouse Slow: !"xset m 1 l&"
}
Submenus
Frankly, we consider the menus defined by the default.uwmrc file to be rather awkward and
far from complete. Among other things, the WindowOps menu has too many infrequently-
used functions mixed right in with those you need all the time.
For the moment, let's assume that we want to leave the variable definitions and function key
bindings alone, but want to redefine the menus. We might create a local .uwmrc file that con-
tained a menu definition like the one shown in Example B-4.
Example B-4. Window operations divided into two menus
resetmenus
menu = "WindowOps" {
Move:
Resize:
Raise:
Lower:
(De) Iconify:
New window:
Refresh screen:
Restart window manager:
. ,, :
KillWindow:
1, || :
More Window Operations:
f.move
f.resize
f.raise
f.lower
f.iconify
!"xterm -sb&"
f.refresh
f.restart
f.beep
f.kill
f.beep
f.menu:"More Window Operations"
menu = "More Window Operations" {
(De) Iconify and move:
Circulate windows up:
!iii!: ::: Circulate windows down:
.:
Focus keyboard on window:
:::: Freeze server :
iii Unfreeze,, ,,. server:
ii::i:::: E x i t :
i:::?i i.:
f.newiconify
f.circleup
f.circledown
f.focus
f.pause
f.continue
f.beep
f.exit
580 X Window System User's Guide
Color Menus
So far, we've assumed that all menus are black and white. But you can also create color
menus. You can even assign different colors to the menu ritle, the highlighting bar (the hori-
zontal band that follows the pointer within the menu and shows which item is selected) and
the individual selections on the menu.
Colors are added to menus using the following syntax:
menu = "menu name" (title_fg:title_bg:highlight_fg: highliqht_bg) {
"item name": (item_fg:item_bg) : "action"
Up to four different colors can be defined for the overall menu:
title_fg
title_bg
hi ghl i gh t_fg
hi ghl i gh t_bg
The foreground color of the menu rifle (i.e., the color of the lettering).
The background color of the menu ritle.
The foreground color of the highlighting bar (i.e., the color of the
lettering within the bar).
The background color of the highlighting bar.
Two colors can be defined for each menu item:
item_fg
i t em_bg
The foreground color of the item (i.e., the color of the lettering).
The background color of the item.
Colors can be specified either with color names or hex strings, as described in Chapter 8,
Command Line Options.
Here's a color menu that works well on a Sun-3 workstation. Keep in mind that the colors in
the color database may look different on different servers.
menu = "WindowOps" (darkslategrey:plum:darkslategrey:plum)
Move: (slateblue:llghtblue) :f.move
Resize:
Raise:
Lower:
(De) Iconlfy:
New window:
Refresh screen:
Restart window manager:
(slateblue:lightblue) :f.resize
(slateblue:llghtblue) :f.raise
(slateblue:lightblue) :f.lower
(slateblue:lightblue) :f.iconlfy
(slateblue:lightblue) :!'xterm&-
(slateblue:lightblue) :f.refresh
(slateblue:llghtblue) :f.restart
The total number of colors that can be allocated by the window manager for its own use is
specified by the maxcolora variable. If you try to use more than maxcolora colors, the
584 X Window System User's Guide
Example B-8. Modified.uwmrc file (continued)
f. circledown= mete
f. circleup= mete
f. menu=
f. menu=
f. menu=
f. menu=
f. menu= m s
f. menu= ml s
f. menu= m s
f. menu= m s
f. circleup= ml s
f. iconi fy= ml c
f. newiconi fy= ml 1
f. raise= ml 1
f. pushright= m 1
f. pushleft= ml c
f. pu shup= m 1
f. pushdown= ml c
:root:
:root:
:root:
:root:
:root:
:root:
::
::
::
::
::
:windowllcon:
:windowllcon:
:windowllcon:
:windowlcon:
:windowcon:
:windowcon:
:windowllcon:
menu = "WindowOps" {
Move:
Resize:
Raise:
Lower:
(De)Iconify:
New window:
Refresh screen:
Restart window manager:
. ,, :
Kill window:
}
menu = "More Window Operations" {
Iconify and move:
Circulate windows up:
Circulate windows down:
Focus keyboard on window:
Freeze server:
Unfreeze server:
Create color window:
Exit:
menu = "Useful Commands" {
left down
rlght down
middle down
middle down
middle down
middle down
middle down
middle down
middle down
middle down
rght down
left down
left down
left up
right down
right down
middle down
middle down
:"WindowOps"
:"More Window Operations"
:"Useful Commands"
:"Preferences"
:"WindowOps"
:"More Window Operations"
:"Useful Commands"
: "Preferences"
f.move
f.resize
f.raise
f.lower
f.iconify
!"xterm -sb &"
f.refresh
f.restart
f.beep
f.kill
f.newiconify
f.circleup
f.circledown
f.focus
f.pause
f.continue
!"xterm -d unix:0.1 -fg darkslategrey
-bg lightblue -bd plum -bw 5&"
f.beep
f.exit
Digital clock:
Calculator:
Mailbox:
Display keyboard mappings:
Check disk space: ^"df"
Remote login: l"rlogin"
Analog clock: !"xclock -hd darkslategrey -hl darkslategrey
-fg mediumorchid -bg lightblue -bd plum -bw 5
-geometry 162x162-10+10&,,
!"xclock -digital -fg darkslategrey -bg lightblue
-bd plum -bw 5 -geometry 162x37-10+174&"
!"xcalc -geometry 126x230-180+10&"
!"xbiff -bg lightblue -fg lightslategrey -bd plum
-bw 3 -geometry 65x65-353+10&"
!"xmodmap&"
586
X Window System User's Guide
Example B-8. Modified .uwmrc file (continued)
}
menu = "Preferences"
Bell Loud: !"xset
Bell Normal: !"xset
Bell Off: !"xset
Click Loud: !"xset
Click Soft: !"xset
Click Off: !"xset
Lock On: !"xset
Lock Off: !"xset
Mouse Fast: !"xset
Mouse Normal: !"xset
Mouse Slow: !"xset
b 7&"
b 3&"
b off&"
c 9&"
c 2&"
c off&"
led l&"
-led 1 &
m 4 5&"
m 2 5&"
m 1 l&"
The uwm Window Manager 587
C
The OSF/Motif Window Manager
This appendix describes the OSF/Motif TM window manager, mwm, one of the
more popular window managers in the X market today. It describes both the
basics of using mwm and how to customize it.
In This Chapter:
Getting Started with mwm .................................................................... 591
Starting mwm ...................................................................................... 592
Selecting the Window to Receive Input ................................................ 592
Manipulating Windows with the mwm Window Frame ........................... 594
Moving a Window: The Title Area .................................................... 594
Minimizing (Iconifying) and Maximizing a Window ............................ 596
The Minimize Button ...................................................................... 596
The Maximize Button ..................................................................... 597
Raising a Window ............................................................................ 598
Resizing a Window .......................................................................... 599
The Window Menu Button: Display a Menu or Close the Window ..... 602
Manipulating Windows Using the Window Menu ............................... 602
Changing the Window Location: Move .......................................... 604
Resizing the Window: Size ............................................................ 605
Iconifying the Window: Minimize ................................................... 605
Changing to the Maximum Size: Maximize .................................... 606
Moving a Window to the Bottom of the Stack: Lower ..................... 606
Removing a Window: Close .......................................................... 606
Restoring a Maximized Window or an Icon: Restore ..................... 607
Manipulating Icons ............................................................................... 607
Manipulating Icons Using the Window Menu .................................... 607
The Root Menu .................................................................................... 608
Customizing mwm ............................................................................... 610
Activating Changes to the Window Manager .................................... 611
The system.mwmrc File ................................................................... 612
mwm Functions ............................................................................. 614
Menu Specifications ....................................................................... 615
Key Bindings ................................................................................. 616
Button Bindings ............................................................................. 617
Customizing the Root Menu ........................................................... 619
Creating New Menus ..................................................................... 620
Cascading Menus .......................................................................... 620
Setting mwm Resources .................................................................. 622
Component Appearance Resources ............................................... 623
mwm-Specific Appearance and Behavior Resources ..................... 624
Client-Specific Resources .............................................................. 624
Setting the Focus Policy ................................................................ 625
Using an Icon Box ......................................................................... 626
This appendix is intended primarily for those using the default version of mwm, Release 1.0.
If mwm has been customized at your site or you are running a different version, the principles
should be basically the same, but the window manipulation functions may be invoked in dif-
ferent ways. From time to time, we'll mention how commands or functionality might vary,
depending on your version of mwm.
If you have never used a window manager before, first read Chapter 1, An Introduction to the
X Window System, for a conceptual overview of what a window manager does.
In this appendix, we'll take a look at the standard window manipulation functions provided
by mwm and the wide variety of methods for invoking them. Then we'll consider how to cus-
tomize various features of mwm. Perhaps the most useful customization that can be per-
formed involves selecting a keyboard focus policy, either pointer focus or click-to-type
(referred to as explicit) focus. (Keyboard focus is described in Chapter 1, An Introduction to
the X Window System.) By default, mwm uses explicit (click-to-type) focus.
First, however, let's start with some basics: how to start mwm; and how to select the window
to receive input, also known as the active window. Then we'll take a look at perhaps the
most distinguishing feature of mwm: the frame it places around all windows on the display.
Starting mwm
As described in Chapter 2, Getting Started, you can start a window manager from the com-
mand line in an xterm window. The following command line starts mwm:
If xdm (the display manager) or another session manager is starting X on your system, mwm
is probably started automatically when you log on. If mwm is already running, all windows
will be surrounded by the characteristic window frame, pictured in Figure C-1.
If mwm is not running, start it using the command line above. While mwm is starting up, the
root window pointer changes to an hour glass that appears to be filling up with sand. When
the hour glass is full, all windows will become framed, indicating that mwm is running.
Selecting the Window to Receive Input
By default, you select the window to receive input (the active window) by clicking the first
pointer button anywhere within the window. As we've said, this focus policy is called
click-to-type, or explicit. Whether mwm is started automatically or you started it by typing in
an xterm window, you must then click in a window in order to enter text.
Once you focus input to a window, all text typed appears in that window, regardless of where
you move the pointer. In order to type in another window, you must transfer focus to that
window by clicking the first pointer button within it. Later in this appendix, we'll describe
how to make the keyboard focus follow pointer movement.
592 X Window System User's Guide
' 1
Figure C-1. mwm is running on the display
When you focus input on a window, the window frame changes color. Depending on the ver-
sion of mwm you are running and the color resources specified for your system, the frame
may change from black to white, from grey to white, etc. In any case, the active window's
frame will be a different color than the frames of all other windows on the display. (In some
versions, be aware that the black window frame of non-active windows obscures the titlebar
text, which also appears in black. Only the title of the active window is visible in these
caseS.)
Notice that if you are working with a stack of windows that overlap, selecting a window as
the active window automatically raises that window to the top of the stack. (As we'll see
when we look at customization, this behavior is controlled by an mwm resource variable
called aut:oFocusla.se, which is true by default.)
The OSF/Motif Window Manager 593
and a window outline appears. This outline tracks the pointer's movement. In the center
of the screen, a small, rectangular box also appears, displaying the x and y coordinates of
the window as you move it.
4. Drag the cross arrow pointer with the window outline to the desired location on your
screen.
5. Release the first pointer button. The window will move to the selected location.
Figure C-3. Moving a window by dragging the title area
The tide area is the largest section of the horizontal bar that spans the top of the window
frame. This horizontal bar is known as the titlebar. Notice that whenever you move the
pointer into the titlebar, the pointer changes to the arrow cursor.
In addition to the title area, the tidebar features three command buttons: one on the left and
two on the right. These command buttons are described in the following sections.
The OSF/Motif Window Manager 595
Minimizing (Iconifying) and Maximizing a Window
The two command buttons on the right side of the titlebar are the Minimize and Maximize
buttons. The Minimize command button converts a window to an icon. As mentioned previ-
ously, an icon is a small symbol that represents a window in an inactive state.
The Maximize command button can be used to enlarge a window to the size of the root win-
dow, and once the window has been enlarged, to convert it back to its original size.
The Minimize Button
The Minimize command button, immediately to the right of the tide area, is identified by a
tiny square in its center. This button allows you to convert the window to an icon (iconify it),
using the following steps:
1. Place the pointer within the Minimize command button. The pointer simply has to rest
within the button's outer border, not within the tiny square identifying it.
2. Click the first pointer button. The window is iconified. Figure C-4 shows a window being
converted to an icon in this way.
Figure C-4. Converting a window to an icon with the Minimize button
596 X Window System User's Guide
By default, icons are displayed in the bottom left corner of the root window, mwm can also
be set up to place icons in another location, to allow you to place them interactively using the
pointer, or to organize icons within a window known as an icon box. Later in this appendix,
we'll discuss the specifications necessary to set up an icon box.
If you've used other window managers, you may notice that icon symbols generated by mwm
are larger and more decorated than those generated by many other window mangers. This is
one of the aesthetic advantages of mwm. Figure C-5 shows an example.
xterm
/ :: ........... l ...........
Figure C-5. xterm window icon under mwm
To convert the icon back to a window (deiconify it), place the pointer on the icon and double
click, using the first pointer buUon. The window is redisplayed in the position it appeared
before it was iconfied. (See the section "Manipulating Icons" for a summary of functions.)
The Maximize Button
To the right of the Minimize command button (in the upper right corner of the window), the
Maximize command buuon is identified by a larger square in its center. The Maximize but-
ton allows you to enlarge the window to the size of the root window, and once it has been
enlarged, to convert it back to its original size.
To maximize a window, use the following steps:
1. Place the pointer within the Maximize command button. The pointer simply has to rest
within the button's outer border, not within the square identifying it.
2. Crick the first pointer buuon. The window is maximized. Figure C-6 shows how it's
done.
The OSF/Motif Window Manager 597
Figure C-6. Maximizing a window
The large window should function in the same way it did before it was maximized. Theoreti-
cally, you can maximize an xterm window to have a single, very large terminal screen. How-
ever, be aware that certain programs you may run within an xterm, such as the vi text editor,
do not always work properly within a window of this size (even if you've used the resize
client, as described in Chapter 4, The xterm Terminal Emulator). The Maximize function is
more safely used with an application that displays a graphic image or performs a simple func-
tion, such as xclock.
Also, some client programs that do not support resizing, such as the Release 3 version of
xcalc, cannot be maximized correctly. In the case of xcalc, the frame surrounding the calcu-
lator application is maximized, but the actual calculator remains the same size.
The Maximize button is a toggle. To convert a maximized window back to its original size,
click on the Maximize button again with the first pointer button.
Raising a Window
Windows often overlap on the screen. You can raise a window that is obscured by other
windows to the top of the stack using the mwm frame. To raise a window:
598 X Window System User's Guide
1. Place the pointer on any part of the window frame, except the command buttons (Mini-
mize, Maximize, and the button in the upper left comer of the titlebar, which as we'll see,
brings up the Window Idonu).
2. Click the first pointer button. The window is raised to the top of the stack.
When you are using explicit (click-to-type) focus and the other default mwm resources, this
action also selects the window to receive input, i.e., makes the window the active window.
Resizing a Window
One of the most distinctive and useful features of the mwm window frame is not at all obvi-
ous. The entire frame (other than the title area and the command buttons) is designed to
allow you to resize the window using the pointer. Notice that the frame is divided by small
lines into eight sections: four long borders (two horizontal and two vertical) and four
comers. Figure C-7 shows these sections of the window frame.
II !
horizontal border
-- vertical border
Figure C-7. The outer frame is divided into four long borders and four corners
If you place the pointer within a window and then move it into one of the long horizontal or
vertical borders, you'll notice the pointer changes to a new shape: an arrow (pointing toward
the window border), with a short line perpendicular to it. This short line represents the win-
dow border. Try moving the pointer in this fashion in one of the windows on your display to
get a better idea of what the pointer looks like. If you move the pointer from within a win-
dow into the outer border at one of the comers, the pointer will become an arrow pointing
diagonally at a small comer symbol, as pictured in Figure C-8. Figure C-9 shows all of the
possible resize pointers.
Once the pointer changes to one of these shapes, you can move the border (or comer) of the
window. Resizing from one of the long borders only allows you to change one dimension of
the window: a horizontal border can only be moved up or down, changing the height; a verti-
cal border can only be moved left or right, changing the width.
The OSF/Motif Window Manager 599
Figure C-8. Window with resizing pointer
Figure C-9. Resizing pointer symbols
600 X Window System User's Guide
Resizing from a comer offers the most flexibility. You can move a comer in any direction
you choose, changing both dimensions of the window if you want. For example, you can
drag the lower fight corner of a window down and to the fight to enlarge the window in both
dimensions.
You determine the size and shape of the window by choosing the border or corner you want
to extend (or contract) and moving it the desired amount using the following steps:
1. Move the pointer from within the window to the border or corner you want to move. The
pointer changes to one of the symbols pictured in Figure C-9.
2. Press and hold down the first pointer button and drag the window border or corner in the
direction you want. As you resize the window, an image of the moving border(s) tracks
the pointer movement. Also, in the center of the display, a small rectangular window
shows the dimensions of the window as they change (in characters and lines for xterm
windows, in pixels for most other clients).
3. Resize the window as desired.
4. Release the first pointer buuon. The window is redisplayed in the new shape. (The bor-
der image and window geometry tracking box disappear.)
Figure C-10 shows a window being "stretched" from the lower fight corner.
Figure C-10. Dragging the corner to make a window larger
The OSF/Motif Window Manager 601
The following sections explain how each of the Window Menu items works.
To remove the menu without making a selection, move the pointer off of the menu and
release or click the first pointer button, as appropriate.
Notice also that a keyboard shortcut follows each command. The keyboard shortcuts allow
you to perform all of the functions without having to display the menu. All of the keyboard
shortcuts for the menu items involve the Alt key and a function key. (Alt is a logical key-
name that may be associated with a physical key of another name. If you cannot locate the
Alt key on your keyboard, see Chapter 11, Setup Clients, for a discussion of the xmodmap
client.)
There are also keyboard shortcuts to display the Window Menu. Once you place the pointer
anywhere in the window, either of the following key combinations will cause the menu to be
displayed: Shift-Escape or Meta-space. (Like Alt, Meta is a logical keyname recognized by
X programs. There is no key marked "meta" on the keyboard. Rather another key, such as
the Compose Character key on the DECstation 3100 keyboard, functions as Meta. See Chap-
ter 11, Setup Clients, for more information about the Meta key.)
In the following sections, we assume you have displayed the Window Menu by clicking the
first pointer button on the menu command button. (If you display the menu by pressing and
holding down the first pointer button, instructions to click a pointer button can be roughly
translated to mean release the button.)
Changing the Window Location: Move
To move a window:
1. Bring up the Window Menu.
2. Select the Move item by clicking on it with the first pointer button, or by typing the letter
rn. The menu disappears. The pointer changes to the cross arrow pointer and appears in
the center of the window.
3. Move the window by dragging the pointer. When you begin to move the window, a win-
dow outline appears. This outline tracks the pointer's movement. In the center of the
screen, a small rectangular box also appears, displaying the x and y coordinates of the
window as you move it.
4. Drag the cross arrow pointer with the window outline to the desired location on your
screen.
5. Click the first pointer button. The window will move to the selected location.
To cancel the Move function, keep the pointer stationary and click the first button.
The Move function can also be invoked using the keyboard shortcut AIt-F7.
604 X Window System User's Guide
Changing to the Maximum Size: Maximize
To make a window as large as the root window:
1. Bring up the Window Menu.
2. Select the Maximize item by clicking on it with the first pointer button, or typing the letter
3. The window is enlarged to the size of the root window.
The Maximize function can also be invoked using the keyboard shortcut AIt-F10.
Moving a Window to the Bottom of the Stack: Lower
The Lower menu item allows you to send a window to the bottom of the window stack. This
is the only Window Menu function that cannot be performed simply by clicking the pointer on
the window frame. To lower a window:
1. Bring up the Window Menu.
2. Select the Lower item by clicking on it with the first pointer button, or typing the letter :t.
3. The window is moved behind others on the display to the bottom of the window stack.
Though this function cannot be performed by clicking the pointer on the frame, it can be
invoked using the keyboard shortcut AIt-F3.
Removing a Window: Close
The Close menu item terminates the client window and the window is removed from the dis-
play. This powerful command is separated from the other menu items by a horizontal line to
prevent you from inadvertently closing a window.
Be aware that, like other methods of 'killing' a program (such as the xkill client), the Close
menu item can adversely affect underlying processes. Most windows can be removed in
ways that do not harm relevant processes. For example, you can generally remove an xterm
window by typing the same command you use to log off the system. Refer to the section on
xkill in Chapter 7, Other Clients, for a more complete discussion of the hazards of killing a
client and a summary of alternatives.
Like xkill, Close is intended to be used primarily after more conventional methods to remove
a window have failed.
To remove a stubborn window:
1. Bring up the Window Menu.
2. Select the Close item by clicking on it with the first pointer button, or typing the letter c.
3. The window is removed.
606 X Window System User's Guide
Two menu items, Size and Minimize, appear in a lighter typeface, indicating they are not
available for selection. Size cannot be selected because, unlike a window, an icon cannot be
resized. Obviously, Minimize cannot be used to iconify an icon.
Table C-1 summarizes the Window Menu functions when invoked from an icon. For instruc-
tions on selecting an item and performing the various functions, read "Manipulating Win-
dows Using the Window Menu" earlier in this appendix. Note that the keyboard shortcuts
(accelerators) for the commands are also the same as those described for windows.
Table C- 1. Window Menu Actions on an Icon
Menu Item
Restore
Move
Size
Minimize
Maximize
Lower
Close
Function
Converts the icon back to a window.
Moves the icon on the display.
Not available for selection.
Not available for selection.
Converts an icon to a window the size of the
root window.
Sends an icon to the bottom of the win-
dow/icon stack.
Exits the client, removing the icon.
Shortcut
AIt+F5
AIt+F7
n/a
n/a
AIt+F10
AIt+F3
Alt+F4
Later in this appendix, we'll discuss using mwm resources to set up an icon box, a window for
organizing icons on the display. Using an icon box changes the way you work with the Win-
dow Menu from an icon and introduces another menu item, Packlcons, which reorganizes
icons in the icon box. See "Using an Icon Box" later in this chapter for details.
The Root Menu
The Root Menu is mwm's main menu. It provides commands that can be thought of as affect-
ing the entire display and is analogous to the Twm menu describe in Chapter 3. To display
the Root Menu, move the pointer to the root window and press and hold down the first pointer
button. The default Root Menu appears in Figure C-12.
608 X Window System Users Guide
Root Menu ..
:, New Window
-. Shuffle Up
.
Shuffle Down
....
.....
Refresh -
Figure C-12. The mwm Root Menu
When you display the Root Menu, the pointer changes to the arrow pointer. As you can see,
the default Root Menu offers only five items. To select an item, use the following steps:
1. As you continue to hold down the first pointer button, move the pointer onto the the
desired item name. (If you accidentally move the pointer off the menu, it will still remain
displayed, as long as you continue to hold the first button down.) As you move the
pointer onto an item, notice that a rectangular box is displayed around the item to high-
light it.
2. Once the pointer is positioned on the item you want, release pointer button one. The
action is performed.
The functions performed by the default Root Menu are described below.
New Window By default, this command runs an xterm window on the display speci-
fied by the DISPLAY environment variable, generally the local display.
When you create a new window (by using the menu or typing the com-
mand in an xterm), the new window automatically becomes the active
window.
Shuffle Up If windows and/or icons are stacked on your display, this command
moves the bottom window or icon in the stack to the top (raises it).
Shuffle Down If windows and/or icons are stacked on your display, this command
moves the top window or icon in the stack to the bottom (lowers it).
The OSF/Motif Window Manager 609
in your .Xresources file. If you add the following resource specification to your .Xresources
file, MyButtonBindings replace DefaultButtonBindings for all client applica-
tions running with mwm:
Mwm* keyBindings : MyButtonBindings
If you want to use different sets of bindings for different applications, you can add an appli-
cation name between the parts of the resource specification. For example, if you want My-
ButtonBindings tO apply only to xterm windows running with mwm, you could enter the
following resource line:
Mwm* xterm* keyBindings : MyButtonBindings
Then DefaultButtonBindings would s011 apply to all applications other than xterm.
A non-obvious principle behind a key/function (or button/function) binding is that in order
for the keys (or buttons) to invoke the function, the pointer must be in a certain location.
This location is known as the conlexl. For mwm, e most commonly used contexts are:
root, frame, window, and icon. The window context refers to the entire window,
including the frame. (There are a few more specific contexts, such as border, but they are
not used in the system.mwmrc file. See the mwm reference page in your OSF/Motif docu-
mentation for details.)
Some functions can be invoked if the pointer is in more than one context. For example, as
we've seen, you can display the Window Monu from either a window or an icon using the
keyboard shortcuts Meta-space or Shift-Escape. The action involved is f .post_wmenu
and the window and the icon are the pointer contexts from which this action can be per-
formed. These keyboard shortcuts are defined in the key bindings section of the sys-
tem.mwmrc file as follows:
Shift<Key>Escape icon I window f. post_wmenu
Meta<Key>space icon I window f. post_wmenu
Upon examining these lines, we can discern the template for a key binding:
[modi]ier_keys ]<Key>key_name context function
Each binding can have one or more modifier keys (modifiers are optional) and must have a
single primary key (signaled by the word <Key> in angle brackets) to invoke the function. In
the first specification, Shift is the modifier and Escape is the primary key. In the second spec-
ification, Meta is the modifier and space is the primary key. Both specifications have two
acceptable pointer contexts: either a window or an icon. And both bindings are mapped to
the same action, f. post__wmenu, which displays the Window Monu.
Button Bindings
The key bindings section of the file is also titled and bracketed:
Buttons Section Title
l
button bindings defined
The OSF/Motif Window Manager 617
The section type is Buttons. The system.mwmrc file contains three sets of button bindings
with the section ritles:
De faultButtonBindings
ExplicitButtonBindings
p ointerButtonBindings
Button bindings clearly illustrate the need to coordinate your .Xresources and .mwmrc files.
The three sets of button bindings correspond to three possible settings for the resource
buttonBindings. The default setting for the resource is:
Mwm*buttonBindings : De fau ItButtonBindings
specifying that the DefaultButtonBindings are used.
You can specify that one of the other sets of button bindings is to be used by setting this
resource in your .Xresources file. For example, if you add the following specification to your
resource file:
Mwm*buttonBindings : ExplicitButtonBindings
mwm will use those bindings that come under the heading ExplicitButtonBindings
in the .mwmrc file.
Be aware that if you do specify different button bindings, the value of the resource must
exactly match the ride associated with the bindings, or the bindings will not take effect.
The syntax for a button binding specification is very similar to that of a key binding:
[modiJier_key]<button_event> context function
Each binding can have one or more modifier keys (modifiers are optional) and must have a
single button event (enclosed in angle brackets) to invoke the function. The motion that
comprises each button event should be fairly obvious. (A list of acceptable button events
appears on the mwm reference page in your OSF/Motif documentation.)
Now let's see how the button binding syntax relates to the default button bindings in the sys-
tem.mwmrc file:
Buttons DefaultButtonBindings
<BtnlDown> framelicon f.raise
<Btn2Down> framelicon f.post_wmenu
<BtnlDown> root f.menu RootMenu
Meta<BtnlDown> windowlicon f.lower
Meta<Btn2Down> windowlicon f.resize
Meta<Btn3Down> windowlicon f.move
The first specification is familiar. It indicates that the event of pressing down the first pointer
button while the pointer is in a window frame or an icon performs the action of raising the
window or icon, respectively.
Most of the other default button bindings reveal ways to perform mwm functions that were
not covered in the first half of this appendix. Upon closer examination, you should be able to
figure out these bindings and what they do. The second binding reveals still another way to
display the Window Menu, by pressing the second pointer button on a window frame or an
icon.
618 X Window System User's Guide
no-label f. separator
"Restart..." f. restart
}
You can also edit (or remove) existing menu items. For example, if you want to run a termi-
nal emulator program other than xterm, you can edit the menu item definition in your .mwmrc
file. Say you want to run the hpterm terminal emulator (developed by Hewlett-Packard), you
would edit your menu specification to look like this:
Root Menu Description
Menu RootMenu
{
"Root Menu"
No-label
"New Window"
"Shuffle Up"
"Shuffle Down"
"Refresh"
no-label
"Restart..."
f.title
f.separator
f.exec "hpterm &"
f.circle_up
f.circle down
f. refres
f.separator
f.restart
Creating New Menus
Keep in mind that mwm also allows you to specify entirely new menus in your .mwmrc file.
A new menu can be separate from all existing menus, or it can be a submenu of an existing
menu. (Submenus are described in the following section, "Cascading Menus.")
If you want to create a new, independent menu, it must conform to the menu specification
syntax discussed earlier. Items must invoke predefined window manager functions.
The .mwmrc file must also specify how the menu will be displayed and in what context. This
involves associating a key or button with the f. menu function. Say you've specified a new
menu, tided GamesMenu, that runs various game programs, each in its own window. (The
f. exec function would be used to define each item.) The following button binding speci-
fies that pressing the second pointer button on the root window causes the Games Menu to be
displayed:
<Btn2Down> root f.menu GamesMenu
Cascading Menus
mwm also allows you to create submenus, generally known as cascading menus because they
are dis#ayed to the right side of (and slighdy lower than) anoth menu. You define a sub-
menu just as you would any other, using the syntax rums discussed earner. The following
lines create a Utilies Menu that invokes several "desktop" clients and one game:
Menu UtilitiesMenu
{
"Utilities Menu" f.title
No-label f.separator
"Clock" f.exec "xclock &"
"System Load" f.exec "xload &"
620 X Window System User's Gutde
Under these categories fall dozens of mwm resources. The sheer number of resources makes
it impractical for all of them to be discussed here. (You could spend quite a long time cus-
tomizing mwm in this way, if you had the time and inclination!) In the following sections, we
discuss the three categories of resources in somewhat greater detail. We'll then take a look at
two of the more powerful and useful resources, keyboardFocusPolicy and use-
IconBox, which set the focus policy and set up mwm to use an icon box, respectively. For a
comprehensive list of available resources, see the mwm reference page in your OSF/Motif
documentation.
Component Appearance Resources
The Motif window manager can be considered to be made up of components: client window
frames, menus, icons, and what are known as feedback boxes. An example of a feedback box
is the box that appears so that you can confirm or cancel a Restart command from the Root
Menu. (See "The Root Menu" earlier in this appendix.)
Certain resources allow you to specify the appearance of one or all of these mwm component
features. In specifying the resource setting, you can use the name of one of the features as
part of the resource name. For example, one of the most useful component appearance
resources is background, which, as we know from Chapter 8, specifies the background
color. You can specify a resource that sets the background color of any of the mwm compo-
nents. The following resource specification sets the background color of all client window
frames to light blue:
Mwm* client *background : lightblue
Table C-2 summarizes the resource name that corresponds to each of the mwm components:
Table C-2. Resource Names Corresponding to mwm Components
Component
Menu
Icon
Client window frame
Feedback box
Resource name
menu
icon
client
feedback
Thus, to set the background color of feedback boxes to sea green, you'd use the following
resource:
Mwm* feedback* foreground : seagreen
Of course, if you omit any specific component from the resource specification, it applies to
all components. Thus, the following specification sets the background color of all window
frames, feedback boxes, icons, and menus to light grey:
Mwm* foreground : lightgrey
The OSF/Motif Window Manager 623
Many of the client-specific resources provide what might be considered advanced customiza-
tion. For example, a combination of resources allows you to specify your own bitmap as the
image for a client icon. The average user will probably not need most of these resources.
One client-specific resource users might be interested in is called focuaAutoRaiae. This
resource, true by default, causes the active window (the window receiving input focus) to be
raised to the top of the stack. If you are using explicit (click-to-type) focus (also the default),
this behavior is clearly very desirable. However, if you change the focus policy to pointer
focus (as we'll describe in the following section), having focusAutoRaise on can make
the display seem chaotic.
When pointer focus is active, as you move the pointer across the display, the focus changes
from window to window based on the location of the pointer, often a desirable feature. How-
ever, if focusAutoRaiso is still true, each time the pointer moves into a window, the
window will be moved to the front of the display. Simply moving the pointer across a
screenful of windows can create a distracting shuffling effect! If you set the focus policy to
pointer, we suggest you also set focusAutoRaise to false, as in the following example:
Mwm* focusAutoRalse : false
Since an application name is omitted from this resource specification, it applies to all clients.
To change the behavior only for the class ofxterm windows, you could specify:
Mwm*kTerm* focusAutoRaise : false
Of course, suppressing focusAutoRaise with pointer focus is just our preference. You
may want to experiment a while to see how you like working with it.
Setting the Focus Policy
The most common resource users will probably want to set controls mwm's keyboard focus
policy. By default, mwm has explicit (or click-to-type) focus, which is set using the follow-
ing resource:
Mwm* keyboardFocusPol icy : explicit
To change the keyboard focus policy from explicit to pointer focus (that is, focus follows the
movement of the pointer), enter the following line in your Xresources file:
Mwm* keyboardFocu sPol icy : pointer
The OSF/Motif Window Manager 625
Using an Icon Box
One of the most interesting (and desirable) features mwm can provide is a window in which
icons can be organized on the display. This window is known as an icon box, and is pictured
in Figure C-15 below.
ii===! = icons
.. ....
Figure C-15. An icon box
As we'll see, in addition to organizing icons neatly on the display, the icon box also provides
a few window manipulation functions.
You can set up mwm to provide an icon box automatically by specifying the following
resource in your resources file:
Mwm*use IconBox : true
If this resource is included in your resources file (and the resources have been loaded as
described in Chapter 9, Setting Resources), mwm will provide an icon box when it is started
(or restarted). Other resources can be used to customize the size, appearance and location of
the icon box, as well as the window's title. By default, the icon box is six icons wide by one
icon high (the size of individual icons depends on other mwm resources) and is located in the
lower left hand corner of the display.
The horizontal and vertical scrollbars within the icon box suggest a significant, albeit non-
obvious, feature. Icons can extend beyond the visible bounds of the icon box. If more than
six icons are present in the default size box, you can view them using the scrollbars. (See
Chapter 4, The xterm Terminal Emulator, for insuctions on using scrollbars.) Keep in mind
that if icons do extend beyond the visible bounds of the box, the appearance of the scrollbars
will indicate it.
The presence of an icon box changes the way icons are used on the display. If you are using
mwm without an icon box, only those windows that have been iconified are represented by
icons on the display. If you are using mwm with an icon box, all windows on the display are
represented by icons that are stored in the box, whether or not the windows are in an iconfied
state.
626
X Window System User's Guide
xterm
Figure C-16. In the resized icon box, only three icons are visible
Notice the horizontal scrollbar at the bottom of the window, indicating that the other three
icons are still to the right of these and thus not viewable in the resized box. If you place the
pointer on the scrollbar, hold down the first button and drag the scrollbar to the right, the hid-
den icons will be revealed.
In order to rearrange the icons to better fill the new shape box, use the Packlcons menu item.
Figure C-17 shows the icon box after you've selected Packlcons.
_:__--=-------- --___-_:---=---.: -'-: .................................................. --" ...... :--- --------- -:--_---_--_C-_-:------:_- ............. - =:----- - - .....
Figure C-17. Packlcons menu item rearranges icons in resized box
628 X Window System User's Guide
If you want to reorganize icons in the box yourself, without Packlcons, this is also possible.
You can actually move icons into adjacent empty slots using the pointer. Just hold down the
first pointer button on the icon and drag it into the next slot. If you first make the icon box
larger, so that there are several empty spaces, you'll find you can radically reorganize icons.
Once you've arranged them as you like, you resize the box to fit the iconsmor perhaps make
it even smaller and view the obscured icons using the scrollbars.
The OSF/Motif Window Manager 629
D
Standard Cursors
This appendix shows the standard cursor images that can be used by X
programs.
Table D- 1. Standard Cursor Symbols
Symbol Value
XC X cursor 0
XC arrow 2
XC based arrow down 4
XC_ba sed_a rrow_up 6
XC boat 8
XC_bogosity 10
XC bottom left corner 12
XC_bot t ore_right_co rne r 14
XC bottom side 16
XC bottom tee 18
XC_box_s pi ra i 20
XC_cent e r_pt r 22
XC circle 24
XC clock 26
XC_co f fee_mug 28
XC cross 30
XC cross reverse 32
XC crosshair 34
XC diamond cross 36
XC dot 38
XC_dotbox 40
XC double arrow 42
XC_dra ft_l a rge 44
XC draft small 46
XC_draped_box 48
XC_exchange 50
XC_fleur 52
XC_gobbler 54
XC_gumby 56
XC_handl 58
XC_hand2 60
XC_heart 62
XC_icon 64
XC_iron_cross 66
XC_le ft_pt r 68
XC_le ft_side 70
XC_Ie ft_tee 72
XC_leftbutton 74
Symbol Value
XC_ll_angle 76
XC_I r_angle 78
XC man 80
XC middlebutt on 82
--
XC mouse 84
XC_pencil 86
XC_pi rate 88
XC_plus 90
XC_que stion_arrow 92
XC_right_pt r 94
XC_right_side 96
XC_right_tee 98
XC_rightbutton lO0
XC_rt l_logo 102
XC sailboat 104
--
XC sb down arrow 106
XC sb h double arrow 108
--
--
XC sb left arrow 110
-- __ __
XC_sb_right_arrow 112
XC_sb_up_a rrow 114
XC sb v double arrow l l6
--
XC shuttle 118
XC_sizing 120
XC_s pi de r 122
XC_spraycan 124
XC_star 126
XC_t a rge t 128
XC_tcross 130
XC_t op_le ft_a rrow 132
XC_t op_le ft_c o rne r 134
XC_top_right_corner 136
XC_t op_side 138
XC_top_tee 140
XC_trek 142
XC_ul_angle 144
XC_umbrella 146
XC_ur_angle 148
XC_watch 150
XC_xterm 152
634
X Window System User's Guide
Figure D-1. The Standard Cursors
Standard Cursors 635
E
Release 3 and 4 Standard Fonts
This appendix shows the standard display fonts available in Release 4 of the
MIT X distribution. The images contained in this appendix are window
dumps created with our own program, called xshowfonts, the code for which
is included.
Fonts that begin with many blank characters are shown with most leading blanks removed.
Therefore, you can't always get the character number of each cell in the font by counting
from the first cell we have shown. Use xfd to quickly determine the code for a particular cell.
Table E-1. Fonts in the misc Directory, Release 4
Filename
7xl3B.snf
8xl3B.snf
9xl5B.snf
6xl3B.snf
6xl0.snf
7xl3.snf
8xl3.snf
kl4.snf
7xl4.snf
7xl4rk.snf
9xl5.snf
10x20.snf
5x8.snf
6x9.snf
6xl2.snf
6xl3.snf
clB6xl0.snf
clBSxl0.snf
clB6xl2.snf
clBSxl2.snf
clB8xl3.snf
clBSxl4.snf
clB9xl5.snf
clB8xl6.snf
clB8x8.snf
clI6xl2.snf
clI8x8.snf
clR5xl0.snf
clR6xl0.snf
clR7xl0.snf
clRSxl0.snf
clR6xl2.snf
clR7xl2.snf
clR8xl2.snf
clR6xl3.snf
clR8xl3.snf
clR7xl4.snf
clR8xl4.snf
clR9xl5.snf
clR8xl6.snf
Font name
-misc-fixed-bold-r-normal B 13-120-75-75-c-70-iso8859-1
-misc-fixed-bold-r-normal B 13-120-75-75-c-80-iso8859-1
-misc-fixed-bold-r-normal-- 15-140-75-75-c-90-iso8859-1
-misc-fixed-bold-r-semicondensed 13-120-75-75-c-60-iso8859-1
-misc-fixed-medium-r-normal 10-100-75-75-c-60-iso8859-1
-misc-fixed-medium-r-normal 13-120-75-75-c-70-iso8859-1
-misc-fixed-medium-r-normal 13-120-75-75-c-80-iso8859-1
-misc -fixed-medium -r- normal B 14-130-75 -75-c- 140-jisx0208.1983 -0
-misc-fixed-medium-r-normal 14-130-75-75-c-70-iso8859-1
-misc-fixed-medium-r-normal 14-130-75-75-c-70-jisx0201.1976-0
-misc-fixed-medium-r-normal 15-140-75-75-c-90-iso8859-1
-misc-fixed-medium-r-normal--20-200-75-75-c- 100-iso8859-1
-misc-fixed-medium-r-normal 8-80-75-75-c-50-iso8859-1
-misc-fixed-medium-r-normal --9-90-75-75-c-60-iso8859-1
-misc-fixed-medium-r-semicondensed B 12-110-75-75-c-60-iso8859-1
-misc-fixed-medium-r-semicondensed 13-120-75-75-c-60-iso8859-1
-schumacher-clean-bold-r-normal 10-100-75-75-c-60-iso8859-1
-schumacher-clean-bold-r-normal
-schumacher-clean-bold-r-normal
-schumacher-clean-bold-r-normal
-schumacher-clean-bold-r-normal
-schumacher-clean-bold-r-normal
-schumacher-clean-bold-r-normal
-schumacher-clean-bold-r-normal
10-100-75-75-c-80-iso8859-1
12-120-75-75-c-60-iso8859-1
12-120-75-75-c-80-iso8859-1
B 13-130-75-75-c-80-iso8859-1
14-140-75-75-c-80-iso8859-1
-- 15-150-75-75-c-90-iso8859-1
16-160-75-75-c-80-iso8859-1
-schumacher-clean-bold-r-normal 8-80-75-75-c-80-iso8859-1
-schumacher-clean-medium-i-normal 12-120-75-75-c-60-iso8859-1
-schumacher-clean-medium-i-normal B8-80-75-75-c-80-iso8859-1
-schumacher-clean-medium-r-normal 10-100-75-75-c-50-iso8859-1
-schumacher-clean-medium-r-normal 10-100-75-75-c-60-iso8859-1
-schumacher-clean-medium-r-normal 10-100-75-75-c-70-iso8859-1
-schumacher-clean-medium-r-normal 10-100-75-75-c-80-iso8859-1
-schumacher-clean-medium-r-normal __ 12-120-75-75-c-60-iso8859-1
-schumacher-clean-medium-r-normal 12-120-75-75-c-70-iso8859-1
-schumacher-clean-medium-r-normal __ 12-120-75-75-c-80-iso8859-1
-schumacher-clean-medium-r_normal -- 13-130-75-75-c-60-iso8859-1
-schumacher-clean-medium-r-normal 13-130-75-75-c-80-iso8859-1
-schumacher-clean-medium-r-normal 14-140-75-75-c-70-iso8859-1
-schumacher-clean-medium_r_normal 14-140-75-75-c-80-iso8859-1
-schumacher-clean-medium-r-normal 15-150-75-75-c-90-iso8859-1
-schumacher-clean-medium-r_normal B 16-160-75-75-c-80-iso8859-1
640 X Window System User's Guide
Table E-1. Fonts in the misc Directory, Release 4 (continued)
Filename
clR4x6.snf
clR5x6.snf
clR6x6.snf
clR5x8.snf
clR6x8.snf
clR7x8.snf
clR8x8.snf
8xl6.snf
8xl6rk.snf
12x24.snf
12x24rk.snf
olcursor.snf
olgll0.snf
olgll2.snf
olgll4.snf
olgll9.snf
cursor.snf
deccurs.snf
decsess.snf
nil2.snf
Font name
-schumacher-clean-medium-r-normal m6-60-75-75-c-40-iso8859-1
-schumacher-clean-medium-r-normal m6-60-75-75-c-50-iso8859-1
-schumacher-clean-medium-r-normal m6-60-75-75-c-60-iso8859-1
-schumacher-clean-medium-r-normal --8-80-75-75-c-50-iso8859-1
-schumacher-clean-medium-r-normal m8-80-75-75-c-60-iso8859-1
-schumacher-clean-medium-r-normal 8-80-75-75-c-70-iso8859-1
-schumacher-clean-medium-r-normal 8-80-75-75-c-80-iso8859-1
-sony-fixed-medium-r-normal 16-120-100-100-c-80-iso8859-1
-sony-fixed-medium-r-normal -- 16-120-100-100-c-80-jisx0201.1976-0
-sony-fixed-medium-r-normal 24-170-100-100-c- 120-iso8859-1
-sony-fixed-medium-r-normal 24-170-100-100-c- 120-jisx0201.1976-0
-sun-open look cursor ..... 12-120-75-75-p- 160-sunolcursor- 1
-sun-open look glyph ..... 10-100-75-75-p- 101-sunolglyph- 1
-sun-open look glyph ..... 12-120-75-75-p- 113-sunolglyph- 1
-sun-open look glyph ..... 14-140-75-75-p- 128-sunolglyph-1
-sun-open look glyph ..... 19-190-75-75-p- 154-sunolglyph-1
cursor
decw$cursor
decw$session
nil2
Table E-2. Fonts
Filename
courBO10.snf
courBO12.snf
courBO14.snf
courBO18.snf
courBO24.snf
courBO08.snf
courB 10.snf
courB 12.snf
courB 14.snf
courB 18.snf
courB24.snf
courB08.snf
courO10.snf
courO12.snf
courO14.snf
courO18.snf
courO24.snf
in the 75dpi Directory, Release 4
Font name
-adobe-courier-bold-o-normal
-adobe-courier-bold-o-normal
-adobe-courier-bold-o-normal
-adobe-courier-bold-o-normal
-adobe-courier-bold-o-normal
-adobe-courier-bold-o-normal
-adobe-courier-bold -r-normal
-adobe-courier-bold-r-normal
-adobe-courier-bold-r-normal
-adobe-courier-bold-r-normal
-adobe-courier-bold-r-normal
10-100-75-75-m-60-iso8859-1
12-120-75-75-m-70-iso8859-1
14-140-75-75-m-90-iso8859-1
-- 18-180-75-75-m- 110-iso8859-1
m24-240-75-75-m- 150-iso8859-1
--8-80-75-75-m-50-iso8859-1
10-100-75-75-m-60-iso8859-1
12-120-75-75-m-70-iso8859-1
14-140-75-75-m-90-iso8859-1
18-180-75-75-m- 110-iso8859-1
24-240-75-75-m- 150-iso8859-1
-adobe-courier-bold-r-normal m8-80-75-75-m-50-iso8859-1
-adobe-courier-medium-o-normal m 10-100-75-75-m-60-iso8859-1
-adobe-courier-medium-o-normal 12-120-75-75-m-70-iso8859-1
-adobe-courier-medium-o-normal 14-140-75-75-m-90-iso8859-1
-adobe-courier-medium-o-normal 18-180-75-75-m- 110-iso8859-1
-adobe-courier-medium-o-normal 24-240-75-75-m- 150-iso8859-1
Release 3 and 4 Standard Fonts 641
Table E-2. Fonts in the 75dpi Directory, Release 4 (continued)
Filename
courO08.snf
courR10.snf
courR12.snf
courR14.snf
courR18.snf
courR24.snf
courR08.snf
helvBO10.snf
helvBO12.snf
helvBO14.snf
helvBO18.snf
helvBO24.snf
helvBO08.snf
helvB 10.snf
helvB 12.snf
helvB 14.snf
helvB 18.snf
helvB24.snf
helvB08.snf
helvO10.snf
helvO12.snf
helvO14.snf
helvO18.snf
helvO24.snf
helvO08.snf
helvR10.snf
helvR12.snf
helvR 14.snf
helvR18.snf
helvR24.snf
helvR08.snf
ncenBI10.snf
ncenBI12.snf
ncenBI14.snf
ncenBI18.snf
ncenBI24.snf
ncenBI08.snf
ncenB10.snf
ncenB12.snf
ncenB14.snf
ncenB18.snf
ncenB24.snf
ncenB08.snf
ncenI10.snf
Font name
-adobe-courier-medium-o-normal --8-80-75-75-m-50-iso8859-1
-adobe-courier-medium-r-normal -- 10-100-75-75-m-60-iso8859-1
-adobe-courier-medium-r-normal 12-120-75-75-m-70-iso8859-1
-adobe-courier-medium-r-normal 14-140-75-75-m-90-iso8859-1
-adobe-courier-medium-r-normal 18-180-75-75-m- 110-iso8859-1
-adobe-courier-medium-r-normal m24-240-75-75-m- 150-iso8859-1
-adobe-courier-medium-r-normal m8-80-75-75-m-50-iso8859-1
-adobe-helvetica-bold-o-normal 10-100-75-75-p-60-iso8859-1
-adobe-helvetica-bold-o-normal -- 12-120-75-75-p-69-iso8859-1
-adobe-helvetica-bold-o-normal 14-140-75-75-p-82-iso8859-1
-adobe-helvetica-bold-o-normal 18-180-75-75-p- 104-iso8859-1
-adobe-helvetica-bold-o-normal 24-240-75-75-p- 138-iso8859-1
-adobe-helvetica-bold-o-normal 8-80-75-75-p-50-iso8859-1
-adobe-helvetica-bold-r-normal -- 10-100-75-75-p-60-iso8859-1
-adobe-helvetica-bold-r-normal 12-120-75-75-p-70-iso8859-1
-adobe-helvetica-bold-r-normal 14-140-75-75-p-82-iso8859-1
-adobe-helvetica-bold-r-normal 18-180-75-75-p- 103-iso8859-1
-adobe-helvetica-bold-r-normal 24-240-75-75-p- 138-iso8859-1
-adobe-helvetica-bold-r-normal --8-80-75-75-p-50-iso8859-1
-adobe-helvetica-medium-o-normal 10-100-75-75-p-57-iso8859-1
-adobe-helvetica-medium-o-normal 12-120-75-75-p-67-iso8859-1
-adobe-helvetica-medium-o-normal 14-140-75-75-p-78-iso8859-1
-adobe-helvetica-medium-o-normal 18-180-75-75-p-98-iso8859-1
-adobe-helvetica-medium-o-normal m24-240-75-75-p- 130-iso8859-1
-adobe-helvetica-medium-o-normal --8-80-75-75-p-47-iso8859-1
-adobe-helvetica-medium-r-normal 10-100-75-75-p-56-iso8859-1
-adobe-helvetica-medium-r-normal 12-120-75-75-p-67-iso8859-1
-adobe-helvetica-medium-r-normal __ 14-140-75-75-p-77-iso8859-1
-adobe-helvetica-medium-r-normal -- 18-180-75-75-p-98-iso8859-1
-adobe-helvetica-medium-r-normal --24-240-75-75-p- 130-iso8859-1
-adobe-helvetica-medium-r-normal --8-80-75-75-p-46-iso8859-1
-adobe-new century schoolbook-bold-i-normal__ 10-100-75-75-p-66-iso8859-1
-adobe-new century schoolbook-bold-i-normal12-120-75-75-p-76-iso8859_l
-adobe-new
-adobe-new
-adobe-new
-adobe-new
-adobe-new
-adobe-new
-adobe-new
-adobe-new
-adobe-new
-adobe-new
-adobe-new
century
century
century
century
century
century
century
century
century
century
century
schoolbook-bold-i-normal -- 14-140-75-75-p-88-iso8859-1
schoolbook-bold-i-normal 18-180-75-75-p- 111-iso8859-1
schoolbook-bold-i-normal 24-240-75-75-p- 148-iso8859-1
schoolbook-bold-i-normal 8-80-75-75-p-56-iso8859-1
schoolbook-bold-r-normal 10-100-75-75-p-66-iso8859-1
sc hoolbook-bold-r-normal -- 12-120-75 -75 -p-77-iso8859 - 1
schoolbook-bold-r-normal 14-140-75-75-p-87-iso8859-1
schoolbook-bold-r-normal 18-180-75-75-p- 113-iso8859-1
schoolbook-bold-r-normal 24-240-75-75-p- 149-iso8859-1
schoolbook-bold-r-normal--8-80-75_75_p_56_iso8859_l
schoolbook-medium-i-normal 10-100-75-75-p-60-iso8859-1
642 X Window System User's Guide
Table E-2. Fonts in the 75dpi Directory, Release 4 (continued)
Filename
ncenI12.snf
ncenI14.snf
ncenI18.snf
ncenI24.snf
ncenI08.snf
ncenR10.snf
ncenR12.snf
ncenR14.snf
ncenR18.snf
ncenR24.snf
ncenR08.snf
symbl0.snf
symbl2.snf
symbl4.snf
symbl8.snf
symb24.snf
symb08.snf
timBI10.snf
timBI12.snf
timBI14.snf
timBI18.snf
timBI24.snf
timBI08.snf
timB10.snf
timB12.snf
timB14.snf
timB18.snf
timB24.snf
timB08.snf
timI10.snf
timI12.snf
timI14.snf
timI18.snf
timI24.snf
timI08.snf
timR10.snf
timR12.snf
timR14.snf
timR18.snf
timR24.snf
timR08.snf
IuBIS 10.snf
luBIS12.snf
IuBIS 14.snf
Font name
-adobe-new century schoolbook-medium-i-normal m 12-120-75-75-p-70-iso8859-1
-adobe-new century schoolbook-medium-i-normal m 14-140-75-75-p-81-iso8859-1
-adobe-new century schoolbook-medium-i-normal m 18-180-75-75-p- 104-iso8859-1
-adobe-new century schoolbook-medium-i-normal--24-240-75-75-p-136-iso8859-1
-adobe-new century schoolbook-medium-i-normal 8-80-75-75-p-50-iso8859-1
-adobe-new century schoolbook-medium-r-normal 10-100-75-75-p-60-iso8859-1
-adobe-new century schoolbook-medium-r-normal 12-120-75-75-p-70-iso8859-1
-adobe-new century schoolbook-medium-r-normal 14-140-75-75-p-82-iso8859-1
-adobe-new century schoolbook-medium-r-normal m 18-180-75-75-p- 103-iso8859-1
-adobe-new century schoolbook-medium-r-normal 24-240-75-75-p- 137-iso8859-1
-adobe-new century schoolbook-medium-r-normal--8-80-75-75-p-50-iso8859-1
-adobe-symbol-medium-r-normal -- 10-100-75-75-p-61-adobe- fontspecific
-adobe-symbol-medium-r-normal-- 12-120-75-75-p-74-adobe-fontspecific
-adobe-symbol-medium-r-normal -- 14-140-75-75-p-85-adobe-fontspecific
-adobe-symbol-medium-r-normal 18-180-75-75-p- 107-adobe - fontspecific
-adobe-symbol-medium-r-normal 24-240-75-75-p- 142-adobe-fontspecific
-adobe-symbol-medium-r-normal 8-80-75-75-p-51-adobe- fontspecific
-adobe-times-bold-i-normal m 10-100-75-75-p-57-iso8859-1
-adobe-times-bold-i-normal 12-120-75-75-p-68-iso8859-1
-adobe-times-bold-i-normal -- 14-140-75-75-p-77-iso8859-1
-adobe-times-bold-i-normal 18-180-75-75-p-98-iso8859-1 -
-adobe-times-bold-i-normal 24-240-75-75-p- 128-iso8859-1 .
-adobe-times-bold-i-normal 8-80-75-75-p-47-iso8859-1
-adobe-times-bold-r-normal m 10-100-75-75-p-57-iso8859-1 -
-adobe-times-bold-r-normal 12-120-75-75-p-67-iso8859-1
-adobe-times-bold-r-normal 14-140-75-75-p-77-iso8859-1
-adobe-times-bold-r-normal 18-180-75-75-p-99-iso8859-1
-adobe-times-bold-r-normal 24-240-75-75-p- 132-iso8859-1
-adobe-times-bold-r-normal m8-80-75-75-p-47-iso8859-1
-adobe-times-medium-i-normal 10-100-75-75-p-52-iso8859-1
-adobe-times-medium-i-normal 12-120-75-75-p-63-iso8859-1
-adobe-times-medium-i-normal 14-140-75-75-p-73-iso8859-1
-adobe-times-medium-i-normal 18-180-75-75-p-94-iso8859-1
-adobe-times-medium-i-normal m24-240-75-75-p- 125-iso8859-1
-adobe-times-medium-i-normal 8-80-75-75-p-42-iso8859-1
-adobe-times-medium -r-normal 10-100-75 -75 -p-54-iso8859 - 1
-adobe-times-medium-r-normal 12-120-75-75-p-64-iso8859-1
-adobe-times-medium-r-normal 14-140-75-75-p-74-iso8859-1
-adobe-times-medium-r-normal m 18-180-75-75-p-94-iso8859-1
-adobe-times-medium-r-normal 24-240-75-75-p- 124-iso8859-1
-adobe-times-medium-r-normal -- 8-80-75-75-p-44-iso8859-1
-b&h-I ucida-bold-i-normal-sans- 10-100-75-75-p-67-iso8859-1
-b&h-lucida-bold-i-normal-sans- 12-120-75-75-p-79-iso8859-1
-b&h-lucida-bold-i-normal-sans-14-140-75-75-p-92-iso8859-1
Release 3 and 4 Standard Fonts 643
Table E-2. Fonts in the 75dpi Directory, Release 4 (continued)
Filename
IuBIS 18.snf
IuBIS 19.snf
luBIS24.snf
luBIS08.snf
luBS10.snf
luBS12.snf
luBS14.snf
luBS18.snf
luBS19.snf
luBS24.snf
luBS08.snf
lulS 10.snf
lulS 12.snf
lulS 14.snf
lulS 18.snf
IriS 19.snf
lulS24.snf
lulS08.snf
IuRS 10.snf
luRS12.snf
luRS14.snf
luRS18.snf
luRS19.snf
luRS24.snf
luRS08.snf
lubBI10.snf
lubBI12.snf
lubBI14.snf
lubBI18.snf
lubBI19.snf
lubBI24.snf
lubBI08.snf
lubB 10.snf
lubB 12.snf
lubB 14.snf
lubB 18.snf
lubB 19.snf
lubB24.snf
lubB08.snf
lubI10.snf
lubI12.snf
lubI14.snf
lubI18.snf
lubI19.snf
Font name
-b&h-lucida-bold-i-normal-sans- 18-180-75-75-p- 119-iso8859-1
-b&h-lucida-bold-i-normal-sans-19-190-75-75-p- 122-iso8859-1
-b&h-luc ida-bold-i-normal-sans-24-240-75-75-p- 151 -iso8859-1
-b&h-lucida-bold-i-normal-sans-8-80-75-75-p-49-iso8859-1
-b&h-lucida-bold-r-normal-sans- 10-100-75-75-p-66-iso8859-1
-b&h-lucida-bold-r-normal-sans- 12-120-75-75-p-79-iso8859-1
-b&h-lucida-bold-r-normal-sans- 14-140-75-75-p-92-iso8859-1
-b&h-lucida-bold-r-normal-sans- 18-180-75-75-p- 120-iso8859-1
-b&h-lucida-bold-r-normal-sans- 19-190-75-75-p- 122.-iso8859-1
-b&h-lucida-bold-r-normal-sans-24-240-75-75-p- 152-iso8859-1
-b&h-lucida-bold-r-normal-sans-8-80-75-75-p-50-iso8859-1
-b&h-lucida-medium-i-normal-sans- 10-100-75-75-p-59-iso8859-1
-b&h-lucida-medium-i-normal-sans- 12-120-75-75-p-71-iso8859-1
-b&h-lucida-medium-i-normal-sans- 14-140-75-75-p-82-iso8859-1
-b&h-lucida-medium-i-normal-sans- 18-180-75-75-p- 105-iso8859-1
-b&h-lucida-medium-i-normal-sans- 19-190-75-75-p- 108-iso8859-1
-b&h-lucida-medium-i-normal-sans-24-240-75-75-p- 136-iso8859-1
-b&h-lucida-medium-i-normal-sans-8-80-75-75-p-45-iso8859-1
-b&h-lucida-medium-r-normal-sans- 10-100-75-75-p-58-iso8859-1
-b&h-lucida-medium-r-normal-sans- 12-120-75-75-p-71-iso8859-1
-b&h-lucida-medium-r-normal-sans- 14-140-75-75-p-81-iso8859-1
-b&h-lucida-medium-r-normal-sans- 18-180-75-75-p- 106-iso8859-1
-b&h-lucida-medium-r-normal-sans- 19-190-75-75-p- 108-iso8859-1
-b&h-lucida-medium-r-normal-sans-24-240-75-75-p- 136-iso8859-1
-b&h-lucida-medium-r-normal-sans-8-80-75-75-p-45-iso8859-1
-b&h-lucidabright-dem ibold-i-normal m 10-100-75-75-p-59-iso8859-1
-b&h-lucidabright-demibold-i-normal m 12-120-75-75-p-72-iso8859-1
-b&h-lucidabright-demibold-i-normal 14-140-75-75-p-84-iso8859-1
-b&h-lucidabright-demibold-i-normal -- 18-180-75-75-p- 107-iso8859-1
-b&h-lucidabright-demibold-i-normal -- 19-190-75-75-p- 114-iso8859-1
-b&h-lucidabright-demibold-i-normal --24-240-75-75-p- 143-iso8859-1
-b&h-lucidabright-demibold-i-normal 8-80-75-75-p-48-iso8859-1
-b&h-lucidabright-demibold-r-normal -- 10-100-75-75-p-59-iso8859-1
-b&h-lucidabright-demibold-r-normal 12-120-75-75-p-71-iso8859-1
-b&h-lucidabright-demibold-r-normal -- 14-140-75-75-p-84-iso8859-1
-b&h-lucidabright-demibold-r-normal 18-180-75-75-p- 107-iso8859-1
-b&h-lucidabright-demibold-r-normal 19-190-75-75-p- 114-iso8859-1
-b&h-lucidabright-demibold-r-normal --24-240-75-75-p- 143-iso8859-1
-b&h-lucidabright-demibold-r-normal 8-80-75-75-p-47-iso8859-1
-b&h-lucidabright-medium-i-normal 10-100-75-75-p-57-iso8859-1
-b&h-lucidabright-medium-i-normal __ 12-120-75-75-p-67-iso8859-1
-b&h-lucidabright-medium-i-normal 14-140-75-75-p-80-iso8859-1
-b&h-lucidabright-medium-i-normal 18-180-75-75-p- 102-iso8859-1
-b&h-lucidabright-medium-i-normal 19-190-75-75-p- 109-iso8859-1
644 X Window System User's Guide
Table E-2. Fonts in the 75dpi Directory, Release 4 (continued)
Filename
charR18.snf
charR24.snf
charR08.snf
techB 14.snf
termB 14.snf
techl4.snf
term 14.snf
Font name
-bitstream-charter-medium-r-normal m 19-180-75-75-p- 106-iso8859-1
-bitstream-charter-medium-r-normal m25-240-75-75-p- 139-iso8859-1
-bitstream-charter-medium-r-normal 8-80-75-75-p-45-iso8859-1
-dec -terminal-bold-r-normal 14-140-75 -75 -c-80-dec-dectech
-dec-terminal-bold-r-normal 14-140-75-75-c-80-iso8859-1
-dec-terminal-medium-r-normal 14-140-75-75-c-80-dec-dectech
-dec-terminal-medium-r-normal m 14-140-75-75-c-80-iso8859-1
Table E-3. Fonts
Filename
courBO08.snf
courBO10.snf
courBO12.snf
courBO14.snf
courBO18.snf
courBO24.snf
courB08.snf
courB 10.snf
courB 12.snf
courB 14.snf
courB 18.snf
courB24.snf
courO08.snf
courO10.snf
courO12.snf
courO14.snf
courO18.snf
courO24.snf
courR08.snf
courR 10.snf
courR12.snf
courR14.snf
courR18.snf
courR24.snf
helvBO08.snf
helvBO10.snf
helvBO12.snf
helvBO14.snf
helvBO18.snf
helvBO24.snf
in the l OOdpi Directory, Release 4
Font name
-adobe-courier-bold-o-normal 11-80-100-100-m-60-iso8859-1
-adobe-courier-bold-o-normal 14-100-100-100-m-90-iso8859-1
-adobe-courier-bold-o-normal 17-120-100-100-m- 100-iso8859-1
-adobe-courier-bold-o-normal 20-140-100-100-m- 110-iso8859-1
-adobe-courier-bold-o-normal m25-180-100-100-m- 150-iso8859-1
-adobe-courier-bold-o-normal 34-240-100-100-m-200-iso8859-1
-adobe-courier-bold-r-normal 11-80-100-100-m-60-iso8859-1
-adobe-courier-bold-r-normal -- 14-100-100-100-m-90-iso8859-1
-adobe-courier-bold-r-normal -- 17-120-100-100-m- 100-iso8859-1
-adobe-courier-bold-r-normal 20-140-100-100-m- 110-iso8859-1
-adobe-courier-bold-r-normal 25-180-100-100-m- 150-iso8859-1
-adobe-courier-bold-r-normal m34-240-100-100-m-200-iso8859-1
-adobe-courier-medium-o-normal 11-80-1130-100-m-60-iso8859-1
-adobe-courier-medium-o-normal
-adobe-courier-medium-o-normal
-adobe-courier-medium-o-normal
-adobe-courier-medium-o-normal
14-100-100-100-m-90-iso8859-1
17-120-100-100-m- 100-iso8859-1
20-140-100-100-m- 110-iso8859-1
m25-180-100-100-m- 150-iso8859-1
-adobe-courier-medium-o-normal 34-240-100-100-m-200-iso8859-1
-adobe-courier-medium-r-normal 11-80-100-100-m-60-iso8859-1
-adobe-courier-medium-r-normal 14-1130-100-100-m-90-iso8859-1
-adobe-courier-medium-r-normal 17-120-100-100-m - 100-iso8859 - 1
-adobe-courier-medium-r-normal m20-140-100-100-m- 110-iso8859-1
-adobe-courier-medium-r-normal --25-180-100-100-m- 150-iso8859-1
-adobe-courier-medium-r-normal 34-240-100-100-m-200-iso8859-1
-adobe-helvetica-bold-o-normal 11-80-100-100-p-60-iso8859-1
-adobe-helvetica-bold-o-normal 14-100-100-100-p-82-iso8859-1
-adobe-helvetica-bold-o-normal 17-120-100-100-p-92-iso8859-1
-adobe-helvetica-bold-o-normal m20-140-100-100-p- 103-iso8859-1
-adobe-helvetica-bold-o-normal --25-180-100-100-p- 138-iso8859-1
-adobe-helvetica-bold-o-normal 34_240_ 100-100-p-182-iso8859-1
646 X Window System User's Guide
Table E-3. Fonts in the l OOdpi Directory, Release 4 (continued)
Filename
helvB08.snf
helvB10.snf
helvB12.snf
helvB14.snf
helvB 18.snf
helvB24.snf
helvO08.snf
helvO10.snf
helvO12.snf
helvO14.snf
helvO18.snf
helvO24.snf
helvR08.snf
helvR10.snf
helvR12.snf
helvR14.snf
helvR18.snf
helvR24.snf
ncenBI08.snf
ncenBI10.snf
ncenBI12.snf
ncenBI14.snf
ncenBI18.snf
ncenBI24.snf
ncenB08.snf
ncenB10.snf
ncenB12.snf
ncenB14.snf
ncenB18.snf
ncenB24.snf
ncenI08.snf
ncenI10.snf
ncenI12.snf
ncenI14.snf
ncenI18.snf
ncenI24.snf
ncenR08.snf
ncenR10.snf
ncenR12.snf
ncenR14.snf
ncenR18.snf
ncenR24.snf
symb08.snf
symbl0.snf
Font name
-adobe-helvetica-bold-r-normal m 11-80-100-100-p-60-iso8859-1
-adobe-helvetica-bold-r-normal m 14-100-100-100-p-82-iso8859-1
-adobe-helvetica-bold-r-normal 17-120-100-100-p-92-iso8859-1
-adobe-helvetica-bold-r-normal --20-140-100-100-p- 105-iso8859-1
-adobe-helvetica-bold-r-normal --25-180-100-100-p- 138-iso8859-1
-adobe-helvetica-bold-r-normal 34-240-100-100-p- 182-iso8859-1
-adobe-helvetica-medium-o-normal 11-80-100-100-p-57-iso8859-1
-adobe-helvetica-medium-o-normal
-adobe-helvetica-medium-o-normal
-adobe-helvetica-medium-o-normal
-adobe-helvetica-medium-o-normal
-adobe-helvetica-medium-o-normal
-adobe-helvetica-medium-r-normal
-adobe-helvetica-medium-r-normal
-adobe-helvetica-medium-r-normal
-adobe-helvetica-medium-r-normal
-adobe-helvetica-medium-r-normal
-adobe-helvetica-medium-r-normal
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
14-100-100-100-p-78-iso8859-1
m 17-120-100-100-p-88-iso8859-1
20-140-100-100-p-98-iso8859-1
--25-180-100-100-p-130-iso8859-1
34-240-100-100-p- 176-iso8859-1
-- 11-80-100-100-p-56-iso8859-1
14-100-100-100-p-76-iso8859-1
-- 17-120-100-100-p-88-iso8859-1
20-140-100-100-p- 100-iso8859-1
m25-180-100-100-p-130-iso8859-1
-- 34-240-100-100-p- 176-iso8859-1
schoolbook-bold-i-normal 11-80-100-100-p-66-iso8859-1
schoolbook-bold-i-normal 14-100-100-100-p-88-iso8859-1
schoolbook-bold- i-normal 17-120-100-100-p-99-iso8859-1
schoolbook-bold-i-normal 20-140-100-100-p- 111-iso8859-1
schoolbook-bold-i-normal m25-180-100-100-p- 148-iso8859-1
schoolbook-bold-i-normal 34-240-100-100-p- 193-iso8859-1
schoolbook-bold-r-normal 11-80-100-100-p-66-iso8859-1
schoolbook-bold-r-normal 14-100-100-100-p-87-iso8859-1
schoolbook-bold-r-normal m 17-120-100-100-p-99-iso8859-1
schoolbook-bold-r-normal 20-140-100-100-p- 113-iso8859-1
schoolbook-bold-r-normal --25-180-100-100-p- 149-iso8859-1
schoolbook-bold-r-normal m 34-240-100-100-p- 193-iso8859-1
schoolbook-medium-i-normal 11-80-100-100-p-60-iso8859-1
schoolbook-medium-i-normal 14-100-100-100-p-81-iso8859-1
sc hoolbook-medium-i-normal 17-120-100-100-p-92-iso8859-1
schoolbook-medium-i-normal 20-140-100-100-p- 104-iso8859-1
schoolbook-medium-i-normal --25-180-100-100-p- 136-iso8859-1
sc hoolbook-medium-i-normal m 34-240-100-100-p- 182-iso8859-1
schoolbook-medium-r-normal 11-80-100-100-p-60-iso8859-1
schoolbook-medium-r-normal 14-100-100-100-p-82-iso8859-1
schoolbook-medium-r-normal 17-120-100-100-p-91 -iso8859-1
schoolbook-medium-r-normal 20-140-100-100-p- 103-iso8859-1
schoolbook-medium-r-normal m25-180-100-100-p- 136-iso8859-1
-adobe-new century schoolbook-medium-r-normal 34-240-100-100-p- 181-iso8859-1
-adobe-symbol-medium-r-normal -- 11-80-100-100-p-61 -adobe-fontspecific
-adobe-symbol-medium-r-normal 14-100-100-100-p-85-adobe- fontspecific
Release 3 and 4 Standard Fonts 647
Table E-3. Fonts in the l OOdpi Directory, Release 4 (continued)
Filename
luISl2.snf
lulS 14.snf
luISl8.snf
luISl9.snf
luIS24.snf
luRS08.snf
luRS10.snf
luRS12.snf
luRS14.snf
luRS18.snf
luRS19.snf
luRS24.snf
lubBI08.snf
lubB110.snf
lubBI12.snf
lubBI14.snf
lubBI18.snf
lubB119.snf
lubBI24.snf
lubB08.snf
lubB10.snf
lubB12.snf
lubB 14.snf
lubB18.snf
lubB19.snf
lubB24.snf
lubI08.snf
lubI10.snf
lubI12.snf
lub114.snf
lubI18.snf
lubI19.snf
lubI24.snf
lubR08.snf
lubR10.snf
lubR12.snf
lubR14.snf
lubR18.snf
lubR 19.snf
lubR24.snf
lutBS08.snf
lutBS10.snf
lutBS 12.snf
lutBS14.snf
Font name
-b&h-lucida-medium-i-normal-sans- 17-120-100-100-p-97-iso8859-1
-b&h-lucida-medium-i-normal-sans-20-140-100-100-p- 114-iso8859-1
-b&h-lucida-medium-i-normal-sans-25-180-100-100-p- 141-iso8859-1
-b&h-lucida-medium-i-normal-sans-26-190-100-100-p- 147-iso8859-1
-b&h-lucida-medium-i-normal-sans-34-240-100-100-p- 192-iso8859-1
-b&h-lucida-medium-r-normal-sans- 11-80-100-100-p-63-iso8859-1
-b&h-lucida-medium-r-normal-sans-14-100-100-100-p-80-iso8859-1
-b&h-lucida-medium-r-normal-sans-17-120-100-100-p-96-iso8859-1
-b&h-lucida-medium-r-normal-sans-20-140-100-100-p- 114-iso8859-1
-b&h-lucida-medium-r-normal-sans-25-180-100-100-p- 142-iso8859-1
-b&h-lucida-medium-r-normal-sans-26-190-100-100-p- 147-iso8859-1
-b&h-lucida-medium-r-normal-sans-34-240-100-100-p- 191-iso8859-1
-b&h-lucidabright-demibold-i-normal m 11-80-100-100-p-66-iso8859-1
-b&h-lucidabright-demibold-i-normal m 14-100-100-100-p-84-iso8859-1
-b&h-lucidabright-demibold-i-normal 17-120-100-100-p-101-iso8859-1
-b&h-lucidabright-demibold-i-normal 20-140-100-100-p- 119-iso8859-1
-b&h-lucidabright-demibold-i-normal 25-180-100-100-p- 149-iso8859-1
-b&h-lucidabright-demibold-i-normal 26-190-100-100-p- 156-iso8859-1
-b&h-lucidabright-demibold-i-normal m34-240-100-100-p-203-iso8859-1
-b&h-lucidabright-demibold-r-normal 11-80-100-100-p-66-iso8859-1
-b&h-lucidabright-demibold-r-normal 14-100-100-100-p-84-iso8859-1
-b&h-lucidabright-demibold-r-normal 17-120-100-100-p- 101-iso8859-1
-b&h-lucidabright-demibold-r-normal 20-140-100-100-p- 118-iso8859-1
-b&h-lucidabright-demibold-r-normal m25-180-100-100-p- 149-iso8859-1
-b&h-lucidabright-demibold-r-normal 26-190-100-100-p- 155-iso8859-1
-b&h -lucidabright-demibold-r-normal --34-240-100-100-p-202-iso8859-1
-b&h-lucidabright-medium-i-normal 11-80-100-100-p-63-iso8859-1
-b&h-lucidabright-medium-i-normal 14-100-100-100-p-80-iso8859-1
-b&h-lucidabright-medium-i-normal -- 17-120-100-100-p-96-iso8859-1
-b&h-lucidabright-medium-l-normal m20-140-100-100-p-113-iso8859-1
-b&h-lucidabright-medium-i-normal 25-180-100-100-p-142-iso8859-1
-b&h-lucidabright-medium-i-normal 26-190-100-100-p- 148-iso8859-1
-b&h-lucidabright-medium-i-normal 34-240-100-100-p- 194-iso8859-1
-b&h-lucidabright-medium-r-normal -- 11-80-100-100-p-63-iso8859-1
-b&h-lucidabright-medium-r-normal -- 14-100-100-100-p-80-iso8859-1
-b&h-lucidabright-medium-r-normal -- 17-120-100-100-p-96-iso8859-1
-b&h-lucidabright-medium-r-normal 20-140-100-100-p-114-iso8859-1
-b&h-lucidabright-medium-r-normal m25-180-100-100-p-142-iso8859-1
-b&h-lucidabright-medium-r-normal 26-190-100-100-p-149-iso8859-1
-b&h-lucidabright-medium -r-normal 34-240-100-100-p- 193-iso8859-1
-b&h-lucidatypewriter-bold-r-normal-sans- 11-80-100-100-m-70-iso8859-1
-b&h-lucidatypewriter-bold-r-normal-sans- 14-100-100-100-m-80-iso8859-1
-b&h-lucidatypewriter-bold-r-normal-sans- 17-120-100-100-m- 100-iso8859-1
-b&h-lucidatypewriter-bold-r-normal-sans-20-140-100-100-m- 120-iso8859-1
Release 3 and 4 Standard Fonts 649
Table E-3. Fonts in the l OOdpi Directory, Release 4 (continued)
Filename
lutB S 18.snf
lutBS 19.snf
lutBS24.snf
lutRS08.snf
lutRS 10.snf
lutRS 12.snf
lutRS 14.snf
lutRS 18.snf
lutRS 19.snf
lutRS24.snf
charBI08.snf
charBI10.snf
charBI12.snf
charB114.snf
charBI 18.snf
charBI24.snf
charB08.snf
charB 10.snf
charB 12.snf
charB 14.snf
charB18.snf
charB24.snf
charI08.snf
char110.snf
charI12.snf
char114.snf
charI18.snf
charI24.snf
charR08.snf
charR10.snf
charR12.snf
charR14.snf
charR18.snf
charR24.snf
techB 14.snf
termB 14.snf
techl4.snf
terml4.snf
Font name
-b&h-lucidatypewdter-bold-r-normal-sans-25-180-100-100-m- 150-iso8859-1
-b&h-lucidatypewdter-bold-r-normal-sans-26-190-100-100-m- 159-iso8859-1
-b&h-lucidatypewdter-bold-r-normal-sans-34-240-100-100-m-200-iso8859-1
-b&h-lucidatypewdter-medium-r-normal-sans- 11-80-100-100-m-70-iso8859-1
-b&h-lucidatypewdter-medium-r-normal-sans- 14-1130-1130-100-m-80-iso8859-1
-b&h-lucidatypewdter-medium-r-normal-sans- 17-120-1130-100-m-100-iso8859-1
-b&h-lucidatypewdter-medium-r-normal-sans-20-140-1130-100-m-120-iso8859-1
-b&h-lucidatypewdter-medium-r-normal-sans-25-180-1130-100-m-150-iso8859-1
-b&h-lucidatypewdter-medium-r-normal-sans-26-190-1130-100-m-159-iso8859-1
-b&h-lucidatypewdter-me lium-r-normal-sans-34-240-1130-100-m-200-iso8859-1
-bitstream-charter-bold-i-normal -- 11-80-1130-100-p-68-iso8859-1
-bitstream-charter-bold-i-normal D 14-1130-100-100-p-86-iso8859-1
-bitstream-charter-bold-i-normal D 17-120-100-100-p- 105-iso8859-1
-bitstream-charter-bold-i-normal 19-140-100-100-p- 117-iso8859-1
-bitstream-charter-bold-i-normal 25-180-100-100-p- 154-iso8859-1
-bitstream-charter-bold-i-normal 33-240-100-100-p-203-iso8859-1
-bitstream -charter-bold-r-normal 11-80-1130-100-p-69-iso8859-1
-bitstream-charter-bold-r-normal D 14-1130-100-100-p-88-iso8859-1
-bitstream-charter-bold-r-normal 17-120-100-100-p- 107-iso8859-1
-bitstream-charter-bold-r-normal 19-140-100-100-p- 119-iso8859-1
-bitstream-charter-bold-r-normal --25-180-100-100-p- 157-iso8859-1
-bitstream-charter-bold-r-normal 33-240-100-100-p-206-iso8859-1
-bitstream-charter-medium-i-normal 11-80-1130-100-p-60-iso8859-1
-bitstream-charter-medium-i-normal D 14-1130-100-100-p-76-iso8859-1
-bitstream-charter-medium-i-normal -- 17-120-100-100-p-92-iso8859-1
-bitstream-charter-medium-l-normal 19-140-100-100-p- 103-iso8859-1
-bitstream-charter-medium-i-normal --25-180-100-100-p- 136-iso8859-1
-bitstream-charter-medium--normal --33-240-100-100-p- 179-iso8859-1
-bitstream-charter-medium-r-normal 11-80-1130-100-p-61-iso8859-1
-bitstream-charter-medium-r-normal 14-1130-100-100-p-78-iso8859-1
-bitstream-charter-medium-r-normal 17-120-100-100-p-95-iso8859-1
-bitstream-charter-medium-r-normal D 19-140-100-100-p- 106-iso8859-1
-bitstream-charter-medium-r-normal 25-180-100-100-p- 139-iso8859-1
-bitstream-charter-medium-r-normal --33-240-100-100-p- 183-iso8859-1
-bitstream-terminal-bold-r-normal 18-140-100-100-c- 110-dec-dectech
-bitstream-terminal-bold-r-normal 18-140-100-100-c- 110-iso8859-1
-bitstream-terminal-medium_r_normal __ 18-140-100-100-c- 110-dec-dectech
-bitstream-terminal-medium-r-normal __ 18-140-100-100-c- 110-iso8859-1
650 X Window System User's Guide
Table E-5. Fonts in the 75dpi Directory, Release 3 (continued)
Filename
helvB 10
helvB 12
helvB14
helvB18
helvB24
helvB08
helvO10
helvO12
helvO14
helvO18
helvO24
helvO08
helvR10
helvR12
helvR14
helvR 18
helvR24
helvR08
ncenBI10
ncenBI12
ncenBI14
ncenBI18
ncenBI24
ncenBI08
ncenB10
ncenB12
ncenB14
ncenB18
ncenB24
ncenB08
ncenI10
ncenI12
ncen114
ncenI 18
ncenI24
ncenI08
ncenR10
ncenR12
ncenR14
ncenR18
ncenR24
ncenR08
timBI10
timBI12
Font name
-adobe-helvetica-bold-r-normal- - 10-100-75-75-p-60-iso8859-1
-adobe-helvetica-bold-r-normal- - 12-120-75-75-p-70-iso8859-1
-adobe-helvetica-bold-r-normal- - 14-140-75-75-p-82-iso8859-1
-adobe-helvetica-bold-r-normal- - 18-180-75-75-p- 103-iso8859-1
-adobe-helvetica-bold-r-normal- -24 -240-75-75 -p- 138-iso8859-1
-adobe-helvetica-bold-r-normal- -8-80-75-75-p-50-iso8859-1
-adobe-helvetica-medium-o-normal- - 10-100-75-75-p-57-iso8859-1
-adobe-helvetica-medium-o-normal-
-adobe-helvetica-medium-o-normal-
-adobe-helvetica-medium-o-normal-
-adobe-helvetica-medium-o-normal-
-adobe-helvetica-medium-o-normal-
-adobe-helvetica-medium-r-normal-
-adobe-helvetica-medium -r-normal-
-adobe-helvetica-medium-r-normai-
-adobe-helvetica-medium-r-normal-
-adobe-helvetica-medium-r-normal-
-adobe-helvetica-medium-r-normal-
-adobe-new century schoolbook-bold-i-normal-
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
schoolbook-bold-i-normal-
schoolbook-bold-i-normal-
schoolbook-bold-i-normal-
schoolbook-bold-i-normal-
schoolbook-bold-i-normal-
schoolbook-bold-r-normal-
schoolbook-bold-r-normal-
schoolbook-bold-r-normal-
schoolbook-bold-r-normal-
schoolbook-bold-r-normal-
- 12-120-75-75-p-67-iso8859-1
- 14-140-75-75-p-78-iso8859-1
- 18-180-75-75-p-98-iso8859-1
-24-240-75-75-p- 130-iso8859-1
-8-80-75-75-p-47-iso8859-1
- 10-100-75-75-p-56-iso8859-1
- 12-120-75-75-p-67-iso8859-1
-14-140-75-75-p-77-iso8859-1
-18-180-75-75-p-98-iso8859-1
-24-240-75-75-p- 130-iso8859-1
-8-80-75-75-p-46-iso8859-1
- 10-100-75-75-p-66-i so8859-1
- 12-120-75-75-p-76-iso8859-1
- 14-140-75-75-p-88-iso8859-1
- 18-180-75-75-p- 111-iso8859-1
-24-240-75-75-p- 148-iso8859-1
-8-80-75-75-p-56-iso8859-1
- 10-100-75-75-p-66-iso8859-1
- 12-120-75-75-p-77-iso8859-1
- 14-140-75-75-p-87-iso8859-1
- 18 - 180-75-75 -p- 113-iso8859-1
-24-240-75-75-p- 149-iso8859-1
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
-adobe-new century
schoolbook-bold-r-normal- -8-80-75-75-p-56-iso8859-1
schoolbook-medium-i-normal- - 10-100-75-75-p-60-iso8859-1
schoolbook-medium-i-normal- - 12-120-75-75-p-70-iso8859-1
schoolbook-medium-i-normal- - 14-140-75-75-p-81 -iso8859-1
schoolbook-medium-i-normal- - 18-180-75-75-p- 104-iso8859-1
schoolbook-medium-i-normal- -24-240-75-75-p- 136-iso8859-1
schoolbook-medium-i-normal- -8-80-75-75-p-50-iso8859-1
schoolbook-medium-r-normal- - 10-100-75-75 -p-60-iso8859-1
schoolbook-medium-r-normal- - 12-120-75-75-p-70-iso8859-1
schoolbook-medium-r-normal- - 14-140-75-75-p-82-iso8859-1
schoolbook-medium-r-normal- - 18-180-75-75-p- 103-iso8859-1
schoolbook-medium-r-normal- -24-240-75-75-p- 137-iso8859-1
-adobe-new century schoolbook-medium-r-normal- -8-80-75-75-p-50-iso8859-1
-adobe-times-bold-i-normal- - 10-100-75-75-p-57-iso8859-1
-adobe-times-bold-i-normal- - 12-120-75-75-p-68-iso8859-1
652 X Window System User's Guide
Table E-5. Fonts in the 75dpi Directory, Release 3 (continued)
Filename
timBI14
timBI18
timBI24
timBI08
timB10
timB12
timB14
timB18
timB24
timB08
timI10
timI12
timI14
timI18
tim124
timI08
timR10
timR12
timR14
timR18
tirnR24
timR08
charBI10
charBI12
charBI 14
charBI18
charBI24
charBI08
charB10
charB12
charB 14
charB18
charB24
charB08
charI10
chad 12
char114
chad 18
charI24
charI08
charR10
charR12
charR14
charR18
Font name
-adobe-times-bold-i-normal- - 14-140-75-75-p-77-iso8859-1
-adobe-times-bold-i-normal- - 18-180-75-75-p-98-iso8859-1
-adobe-times-bold-i-normal- -24-240-75-75-p- 128-iso8859-1
-adobe-times-bold-i-normal- -8-80-75-75-p-47-iso8859-1
-adobe-times-bold-r-normal- - 10-100-75-75-p-57-iso8859-1
-adobe-times-bold-r-normal- - 12-120-75-75-p-67-iso8859-1
-adobe-times-bold-r-normal- - 14-140-75-75-p-77-iso8859-1
-adobe-times-bold-r-normal- - 18-180-75-75-p-99-iso8859-1
-adobe-times-bold-r-normal- -24-240-75-75-p- 132-iso8859-1
-adobe-times-bold-r-normal- -8-80-75-75-p-47-iso8859-1
-adobe-times-medium-i-normal- - 10-100-75-75-p-52-iso8859-1
-adobe-times-medium-i-normal-
-adobe-times-medium-i-normal-
-adobe-times-medium-i-normal-
-adobe-times-medium-i-normal-
-adobe-times-medium-i-normal-
-adobe-times-medium-r-normal-
-adobe-times-medium-r-normal-
-adobe-times-medium-r-normal-
-adobe-times-medium-r-normal-
-adobe-times-medium-r-normal-
-adobe-times-medium-r-normal-
-bitstream-charter-bold-i-normal-
-bitstream-charter-bold-i-normal-
-bitstream-charter-bold-i-normal-
-bitstream-charter-bold-i-normal-
-bitstream-charter-bold-i-normal-
-bitstream-charter-bold-i-normal-
-bitstream-charter-bold-r-normal-
-bitstream-charter-bold-r-normal-
-bitstream-charter-bold-r-normal-
-bitstream-charter-bold-r-normal-
-bitstream-charter-bold-r-normal-
- 12-120-75-75-p-63-iso8859-1
- 14-140-75-75-p-73-iso8859-1
- 18-180-75-75-p-94-iso8859-1
-24-240-75-75-p- 125-iso8859-1
-8-80-75-75-p-42-iso8859-1
- 10-100-75-75-p-54-iso8859-1
- 12-120-75-75-p-64-i so8859-1
-14-140-75-75-p-74-iso8859-1
- 18-180-75-75-p-94-iso8859-1
-24-240-75-75-p- 124-iso8859-1
-8-80-75-75-p-44-iso8859-1
- 10-100-75-75-p-62-iso8859-1
- 12-120-75-75-p-74-iso8859-1
- 15-140-75-75-p-93-iso8859-1
- 19-180-75-75-p- 117-iso8859-1
-25-240-75-75-p- 154-iso8859-1
-8-80-75-75-p-50-iso8859-1
- 10-100-75-75-p-63-iso8859-1
- 12-120-75-75-p-75-iso8859-1
- 15-140-75-75-p-94-iso8859-1
- 19-180-75-75-p- 119-iso8859-1
-25-240-75-75-p- 157-iso8859-1
-bitstream-charter-bold-r-normal- -8-80-75-75-p-50-iso8859-1
-bitstream-charter-medium-i-normal- - 10-100-75-75-p-55-iso8859-1
-bitstream-charter-medium-i-normal- - 12-120-75-75-p-65-iso8859-1
-bitstream-charter-medium-i-normal- - 15-140-75-75-p-82-iso8859-1
-bitstream-charter-medium-i-normal- - 19-180-75-75-p- 103-iso8859-1
-bitstream-charter-medium-i-normal- -25-240-75-75-p- 136-iso8859-1
-bitstream-charter-medium-i-normal- -8-80-75-75-p-44-iso8859-1
-bitstream-charter-medium-r-normal- - 10-100-75-75-p-56-iso8859-1
-bitstream-charter-medium-r-normal- - 12-120-75-75-p-67-iso8859-1
-bitstream-charter-medium-r-normal- - 15-140-75-75-p-84-iso8859-1
-bitstream-charter-medium-r-normal- - 19-180-75-75-p- 106-iso8859-1
Release 3 and 4 Standard Fonts 653
Table E-5. Fonts in the 75dpi Directory, Release 3 (continued)
Filename
charR24
charR08
symbl0
symbl2
symbl4
symbl8
symb24
symb08
Font name
-bitstream-charter-medium-r-normal- -25-240-75-75-p- 139-iso8859-1
-bitstream-charter-medium-r-normal- -8-80-75-75-p-45-iso8859-1
dec-adobe-symbol-medium-r-normal- - 10-100-75-75-p-61-adobe-fontspecific
dec-adobe-symbol-medium-r-normal- - 12-120-75-75-p-74-adobe-fontspecific
dec-adobe-symbol-medium-r-normal- - 14-140-75-75-p-85 -adobe-fontspecific
dec-adobe-symbol-medium-r-normal- - 18-180-75-75-p- 107-adobe- fontspecific
dec-adobe-symbol-medium-r-normal- -24-240-75-75-p- 142-adobe-fontspecific
dec-adobe-symbol-medium-r-normal- -8-80-75-75-p-51-adobe-fontspecific
Table E-6. Fonts in the l OOdpi Directory, Release 3
Filename
charBI08
charBI10
charBI 12
charBI14
charBI18
charBI24
charB08
charB10
charB 12
charB 14
charB 18
charB24
charI08
charI10
charI12
charI14
charI18
charI24
charR08
charR10
charR12
charR 14
charR18
charR24
Font name
-bitstream-charter-bold-i-normal-
-bitstream-charter-bold-i-normal-
-bitstream-charter-bold-i-normal-
-bitstream-charter-bold-i-normal-
-bitstream-charter-bold-i-normal-
-bitstream-charter-bold-i-normal-
-bitstream-charter-bold-r-normal-
-bitstream-charter-bold-r-normal-
-bitstream-charter-bold-r-normal-
-bitstream-charter-bold-r-normal-
-bitstream-charter-bold-r-normal-
-bitstream-charter-bold-r-normal-
-bitstream-charter-medium-i-normal-
-bitstream-charter-medium-i-normal-
-bitstream-charter-medium--normal-
-bitstream-charter-medium-i-normal-
-bitstream-charter-medium-i-normal-
-bitstream-charter-medium--normal-
-bitstream-charter-medium-r-normal_
-bitstream-charter-medium-r-normal-
-bitstream-charter-medium-r-normal-
-bitstream-charter-medium-r-normal-
-bitstream-charter-medium-r-normal-
-bitstream-charter-medium-r-normal.
- 11-80-100-100-p-68 -iso8859-1
- 14-100-100-100-p-86-iso8859-1
- 17-120-100-100-p-105-iso8859-1
- 19-140-100-100-p- 117-iso8859-1
-25-180-100-100-p- 154-iso8859-1
-33-240-100-100-p-203-iso8859-1
- 11-80-100-100-p-69-iso8859-1
- 14-100-100-100-p-88-iso8859-1
- 17-120-100-100-p- 107-iso8859-1
-19-140-100-100-p-119-iso8859-1
-25-180-100-100-p-157-iso8859-1
-33-240-100-100-p-206-iso8859-1
- 11-80-100-100-p-60-iso8859-1
- 14-100-100-100-p-76-iso8859-1
- 17-120-100-100-p-92-iso8859-1
- 19-140-100-100-p- 103-iso8859-1
-25-180-100-100-p- 136-iso8859-1
-33-240-100-100-p- 179-iso8859-1
- 11-80-100-100-p-61-iso8859-1
- 14-100-100-100-p-78-iso8859-1
- 17-120-100-100-p-95-iso8859-1
- 19-140-100-100-p- 106-iso8859-1
-25-180-100-100-p- 139-iso8859-1
-33-240-100-100-p- 183-iso8859-1
654 X Window System User's Guide
I
0
I
.r'l
0
U
I
0
I
Foundry: adobe
Family: courier
Release 3 and 4 Standard Fonts 655
I
I Ii
Foundry: adobe
Family: helvetica
656
X Window System User's Guide
Foundry: adobe
Family: new century schoolbook
Release 3 and 4 Standard Fonts 657
Foundry: b&h
Family: lucida
658
X Window System User's Guide
Foundry: b&h
Family: lucidabright
Release 3 and 4 Standard Fonts 659
Foundry: adobe
Family: times
660 X Window System User's Guide
Foundry: adobe
Family: symbol
Foundry: b&h
Family: lucidatypewriter
Release 3 and 4 Standard Fonts 661
Foundry: bitstream
Family: charter
662
X Window System User's Guide
Foundry: misc
Family: fixed
664
X Window System User's Guide
Foundry: schumacher
Family: clean
Release 3 and 4 Standard Fonts 665
I
Encoding: adobe-fontspecific
666 X Window System User's Guide
Encoding: iso8859
668 X Window System User's Guide
I .1 II/
Encoding: jisx0201.1976
Release 3 and 4 Standard Fonts 669
Encoding: jisx0208.1983
670 X Window System User's Guide
m V O0 -r X rm X
Encoding: jisx0201.1976
Release 3 and 4 Standard Fonts 671
Encoding: SunOLcursor
Release 3 and 4 Standard Fonts 673
Example E-1 is the source code for the xshowfonts program, which we used to create most of
the illusations in this appendix. If you don't want to type it in, you can find instructions for
getting it online in the Preface.
i" Example E-1. xshowfont source listing
::!ililii /* Dan Heller <argv@sun.com>, based on a design by Tim O'Reilly
,
* xshowfonts.c -
* Displays a set of fonts specified on the command line, from
* a pipe, or typed into stdin. Fonts can be specified as specific
* fonts or as wildcard character strings. A pixmap is created to
* display all the fonts. This is done by using the pixmap as the
* pixmap image for a label widget. Each font prints its own name
* in its own font style -- the -phrase option prints the phrase
* instead.
,
* All fonts are loaded first and scanned to determine the total
* width and height of the pixmap first. Then the fonts are
* reopened again to actually render the fonts into the pixmap.
* All this could be avoided by using XListFontsWithInfo()
* rather than XListFonts(), but since the list is potentially
* very large, I didn't want to overload the server and client
* with all those fonts + a very large pixmap.
,
* Usage: xshowfonts
* -s sorts the fonts in alphabetical order before displaying
them.
* -v verbose mode for when input is redirected to stdin.
* -w width of viewport window
* -h height of viewport window
* -fg foreground_color
* -bg background_color
* -phrase "text string" (otherwise, name of font is used)
* -indicates to read from stdin. Piping doesn't require
the '-' argument. With no arguments, xshowfonts reads
* from stdin anyway.
:i * Neat ways to use the program:
* xshowfonts -fg green -bg black "*adobe*"
* xshowfonts -sort "*"
* xshowfonts -phrase "The quick brown fox jumps over the lazy
* dog .... *times*"
* xlsfonts I xshowfonts -sort
* xshowfonts "*helvetica*"
*
.
* compile: (triple click and paste next line)
i .... cc -O -s xshowfonts.c -IXaw -IXt -IXmu -IXll -o xshowfonts
::i:!::
........ #include <stdio.h>
iii!iiii! #include <Xll/Intrinsic h>
:i:i:i:!::! "
iiiiiiiiiiil #include <Xll/StringDefs. h>
:.:.:.:.:.:.
iiii!: #include <Xll/Xaw/Label.h>
!!ii!iiii #include <Xl i/Xaw/Viewport, h>
iiii!iiiiiiil, struct _resrcs (
..... iiiiiii!i int sort;
674 X Window System User's Guide
Example E- 1. xshowfont source listing (continued)
int verbose;
Plxel fg, bg;
char *phrase ;
int view_width, view_height;
static XtResource resources[]= {
{ "sort", "Sort", XtRBoolean, sizeof (int),
XtOffsetOf(struct _resrcs, sort), XtRImmediate,
False },
{ "verbose", "Verbose", XtRBoolean, sizeof (int),
XtOffsetOf(struct _resrcs,verbose), XtRImmediate,
False },
{ "foreground", "Foreground", XtRPixel, sizeof (Pixel),
XtOffsetOf(struct _resrcs, fg), XtRString,
XtDefaultForeground },
{ "background", "Background", XtRPixel, sizeof (Pixel),
XtOffsetOf(struct resrcs,bg), XtRString,
--
XtDefaultBackground },
{ "phrase", "Phrase", XtRString, sizeof (String),
XtOffsetOf(struct resrcs,phrase), XtRImmediate, NULL },
--
{ "vlew-width", "View-wldth", XtRInt, sizeof (int),
XtOffsetOf(struct resrcs,view width), XtRImmediate,
-- --
(char *)500 },
{ "view-height", "View-height", XtRInt, sizeof (int),
XtOffsetOf(struct _resrcs,view_height), XtRlmmedlate,
(char *)300 },
static XrmOptionDescRec options[] = {
{ "-sort", "sort", XrmoptionNoArg, "True" },
{ "-v", "verbose", XrmoptionNoArg, "True" },
{ "-fg", "foreground", XrmoptionSepArg, NULL },
{ "-bg", "background", XrmoptionSepArg, NULL },
{ "-phrase", "phrase" XrmoptionSepArg, NULL }
{ "-w", "vlew-width", XrmoptionSepArg, NULL },
{ "-h", "vlew-height", XrmoptionSepArg, NULL },
/* sort font according to the following parameters.
* font specs we're interested in:
* -fndry-fmly-wght-slant-*swdth-*adstyl-*pxlsz-ptsz- ....
: foundry-- sort by foundry first; similar ones are always
grouped together
* weight--medium, demi-bold, bold
* slant -- roman, italic/oblique, reverse italic/oblique
* o,
* ptslze -- increase numerical order
*/
font_cmp(fl, f2)
char **fl **f2;
,
char fndryl[16], fmlyl[64], wghtl[32], slantl[3];
char fndry2116], fmly2164], wght2132], slant2[3];
int n, m, ptsizel, ptsize2;
char *font fmt str = "-%['-]-%['-]-%['-]-%[^-]-%*['0-91%
,d_%dU. ; --
Release 3 and 4 Standard Fonts 675
Example E-1. xshowfont source listing (continued)
n = sscanf(*fl, font_fmt_str, fndryl, fmlyl, wghtl, slantl,
&ptsizel);
m = sscanf(*f2, font fmt str, fndry2, fmly2, wght2, slant2,
&ptsize2);
if (m < 5 n < 5)
/* font not in correct format -- Just return font names
* in order */
return strcmp(*fl, *f2);
if (n = strcmp(fndryl, fndry2))
return n; /* different foundries -- return alphabetical
* order */
if (n = strcmp(fmlyl, fmly2))
return n; /* different families -- return alphabetical
* order */
if (n = strcmp(wghtl, wght2))
return -n; /* weight happens to be correct in reverse
* alpha order */
if (n = strcmp(slantl, slant2))
return n; /* slants happen to be correct in alphabetical
* order */
/* sort according to point size */
return ptsizel - ptsize2;
main(argc, argv)
ii;i. int argc;
!ili ! .... char{ *argv[];
Widget topLevel, vp;
char **list = (char **)NULL, **tmp;
char buf[128];
extern char **XListFonts();
extern int strcmp();
XFontStruct *font;
Pixmap pixmap;
GC gc;
Display *dpy;
int istty = isatty(0), redirect = !istty, i, j, total = 0;
unsigned int w, width = 0, height = 0;
topLevel = XtInitialize(argv[0], argv[0], options,
XtNumber (options), &argc, argv) ;
dpy = XtDisplay(topLevel) ;
XtGetApplicationResources(topLevel, &Resrcs,
resources, XtNumber(resources), NULL, 0);
if (!argv[l] !strcmp(argv[l], "-")) {
printf("Loading fonts from input. ");
if (istty) {
puts("End with EOF or .");
redirect++;
} else
puts("Use -v to view font names being loaded.");
} else if (!istty && strcmp(argv[l], "-"))
printf("%s: either use pipes or specify font names --
not both.\n",
676 X Window System User's Guide
Example E- 1. xshowfont source listing (continued)
}
if ((w = XTextWidth(font, list[i],
strlen(list[i]))) > width)
width = w;
height += font->ascent + font->descent;
XFreeFont(dpy, font) ;
}
width += 6;
height += 6;
/* Create pixmap + GC */
printf("Creating pixmap of size %dx%d\n", width, height);
if (!(pixmap = XCreatePixmap(dpy, DefaultRootWindow(dpy),
width, height, DefaultDepth(dpy, DefaultScreen(dpy)))))
XtError("Can't Create pixmap");
if (!(gc = XCreateGC(dpy, pixmap, NULL, 0)))
XtError("Can't create gc");
XSetForeground(dpy, gc, Resrcs.bg);
XFillRectangle(dpy, pixmap, gc, 0, 0, width, height);
XSetForeground(dpy, gc, Resrcs.fg);
XSetBackground(dpy, gc, Resrcs.bg);
height = 0;
for (i = 0; i < total; i++) {
if (!(font = XLoadQueryFont(dpy, list[i])))
continue; /* it's already been reported */
XSetFont(dpy, gc, font->fid);
height += font->ascent;
if (Resrcs.phrase)
XDrawString(dpy, pixmap, gc, 0, height,
Resrcs.phrase, strlen(Resrcs.phrase));
else
XDrawString(dpy, pixmap, gc, 5, height, list[i],
strlen(list[i]));
height += font->descent;
XFreeFont(dpy, font);
}
vp = XtVaCreateManagedWidget("viewport", viewportWidgetClass,
topLevel,
XtNallowHoriz, True,
XtNallowVert, True,
XtNwidth, Resrcs.view_width,
XtNheight, Resrcs.view_height,
NULL);
XtVaCreateManagedWidget("_foo", labelWidgetClass, vp,
XtNbitmap, pixmap,
NULL);
if (!redirect)
XFreeFontNames(list);
XtRealizeWidget(topLevel);
XtMainLoop();
678 X Window System User's Guide
F
xterm Control Sequences
This appendix list the escape sequences that can be used to control features
of an xterm window or its terminal emulation.
In This Chapter:
xterm Control Sequences .................................................................... 681
Definitions ........................................................................................ 681
VT102 Mode .................................................................................... 681
Tektronix 4014 Mode ....................................................................... 688
Bell (Ctrl-G)
Backspace (Ca'l-H)
Horizontal Tab (Ca'l-I)
Line Feed or New Line (Ca'l-J)
Vertical Tab (Ca'I-K)
Form Feed or New Page (Ca'l-L)
Carriage Return (Ca'l-M)
Shift Out (Ca'l-N) -- Switch to Alternate Character Set
Shift In (Ca'l-O) -- Switch to Standard Character Set
Same as non-escaped BEL
Same as non-escaped BS
Same as non-escaped HT
Same as non-escaped NL
Same as non-escaped VT
Same as non-escaped NP
Same as non-escaped CR
Same as non-escaped SO
Same as non-escaped SI
Same as non-escaped BEL
Same as non-escaped BS
Same as non-escaped HT
Same as non-escaped NL
Same as non-escaped VT
Same as non-escaped NP
Same as non-escaped CR
Same as non-escaped SO
Same as non-escaped SI
DEC Screen Alignment Test (DECALN)
Same as non-escaped BEL
Same as non-escaped BS
Same as non-escaped HT
Same as non-escaped NL
Same as non-escaped VT
Same as non-escaped NP
Same as non-escaped CR
Same as non-escaped SO
682
X Window System User's Guide
Same as non-escaped SI
Select GO Character Set (SCS)
C = Special Character and Line Drawing Set
C = [i] Alternate Character ROM Standard Set
C = [ -- Alternate Character ROM Special Set
C = [] United Kingdom (UK)
C = ] United States (USASCII)
Select G1 Character Set (SCS)
C -- ] Special Character and Line Drawing Set
C = [i] Alternate Character ROM Standard Set
C = [] Alternate Character ROM Special Set
C = [ United Kingdom (UK)
C = [- United States (USASCII)
Select G2 Character Set (SCS)
C = ] Special Character and Line Drawing Set
C = [i] Alternate Character ROM Standard Set
C = ] -- Alternate Character ROM Special Set
C = [] United Kingdom (UK)
C = [- United States (USASCII)
Select G3 Character Set (SCS)
C = ] Special Character and Line Drawing Set
C = [i] Alternate Character ROM Standard Set
C = [] Alternate Character ROM Special Set
C = [] United Kingdom (UK)
C = [- -- United States (USASCII)
Save Cursor (DECSC)
Restore Cursor (DECRC)
Application Keypad (DECPAM)
Normal Keypad (DECPNM)
Index (IND)
Next Line (NEL)
Tab Set (HTS)
Reverse Index (RI)
Single Shift Select of G2 Character Set (SS2)
Single Shift Select of G3 Character Set (SS3)
Return Terminal ID (DECID)
xterm Control Sequences 683
Same as non-escaped BEL
Same as non-escaped BS
Same as non-escaped HT
Same as non-escaped NL
Same as non-escaped VT
Same as non-escaped NP
Same as non-escaped CR
Same as non-escaped SO
Same as non-escaped SI
Same as non-escaped BEL
Same as non-escaped BS
Same as non-escaped HT
Same as non-escaped NL
Same as non-escaped VT
Same as non-escaped NP
Same as non-escaped CR
Same as non-escaped SO
Same as non-escaped SI
Insert Ps (Blank) Character(s) (default = 1) (ICH)
Cursor Up Ps Times (default = 1) (CUU)
Cursor Down Ps Times (default = 1) (CUD)
Cursor Forward Ps Times (default = 1) (CUF)
Cursor Backward Ps Times (default = 1) (CUB)
Cursor Position [row;column] (default = [1,1]) (CUP)
Erase in Display (ED)
Ps = 0 --) Clear Below (default)
Ps = [ --) Clear Above
Ps = [] - Clear All
Erase in Line (EL)
Ps = 6] - Clear to Right (defaul0
Ps = [ --) Clear to Left
Ps = ] -) Clear All
Insert Ps Line(s) (default = 1) (IL)
Delete Ps Line(s) (default = 1) (DL)
Delete Ps Character(s) (default = 1) (DCH)
Track mouse
684 X Window System User's Guide
Ps ND string NP
Device Attributes (DA1)
Cursor Position [row:column] (default = [1,1]) (HVP)
Tab Clear
Ps = -' Clear Current Column (default)
e, = -, clear An
Mode Set (SET)
Ps = ] Insert Mode 0RM)
Ps = [ Automatic Linefeed (LNM)
Mode Reset (RST)
Ps = ] Insert Mode 0RM)
Ps = [ Automatic Linefeed (LNM)
Character Attributes (SGR)
Pm = -- Normal (default)
Pm = ] -') Blink (appears as Bold)
Pm = ] Underscore
Pm = --> Bold
P = ] -- Inverse
Device Status Report (DSR)
Ps = 5 --> Status Report [[0-][] --) OK
Ps = 6 -- Report Cursor Position (CPR) [row;column] as
Set Scrolling Region [top;bottom] (default = full size of window)
(DECSTBM)
Request Terminal Parameters (DECREQTPARM)
OSC Mode
ND can be any non-digit Character (it's discarded)
NP can be any non-printing Character (it's discarded)
string can be any ASCII printable string (max 511 characters)
Ps = -] -- use string as a new icon name and title
Ps = ] -- use string as a new icon name only
Ps = [] -- use string as a new title only
Ps = [][ -- use string as a new log file name
DEC Private Mode Set (DECSET)
Ps = ] -- Application Cursor Keys (DECCKM)
Ps = [] -- Set VT52 Mode
Ps = [] -- 132 Column Mode (DECCOLM)
xterrn Control Sequences 685
Ps = Smooth (Slow) Scroll (DECSCLM)
Ps = [] Reverse Video (DECSCNM)
Ps = [] Origin Mode (DECOM)
Ps = [] Wraparound Mode (DECAWM)
Ps = I- Auto-repeat Keys (DECARM)
Ps = [] -- Send MIT Mouse Row & Column on Button Press
Ps = [I- Enter TekTronix Mode (DECTEK)
Ps = ][-0-] -- Allow 80 -- 132 Mode
Ps = ][ curses(5) fix
Ps = ]] -- Turn On Margin Bell
Ps = ][] Reverse-wraparound Mode
Ps = [][] Start Logging
Ps = ][] Use Alternate Screen Buffer
Ps = [[-0-][-0-][-0-] send VT200 Mouse Row & Column on Button
Press
,--l-0T0q[ --, e vr200 ii roue Row Coum o
Button Press
DEC Private Mode Reset (DECRST)
Ps = i] Normal Cursor Keys (DECCKM)
Ps = [ -- 80 Column Mode (DECCOLM)
Ps = ] Jump (Fast) Scroll (DECSCLM)
Ps = [] -- Normal Video (DECSCNM)
Ps = [] Normal Cursor Mode (DECOM)
Ps = [] No Wraparound Mode (DECAWM)
Ps = I- No Auto-repeat Keys (DECARM)
Ps = [] -- Don't Send MIT Mouse Row & Column on Button Press
Ps = ][-0-] Disallow 80 -- 132 Mode
Ps = [][ No curses(5) fix
Ps = [][] -- Turn Off Margin Bell
Ps = ][] -- No Reverse-wraparound Mode
Ps = [][] Stop Logging
Ps = [][] Use Normal Screen Buffer
Ps = [[[-0-][-0-] Don't send Mouse Row & Column on Button Press
Ps = [1-0-]1-0-][ --) Don't send Hilite Mouse Row & Column on Button
Press
686
X Window System User's Guide
Restore DEC Private Mode
g = ] Normal/Application Cursor Keys (DECCKM)
g =[ -- 80/132 Column Mode (DECCOLM)
g = [] -- Jump (Fast)/Smooth (Slow) Scroll (DECSCLM)
g = [] -- Normal/Reverse Video (DECSCNM)
g = -] -- Normal/Origin Cursor Mode (DECOM)
g = ] -- No Wraparound/Wraparound Mode (DECAWM)
g = ] -- Auto-repeat/No Auto-repeat Keys (DECARM)
g = [] -- Don't Send/Send MIT Mouse Row & Column on Button
Press
g = [][-0-] -- Disallow/Allow 80 - 132 Mode
g = []] -- Off/On curses(5) fix
g = Turn Off/On Margin Bell
g = [][ No Reverse-wraparound/Reverse-wraparound Mode
g = Stop/Start Logging
g = [][] Use Normal/Alternate Screen Buffer
g = ][-0-][-0-][-0-] Don't send/send VT200 Mouse Row & Column on
Button Press
g = ][0-][]] -- Don't send/send VT200 Hilite Mouse Row &
Column on Button Press
Save DEC Private Mode
g = ] -- Normal/Application Cursor Keys (DECCKM)
--NN
80/132 Column Mode (DECCOLM)
Jump (Fast)/Smooth (Slow) Scroll (DECSCLM)
Normal/Reverse Video (DECSCNM)
Normal/Origin Cursor Mode (DECOM)
No Wraparound/Wraparound Mode (DECAWM)
Auto-repeat/No Auto-repeat Keys (DECARM)
Don't Send/Send MIT Mouse Row & Column on Button
Press
-- Disallow/Allow 80 - 132 Mode
-- Off/On curses(5) fix
-- Turn Off/On Margin Bell
-- No Reverse-wraparound/Reverse-wraparound Mode
Stop/Start Logging
-- Use Normal/Alternate Screen Buffer
xterm Control Sequences 687
Select #2 Character Set
Select #3 Character Set
Select Small Character Set
Set Text Parameters
Ps = ] --> Change Window Name and Title to Pt
Ps --[iq --> Change Icon Name to Pt
Ps = [ -> Change Window Title to Pt
Ps = ]6-] --> Change Log File to Pt
Normal Z Axis and Normal (solid) Vectors
Normal Z Axis and Dotted Line Vectors
Normal Z Axis and Dot-Dashed Vectors
Normal Z Axis and Short-Dashed Vectors
Normal Z Axis and Long-Dashed Vectors
Defocused Z Axis and Normal (solid) Vectors
Defocused Z Axis and Dotted Line Vectors
Defocused Z Axis and Dot-Dashed Vectors
Defocused Z Axis and Short-Dashed Vectors
Defocused Z Axis and Long-Dashed Vectors
Write-Thru Mode and Normal (solid) Vectors
Write-Thru Mode and Dotted Line Vectors
Write-Thru Mode and Dot-Dashed Vectors
Write-Thru Mode and Short-Dashed Vectors
Write-Thru Mode and Long-Dashed Vectors
Point Plot Mode
Graph Mode
Incremental Plot Mode
Alpha Mode
xterra Control Sequences 689
G
Standard Bitmaps
This appendix shows the bitmaps included with the standard distribution of
the X Window System. These can be used for setting window background,
cursor symbols, pixmaps, and possibly for application icon pixmaps.
escherknot
-.
mense tmanus
woman
Figure G-1. The Standard Bitmaps (continued)
Standard Bitmaps 695
H
Translation Table Syntax
This appendix describes the basic syntax of translation table resources,
described in Chapter 9, Setting Resources.
In This Chapter:
Event Types and Modifiers ................................................................... 697
Detail Field ...................................................................................... 699
Modifiers .......................................................................................... 700
Complex Translation Examples ........................................................ 700
Table H-2. Key Modifiers
Event Modifiers
Ctrl
Meta
Shift
Lock
Any
None
Modl
Abbreviation
C
m
$
Detail Field
To provide finer control over the translation process, the event part of the translation can
include an additional "detail." For example, if you want the event to require an additional
keystroke, for instance, an A key, or a Ctrl-T, then that keystroke can be specified as a trans-
lation detail. The default detail field is ANY.
The valid translation details are event-dependent. For example, to specify the above example
for keypress events, you would use:
<Key>A
and:
Ctrl<Key>T
respectively.
Key fields can be specified by the keysym value, as well as by the keysym symbolic name.
For example, the keysym value of the Delete key is 0xffff. Keysym values can be deter-
mined by examining the file <X11/keysymdef.h> or by using the xmodmap client. (See Chap-
ter 11, Setup Clients, for information about xmodmap.) Unfortunately, with some translations
the keysym value may actually be required, since not all keysym symbolic names may be
properly interpreted.
Translation Table Syntax 701
Glossary
X uses many common terms in unique ways. A good example is "children."
While most, if not all, of these terms are defined where they are first used in
this book, you will undoubtedly find it easier to refresh your memory by look-
ing for them here.
border
client
colorcell
colormap
console xterm window
default
depth
device-dependent
display
A window can have a border that is zero or more pixels wide. If a
window has a border, the border can have a solid color or a tile pat-
tern, and it will be repainted automatically by the server whenever
its color or pattern is changed or an v..xpose event occurs on the
window.
An X application program. There are client programs to perform a
variety of tasks, including terminal emulation and window manage-
ment. Clients need not run on the same system as the display server
program.
An entry in a colormap is known as a colorcell. An entry contains
three values specifying red, green, and blue intensities. These val-
ues are always 16-bit unsigned numbers, with zero being minimum
intensity. The values are truncated or scaled by the server to match
the display hardware. See also colormap.
A colormap consists of a set of colorcells. A pixel value indexes
into the colormap to produce intensities of red, green, and blue to be
displayed. Depending on hardware limitations, one or more color-
maps may be installed at one time, such that windows associated
with those maps display with true colors. Regardless of the number
of installable colormaps, any number of virtual colormaps can be
created. When needed, a virtual colormap can be installed and the
existing installed colormap may have to be uninstalled. The color-
map on most systems is a limited resource that should be conserved
by allocating read-only colorcells whenever possible, and selecting
RGB values from the predefined color database. Read-only cells
may be shared between clients. See also RGB.
This xterm window is the first window to appear on your display.
Exiting the console window kills the X server program and any
associated applications. Also called the login xterm window.
A function-dependent value assigned when you do not specify a
value. For example, specifying the -:v option with xterm reverses
the foreground and background colors for the xterm window. If you
do not specify this option, the default foreground and background
colors are used.
The depth of a window or pixmap is the number of bits per pixel.
Aspects of a system that vary depending on the hardware. For
example, the number of colors available on the screen (or whether
color is available at all) is a device-dependent feature of X.
A set of one or more screens driven by a single X server. The DIS-
PLAY environment variable tells programs which servers to connect
to, unless it is overridden by the -d-i :3play command line option.
The default is always screen 0 of (display) server 0 on the local
node.
708 X Window System User's Guide
highlighter
hot spot
icon
input device
keyboard focus
menu
modifier keys
mouse
occluding
padding
parameter
pixel
pointer
X clients accept a special hexadecimal notation (prefixed by a #
character) in all command line options relating to color. See Chap-
ter 8, Command Line Options, for more information.
The horizontal band of color that moves with the pointer within a
menu.
The reference point of a pointer that corresponds to its specified
position on the display. In the case of an arrow, an appropriate hot
spot is its tip. In the case of a cross, an appropriate hot spot might
be its center.
A small symbol that represents a window but uses little space on the
display. Converting windows to icons allows you to keep your dis-
play uncluttered.
Hardware device that allows you to input information to the system.
For a window-based system, a keyboard and pointer are the most
common input devices.
See focus window.
A list of commands or functions, listed in a small window, which
can be selected with the pointer.
Keys on the keyboard such as Control, Alt, and Shift. X programs
recognize a set of "logical" modifier key functions that can be
mapped to physical keys. The most frequently used of these logical
keys is called the "meta" key.
An input device that, when moved across a flat surface, moves the
pointer symbol correspondingly across the display. The mouse
usually has buttons that can be pressed to send signals that in turn
accomplish certain functions. The mouse is one type of pointer
device; the representation of the mouse on the screen is also called
the pointer. (See pointer.)
In a windowing system, windows may be stacked on top of each
other much like a deck of cards. The window that overlays another
window is said to occlude that window. A window need not com-
pletely conceal another window to be occluding it.
Space inserted to maintain alignment within the borders of windows
and menus.
A value required before a client can perform a function. Also called
an argument.
The smallest element of a display surface that can be addressed.
A generic name for an input device thaL when moved across a flat
surface, moves the pointer symbol correspondingly across the dis-
710 X Window System User's Guide
property
reverse video
RGB
root window
screen
scrollbar
select
selection
play. A pointer usually has buttons that can be pressed to send sig-
nals that in turn accomplish certain functions. A mouse is one type
of pointer device.
The pointer also refers to the symbol on your display that tracks
pointer movement on your desk. Pointers allow you to make selec-
tions in menus, size and position windows and icons, and select the
window where you want to focus input. A pointer can be repre-
sented by a variety of symbols. (See text cursor.) Some typical X
pointer symbols are the I-beam and the skull and crossbones.
Windows have associated properties, each consisting of a name, a
type, a data format, and some data. The X protocol places no inter-
pretation on properties; they are intended as a general-purpose data
storage and intercommunication mechanism for clients. There is,
however, a list of predefined properties and property types so that
clients can share information such as resize hints, program names,
and icon formats with a window manager. In order to avoid passing
arbitrary length property-name strings, each property name is asso-
ciated with a corresponding integer value known as an atom.
Reversing the default foreground and background colors.
An additive method for defining color in which tenths of percent-
ages of the primaries red, green, and blue are combined to form
other colors.
A shaded area (also called the background window) that covers the
entire screen and upon which other windows are displayed.
A server may provide several independent screens, which may or
may not have physically independent monitors. For instance, it is
sometimes possible to treat a color monitor as if it were two screens,
one color and one black and white.
A bar on the side of an xterm window that allows you to use the
pointer to scroll up and down through the text saved in the window.
The number of lines saved is usually greater than the number of
lines displayed and can be controlled by the savel,5_nes resource
variable.
A process in which you move the pointer to the desired menu item
or window and click or hold down a pointer button in order to per-
form some action.
Selections are a means of communication between clients using pro-
perties and events. From the user's perspective, a selection is an
item of data that can be highlighted in one instance of an application
and pasted into another instance of the same or a different applica-
tion. The client that highlights the data is the owner, and the client
into which the data is pasted is the requestor. Properties are used to
store the selection data and the type of the data, while events are
Glossary 711
server
text cursor
tile
window
window manager
used to synchronize the transaction and to allow the requestor to
indicate the type of data it prefers and to allow the owner to convert
the data to the indicated type if possible.
The combination of graphics display, hardware, and X server soft-
ware that provides display services for clients. The server also
handles keyboard and pointer input.
The standard underscore or block cursor that appears on the com-
mand line or in a text editor running an xterm window. To make the
distinction clearer, the cursor that tracks the movement of a mouse
or other pointing device is referred to as the pointer. The pointer
may be associated with any number of cursor shapes, and may
change shape as it moves from window to window.
A pattern that is replicated (as if laying a tile) to form the back-
ground of a window or other area. This term is also used to refer to
a style of window manager or application that places windows side
by side instead of allowing them to overlap.
A region on your display created by a client. For example, the
xterm terminal emulator, the xcalc calculator, and the bitmap graph-
ics editor all create windows. You can manipulate windows on your
display using a window manager.
A client that allows you to move, resize, circulate, and iconify win-
dows on your display.
712 X Window System User's Guide
A
acceleration
cursor 14
pointer 222
access control
/etc/Xn.hosts fde 547
user-based 548
xdm 548
XDMCP 548
xhost 547
action field (twm window man-
ager) 208
active window 592
aliasing font names 93 - 95
arrays
converting to bitmaps 109, 119
atobm (array to bimaap converter)
109 - 120
authentication widget 535, 538,
544
auto-repeat option (xset) 109, 221
average width (fonts) 87
B
background
colors 225
-background option (-bg) 169
background window see also root
window 6
-bd option 169
BDF (Bitmap Display Format) for
fonts 549
bdftosnf (font compiler) 549
bell volume (xse0 203,219
Index
-bg option 169
binding
button/key (.twmrc t'de) 206
keys 45
tight vs. loose (resources) 184
bitmap (creating graphics) 14, 109
-118
command boxes 112
description of 109
invoking 109, 112
window 110
Bitmap Display Format (BDF) for
fonts 549
-bitmap option (xsetroot) 224, 225
bitmaps
converting to arrays 109, 119
creating from cursor 119
editing 111
standard 693
bmtoa (bitmap to array converter)
109 - 120
Boolean variables 205
border color option (-bd) 169
border width option 168
Bourne shell script 528
bug compatibility mode 220
button
bindings 206
codes 237
command 151,188, 596
logical 228
-bw option 168
dex 713
C
C shell script 528
calculator (xcalc) 14 see also
xcalc
description 132
function of keys 133
terminating 133
character set 88
character-cell fonts 82
class
definition 184
resource names 184
click-to-type focus
see explicit focus 592
client
command line options 164
customizing 15, 45. 181
def'mifion 12
desk accessories 129
display manager 14
display options 164
location of default values 182
placing 45
removing 141
standalone 14
user-contributed 150
window manager 13
clipboard 72, 191 see also xclip-
CLIPBOARD selection 65,
191 - 192 see also
xclipboard
clock 130 see also oclock
Close (Window Menu) 606
color
changing color name database
550
determining number available
174
displaying 174
for screen elements 169
hexadecimal specification 172
menus 212
problems allocating 551
RGB model 173
specifying root window
(xsemaot) 225
colorcell
definition 174
read-only 175
read/write 175,223
shared 175
colormap 146, 223
description 174
command boxes (bitmap)
112 - 118
command buttons
Maximize 596
Minimize 596
command button widget 151
command line options (client)
163 - 177, 181
-f (font) 104
-background 169
-bd (border color) 169
-bg (background) 169
-border color 169
-borderwidth 168
-bw (border width) 168
-display 164
-f (font) 176
-foreground 169
-geometry 166
-iconic 176
list of standard 163
-name 194
-reverse 177
-rifle 165
-xrm (set resources) 194
commands
binap editing 111
executing system 211
for terminating xterm window
54
Main Options menu 53
menu 212
pointer 112
Tek Options menu 59
text editing widget 156
VT Options menu 56
console messages 550
context field (twm window man-
ager) 207
Conmal key 156, 189, 207
conventions of book v
copying selections in xterm win-
dows 61,152
and xcutsel 66
create font databases 92 see also
mkfontdir
cursor font 633
customizing
clients 15, 181
keyboard 227
mwm 610 - 629
714 X Window System User's Guide
pointer 227
twm 46, 203
xdm 536 - 544
cut buffer strings 61
vs. selections 65
database resource 196
DEC VT102 14
-defoption (xsetroot) 224
defaults
setting application 182, 187
deiconifying windows 36, 597
Delete key 157
Delete (I'wm menu) 43
deleting windows 43
desk accessories 14, 129 - 139
dialog box widget 151
directories
font 90
display
depth of 174
server 11
setting 219
DISPLAY environment variable
165, 528
display fonts 80, 97 - 98 see also
xfd
display manager 14 see also xdm
-display option 164
display window information 144
see also xwininfo
dump file see window dump file
E
-edit option (xrdb) 197
enlarging windows 597, 606
environment variables
DISPLAY 148, 165, 528, 609
TERMCAP 74, 526
XENVIRONMENT 199
error log file (xdm) 539
/etc/ttys (starting X from) 545
event translations 188, 189, 538
syntax 697
events
defmition 188
input 188
Exit (I'wm menu) 44
exiting
window manager 44
xmag 123
xman program 138
xterrn window 25
explicit focus 592
F
feedback boxes 623
-fg option 169
files
.twmrc 35, 45, 46
.Xdefaults 52
.Xresources 45, 51, 52
log 550
resource 181
.twmrc 15, 203
.uwmrc 557
.xinitrc 182, 527
Xreset 536, 542, 544
.Xresources 182
Xresources 536, 542, 544
.xsession 182, 535
Xsession 538
xfd (font displayer) 97 - 105
xset (set display preferences)
219 - 223
xterm (terminal emulator) menus
Main Options 50, 52
xwd (window dump) 140 - 141
Focus (I'wm menu) 43
focus policies (mwm)
explicit 592
focus window 43
focusing
definition 8
font displayer see also xfd 15
font path option (xset) 221
fonts see also Release 2 fonts and
Release 3 fonts
75-dpi vs 100-dpi 85 - 87
aliases for 93
average width 87
bdftosnf (font compiler) 549
Bimaap Display Format (BDF)
549
bold and demi-bold 84
character set 88
character-cell 82, 87
conventions of in book v
dex 715
keys
binding 207
Conn'ol 156, 189, 20?
Delete 157
mapping 230, 235
Meta 26, 156, 189, 207, 231
modifier 26, 227, 227 - 237
Shift 207
keys field (twm window manager)
207
keystrokes
missing 46
keysym
definition 229
determining 232
mapping 234
values 699
keyword variables 206
Kill (Twm menu) 43
killing
client window 141
oclock 143
server 141
windows 43
with Window Menu button 602
xterm window 25, 54
L
led option (xset) 221
list fonts 80 see also xlsfonts
list variables 206
list window tree 146 see also
xlswins
log fries 550
logging in 14, 20
logical
font convention 80
keyname 26, 230
pointer button 228
loose bindings 184, 186
Lower
Twm menu 42
Window Menu 606
lowering windows 42
M
magnifying screen 122 see also
xrnag
Main Options menu 50
commands 53
mode toggles 52
manipulating icons 607 - 608
using Window Menu 607
mapping
definition 188
event-action 190
Meta key 207
modifier keys 227, 230, 236
possibilities with xmodmap 234
translation table 189
Maximize
command button 597 - 598
Window Menu item 606
menus
color 212
creating new 203
defining in .twmrc file 209, 210
executing system commands
from 211
Preferences 209
Root Menu (mwm) 608 - 610
Tek Options 49.58
Tek'onix 49
Twm 35, 203
twm (window manager) 50
VT Fonts 57
VT Options 55, 59
Window Menu (mwm)
602 - 608
WindowOps 556
xterm (terminal emulator) 50
-merge option (xrdb) 196
Meta key 26, 156, 189 - 190, 231
definition 207
mapping 207
Minimize
command button 596 - 597
Window Menu item 605
mkfontdir (create font databases)
92, 549
-mod option (xsetroot) 225
mode toggles
Main Options menu 52
Tek Options menu 58
VT Options menu 56
Modes menu see VT Options
menu
modifier keys 26, 227
mapping 227 - 237
Index 717
monospaced fonts 82
Motif(window manager) see
mw3"n
mouse option (xset) 222
Move
Twin menu 39
Window Menu 604
moving
windows 594
on-screen objects 39, 45
mwm (window manager)
591 - 629
activating changes to 610
client-specific resources 624
component appearance resources
623
customizing 610 - 629
manipulating windows 594
overview 591
restarting 610
selecting windows 592
setting resources 622 - 623
specific resources 624
starting 592
omWlTII'C file
customizing mwm through 610
N
-name option 194
naming conventions
fonts 80
New Window command
Root Menu 609
New Window (WindowOps menu)
558
numeric variables 206
O
occluded
def'mition 40
oclock (analog clock) 27,
130 - 131,206, 213
killing 131,143
options see command line options
OSF/Motif (window manager)
591 - 629 see also mwm
pasting selections in xterm win-
dows 64, 152
and xcutsel 66
path
including X in 526
pipes and pointer interaction 141
point size 84
pointer
acceleration 222
bindings 206
buttons 237
commands 112
context of 207
customization 227
def'ming button functions 206
definition 7
mapping 236
possible cursor images 633
pointer button see button
pointer button field (twin window
manager) 206
postscript translation 15 see also
xpr
Preferences menu
example of 209
PRIMARY selection 61,152
printer fonts see fonts
printing utilities 140 - 141
proportional fonts 82
Q
Quit command (Main Options
menu) 54
Raise (Twm Menu) 41
raising windows 41, 42, 598
read-only colorcell 175,223
read/write colorcell 175,223
redrawing windows 55
Refresh command
Root Menu 610
refreshing the screen 550
Release 2 fonts
directory 104
vs. subsequent releases 104
718 X Window System User's Guide
Send STOP signal command
(Main Options menu) 54
Send TERM Signal command
(Main Oprions menu) 54
sel'vr
closing connection 141
control access (xdm) 548
control access (xhost) 547
defmirion 11
display 11
starting 19, 527
Server Natural Format (SNF) for
fonts 549
set width (fonts) 87
shell environment variables ee
environment variables
shell scripts
Bourne 528
C 528
startup 527
Shift key 207
showsnf (display compiled font)
549
Shuffle Down (Root Menu) 609
Shuffle Up (Root Menu) 609
Size (Window Menu) 605
SNF see Server Natural Format
549
-solid option (xsetroot) 225
spacing (fonts) 87
stacked windows
changing order of 40, 42
starting X 19 - 30
bringing up window manager 23
BSD 4.3 545
from/etc/ttys 545
placing clients 45
setting search path 526
setting terminal type 526
steps for 22
System V 545
xdm (display manager)
531 - 544
xinit (start X server) 22, 545
startup scripts 528, 538
subrnenu 210
system management 525 - 551
system.mwmrc file 612 - 619
Tek Oprions menu 50
commands 59
descriprion of items 58
mode toggles 58
Tektronix 4014 14
temporary xterm windows
running commands in 75
TERMCAP
environment variable 526
entry for xterm 74
terminal emulator 49 see also
Xterm
definirion 14
setting 526
xterm 73
terminating xterm window 25, 54,
176
text
copying and pasting 61, 64, 66,
72
string variables 205
switching buffer and selection
(xcutsel) 66
text editing widget 154, 156
thumb (scrollbar)
def'mirion 152
right bindings 184, 186
ride area of window 594
-rifle option 165
fiflebar 595
description 7
in twm window manager 23,
34 - 35
in xterm window 20
riflebutton binlings 206
Toolkit options see command line
options
toolkits
definition 182
translation table
definition 188
example of 190
mappings in 189
syntax 190, 697 - 701
Twm menu 35 - 45
Delete 43
Exit 44
Focus 43
Iconify 36
Kill 43
720 X Window System User's Guide
Window Menu
Close 606
displaying 602
Lower 606
manipulating icons with 607
Maximize 606
Minimize 605
Move 604
reasons for using 602
removing menu 604
Restore 607
selecting items 603
Size 605
Window Menu command button
602
WindowOps menu
New Window 558
windows
creating 22. 23, 558
definition 6
deiconiing 36, 597
displayed as icons 36
displaying information about
enlarging 597
exiting xterm 25
focus 43
geometry of 166
hierarchy of 146
icon box 626
iconifying 25, 36, 596
killing (Twm menu) 43
killing (Window Menu button)
602
killing (xkill) 141
lowering 42
manipulating 33, 555
manipulating (mwm) 594
maximizing 596
minimizing 596
moving 39, 594
raising 41, 42, 598
redrawing 55
resizing 38, 74, 558, 599
root 6, 224
selecting (mwm) 592
stacked 40, 42
starting as icon 176
switching focus between 25
Tektronix 49
terminating 54
title 165
title area 594
vertically tiled 153
width of 168
X
X Window System
description of 5
display server 11
overview of architecture 10
xbiff (mail notification) 133,212
xcalc (calculator) 14, 132- 133,
212, 528, 598
xclipboard (save text selections)
65, 68, 191
Release 3 72
xclock (analog or digital clock)
14, 130- 131,206
killing 130
xcutsel (exchange cut buffer and
selection) 65, 66
.Xdefaults file 52
vs. xrdb 192
.Xdefaults file see .Xresources
xdm (display manager) 14
access control features 548
authentication widget 535, 538,
544
configuration file 532
customizing 536 - 544
error log file 539
login window 20
standard session 535
starting X with 531 - 544
stopping xdm and the server 540
Xreset 539
Xresources file 538, 544
.xsession file 538
Xsession file 538
Xstartup 539
xdpr (window dump to printer)
141
xdpyinfo (list display information)
149
xedit (text editor) 71, 154, 207
XENVIRONMENT environment
variable 199
xev (track events) 232
xfd (font displayer) 15, 80, 95,
141
xfontsel (select fort0 80
722 X Window System User's Guide
xhost (control access to server)
547
xinit (start X server) 22, 527, 545
.xinitrc file 527
xkill (remove window) 141 - 144
xload (poll system load average)
28, 134
xlsclients (list running clients)
148 - 149
xlsfonts (list available fonts) 80
xlswins (list window tree)
146 - 148
xrnag (magnify screen portion)
122- 125
description of 122
quitting 123
as a viewport 154
xman (display manual pages) 135
Release 3 138
xmodmap (modifier key and
pointer customization)
227 - 237
change map 233 - 237
display key map 230
display pointer map 236
grammar option 234
xpr (postscript translation) 15,
140- 141
xrdb (resource database manager)
15, 192- 199, 527
-edit option 197
loading new values to 196
querying 196
removing definitions 197
saving definitions 197
setting resources with 195
syntax 195
using 195
xrefresh (refresh screen) 55,610
Xreset file 536, 542, 544
.Xresources file 15, 51, 52, 182,
536, 538, 542, 544
sample 193
.xresources file
customizing mwm through 610
-xrm option 194
.xsession file 535,538
Xsession file 538
xset (set display preferences) 14,
91,210
auto display option 221
auto-repeat option 109
font path option 221
mouse option 222
xsetroot (set root window charac-
teristics) 224 - 237
-bitmap option 224
-def option 224
xterm menus 49 - 59 see also
Main Options menu, Tek
Options menu, Vt Options
menu
Modes 50
Tek Options 49 - 50
Tektronix 49 - 50
VT Fonts 50
VT Options 50
xterm 50
xterm (terminal emulator)
and termcap 526
control sequences 681
creating window(s) 22, 558
default size 45
multiple xterms 23
overview 14, 49
pasting and copying selections
152
running command in temporary
window 75
scrollbar 59
Tektronix window 49
TERMCAP 74
terminal type 73
terminating 25, 54
xwd (window dump) 14
xwininfo (display window infor-
marion) 144- 146
xwud (window undumper) 140,
141
Index 723
If you want more information about our
books, or want to know where to buy them,
we're happy to send it.
3 Send me a free catalog of titles.
T_.I What bookstores in my area carry your
books (U.S. and Canada only)?
3 Where can I buy your books outside the
U.S. and Canada?
3 Send me information about consulting
services for documentation or
programming.
3 Send me information about bundling
books with my product.
Name
Address
City
State, ZIP
Country
Phone
Email Address.
I " I
If you want more information about our
books, or want to know where to buy them,
we're happy to send it.
J Send me a free catalog of titles.
What bookstores in my area carry your
books (U.S. and Canada only)?
Where can I buy your books outside the
U.S. and Canada?
7_..I Send me information about consulting
services for documentation or program-
ming.
J Send me information about bundling
books with my product.
Name
Address
City
State, ZIP
Country
Phone
Email Address
NAME
COMPANY
ADDRESS.
CITY
STATE ZIP
NO POSTAGE
NECESSARYIF
MAILEDINIHE
UNITED STATES
BUSINESS REPLY MAIL
FIRST CLASS MAIL PERMIT NO. 80 SEBASTOPOL CA
POSTAGE WILL BE PAID BY ADDRESSEE
O'Reilly & Associates, Inc.
632 Petaluma Avenue
Sebastopol, CA 95472-9902
NAME
COMPANY
ADDRESS
CITY
STATE ZIP
II
NO POSTAGE
NECESSARYIF
MAILEDIN THE
UNITED STATES
BUSINESS REPLY MAIL
FIRST CLASS MAIL PERMIT NO. 80 SEBASTOPOL CA
POSTAGE WILL BE PAID BY ADDRESSEE
O'Reilly & Associates, Inc.
632 Petaluma Avenue
Sebastopol, CA 95472-9902