AIX for PS/2 X Windows User's Guide

AIX X-Windows User's Guide - 3.0 Chapter 3.  Customizing X-Windows

3.1 CONTENTS
3.2 About This Chapter
3.3 Changing X-Windows Defaults
  3.3.1 Creating the Default File
  3.3.2 Specifying Global Defaults
  3.3.3 Specifying Defaults for A Command
3.4 Logging into AIX X-Windows Automatically
3.5 Modifying the Window Manager Tools Menu
3.6 Keyboard Mapping
3.7 Tuning System Parameters for X-Windows
  3.7.1 ptys
    3.7.1.1 Kernel pty Customization
    3.7.1.2 System pty Customization
  3.7.2 Processes
  3.7.3 X Server malloc Space
3.8 Using AIX X-Windows on a Remote System
  3.8.1 A Sample Remote X-Windows Session
    3.8.1.1 More Detailed Information

3.2 About This Chapter
    
   This chapter contains additional information about customizing X-Windows.
    
      Instructions for changing some defaults of X-Windows commands
      Instructions for logging in automatically to X-Windows
      Instructions for modifying the Tools menu
      A keyboard mapping chart
      Instructions for using X-Windows on a remote system
      Help with tuning the AIX Operating System for X-Windows.

3.3 Changing X-Windows Defaults
    
   You can set defaults such as the color, location, and size of windows by creating a file in your home directory.  This section shows you how to set up a file and includes some sample entries.  These sample entries are examples, not specifications.  In some instances, you may need to use multiple keywords to fully specify a default.

3.3.1 Creating the Default File
    
   To change X-Windows defaults, first create a file named .Xdefaults in your home directory.  Using this file, you can specify global defaults for X-Windows or defaults for one X-Windows command.
    
   A sample default file is in the /usr/lpp/X11/defaults directory.

3.3.2 Specifying Global Defaults
    
   Specify all global defaults before any specific command defaults.  The format is:
    
     keyword:value
    
   For example, to set the default window border to 2 pixels wide, put the following line in your .Xdefaults file:
    
     borderWidth:2

3.3.3 Specifying Defaults for A Command
    
   The format of a default specification for one command is:
    
     command.keyword:value
    
   For example, if you always want new aixterm windows to display in reverse video, put the following line in your .Xdefaults file:
    
     aixterm.reverseVideo:true
    
   Each time you start X-Windows, windows created by the aixterm command display in reverse video.
    
Note: Some commands have flags that set options which are also specified by using keywords.  When a command flag is used, it overrides default values set by keywords.

3.4 Logging into AIX X-Windows Automatically
    
   You can run the xinit command and start AIX X-Windows each time you log in to the system.
    
   Use the users command, and change the Program field to xinit -L.  The default login shell is /bin/sh.  For more information on adding users, see the IBM RT Managing the AIX Operating System.  For more information on the xinit command, see "xinit" in topic 2.11.
    
   The xinit command is a script shell file that you can modify to run other commands, like xclock.  Although you can modify the xinit command to change the default locations for the aixterm command and the aixwm command, you can change these default values with others by using the .Xdefaults file in your home directory.  For more information on using the Xdefaults file, see "Changing X-Windows Defaults" in topic 3.3.
    
   The terminal window started from xinit will show
    
     (Logoff window)
    
   after the title in the title bar of the window.
    
Note:  If you modify the xinit command, make sure that the exec /usr/lpp/X11/bin/aixterm is the last command issued.  Any other command might become the controlling terminal process.  Terminating the controlling terminal process will log you off X-Windows.

3.5 Modifying the Window Manager Tools Menu
    
   You can modify the menu that appears when you select Tools from the window manager menu.
    
   The values for the Tools menu are in the /usr/lpp/X11/defaults/Xtools.txt file.  Two examples are shown below:
 
1.  Copy the /usr/lpp/X11/defaults/Xtools.txt file into your HOME
    directory.  You can then modify this file without affecting other
    X-Windows users on your system.
    
2.  One of the lines in the /usr/lpp/X11/defaults/Xtools.txt file
    contains the following information:
    
    _   _   _   _xclock -geometry -0-0 -a &       _Analog Clock   _
    
    You can change any of the values in this line and modify the way the
    analog clock looks when you choose Analog Clock from the Tools menu.
    For example, if you change the -0-0 to +0-0, the analog clock starts
    in the lower left corner instead of the lower right corner.
    
3.  You can also add programs to the Tools menu.  For example, you can add
    an option to start a new X Server from the Tools menu by inserting the
    following line in the /usr/lpp/X11/defaults/Xtools.txt file:
    
    _   _   _    _xopen xinit    _X       _Run another X Server
    
    By adding this option to the Tools menu, you can start another X
    Server without leaving X-Windows.

3.6 Keyboard Mapping
    
   X-Windows allows each window to have its own keyboard mapping.
    
   The following keyboard source files are delivered with the X-Windows licensed program:
    
      keymap.gr -- Austrian/German
      keymap.be -- Belgian
      keymap.cf -- Canadian (French)
      keymap.de -- Danish
      keymap.uk -- English (UK)
      keymap.us -- English (US)
      keymap.sw -- Finnish/Swedish
      keymap.fr -- French (AZERTY)
      keymap.it -- Italian
      keymap.ja -- Japanese English
      keymap.no -- Norwegian
      keymap.po -- Portuguese
      keymap.sp -- Spanish
      keymap.sf -- Swiss (French)
      keymap.sg -- Swiss (German)
      keymap.vt -- VT102
    
   At installation time, the language menu allows you to select any or all of these languages.  The VT102 keyboard mapping is always installed.  These files are installed into the directory /usr/lpp/X11/defaults.  The first language selected during installation is the one that is compiled into binary form.
    
   The following examples show commands issued to perform a specific keyboard mapping task.  They all assume that:
    
      Default mapping is English (US)
      Appropriate source maps are installed
      Commands are issued from an X-Windows window.
    
   Example 1  --  Building a VT102 keyboard map on a PS/2
    
     cd /usr/lpp/X11/defaults
     mkdir vt
     mkdir -h vt/.Xkeymap
     keycomp < keymap.vt > vt/.Xkeymap@/i386
    
   Example 2  --  Running aixterm with VT102
    
     XDIR=/usr/lpp/X11/defaults/vt
     export XDIR
     aixterm -v
    
   Example 3  --  Building the French and Spanish maps 
                       (on an IBM 370 and on the PS/2 sharing the same file structure)
    
   On either one of the systems, enter the following commands:
    
     cd /usr/lpp/X11/defaults
     mkdir fr sp
     mkdir -h fr/.Xkeymap sp/.Xkeymap
    
   On the IBM 370 enter the following commands:
    
     cd /usr/lpp/X11/defaults
     keycomp < keymap.fr > fr/.Xkeymap@/i370
     keycomp < keymap.sp > sp/.Xkeymap@/i370
    
   On the PS/2 enter the following commands:
    
     cd /usr/lpp/X11/defaults
     keycomp < keymap.fr > fr/.Xkeymap@/i386
     keycomp < keymap.sp > sp/.Xkeymap@/i386
    
   Example 4  --  Running a French, Spanish, and English (US) X-Windows window
    
     XDIR=/usr/lpp/X11/defaults/fr
     export XDIR
     aixterm
     XDIR=/usr/lpp/X11/defaults/sp
     export XDIR
     aixterm
    
   Keyboard Description and Character Reference gives you the detailed  mappings of the keyboards for each national language.

3.7 Tuning System Parameters for X-Windows
    
   The X-Windows server makes extensive use of the AIX operating system and its resources.  You may be able to improve the performance of X-Windows by tuning system parameters.  This section applies only to the RT and provides information about tuning the following areas:
    
   ptys
   processes
   X Server malloc space.  For more information about malloc on the RT,
       see IBM RT Managing the AIX Operating System.

3.7.1 ptys
    
   Each window opened by the aixterm command uses one pty (asynchronous pseudo terminal).  You have two ways of defining the limits on the number of ptys:
    
      The number of ptys that can be configured into the kernel
      The number of pty device nodes in /dev.
    
   For additional information about ptys, see AIX Operating System Technical  Reference.

3.7.1.1 Kernel pty Customization
    
   By default, the kernel is configured for 16 possible ptys.  You can change this number and rebuild the kernel to adjust the number of ptys.  The maximum number of ptys is 256 (the maximum number of minor devices per major device).  Use the following steps to change the number of possible ptys:
    
   1.  Edit the /etc/master file.
   2.  Modify the ptybuffers attribute in the sysparms stanza.    
   3.  Modify the maxminor attribute in the uptc and upts stanzas.  
   4.  Edit the /etc/ddi/pty file.
   5.  Add an entry for each additional pty.
    
      The additional pty entries should be entered after the dpty15 entry. Each pty entry should consist of two lines:
    
   The first line should contain dptyN, where N is the number of the pty, for example, dpty16.
   The second line should be left blank.
    
   6.  Re-build and install the kernel.
    
   Each pty uses some kernel memory.  Other system parameters should be tuned to reflect any additional ptys.  Each pty implies at least two processes in use:  one (the master) for the controller and one for the slave.
    
   As you increase the number of ptys, you should also increase the number of charlists.  Each charlist (or cblock) has space for 64 characters.  Try to have a minimum of three or four charlists for each pty to be in use at the same time.  For ptys that are heavily used, increasing the number of charlists may improve performance.
    
   Note:  It is possible to run out of charlists and hang the system.
    
   If an X Server is hidden by another virtual terminal, there may be processes (such as aixterm) writing to that server.  If the sockets to the server fill up, the ptys may fill up on the slave-to-master path and use all the charlists.  To resolve this, hot-key to the X Server, allowing its display to appear, thus freeing charlists.
    
   To avoid running out of charlists, provide enough charlists so that aixterm slave processes can block on output without using up all the free charlists.  This means you should provide approximately five additional charlists (about 300 characters) for each pty.
    
   Charlists are defined by the charlists attribute in the sysparms stanza of the /etc/master file.

3.7.1.2 System pty Customization
    
   Each device is declared in a stanza of /etc/system.  Use the devices command to add devices to the system.  The devices command adds devices to the configuration files and makes a special device node in /dev.  Many programs other than X-Windows use ptys.  Most of the other programs require the use of a getty that supports login.  You may have more ptys in the kernel than you have defined by devices.  Ordinarily, you should not use devices to create more than 64 ptys.

3.7.2 Processes
    
   The maximum number of processes is defined by the procs attribute in the sysparms stanza of the /etc/master file.  Increase this parameter if you are using X-Windows intensively.
    
   To change the number of processes:
    
   1.  Edit the /etc/master file.
   2.  Change the procs attribute in the sysparms stanza.
   3.  Rebuild and install the kernel.
    
   Once you increase the number of processes to about 100, you need to increase some additional parameters.  These parameters are:
    
   charlists    number of clists for tty subsystem
   filetab      number of files the system can have open at once
   inodetab     number of inodes the system can have open at once.
    
   The filetab and inodetab should be the same.

3.7.3 X Server malloc Space
    
   The X Server does a malloc to get space for the various objects it creates and manipulates.  If the ulimit size is too low, the server may run out of space.
    
   Use the sh ulimit command to increase the ulimit size.  (This option is supported on the RT only.)  For more information, see AIX Operating System Commands Reference.

3.8 Using AIX X-Windows on a Remote System
    
   You use X-Windows client programs on a remote computer system in the same way you use it on your own system.  However, you must be able to access and log in to the remote system.  For more information, see "RT Installation Requirements for Remote Usage" in topic A.4.  For MBCS information see the MBCS Handbook.
    
   Starting X-Windows client programs on the remote system after logging in to that system allows you to work with programs and files stored on both your system and the remote system at the same time and through different windows.  Logging in to a remote system enables you, for example, to display, side-by-side through different windows, a file stored on your own system and another file stored on the remote system.  You can also edit a file or run a program on one system through one window while you run another program on another system through another window.
    
   In summary, X-Windows allows you to have immediate access to both your own computer system and to the processing power, programs, and files stored on a remote system.

3.8.1 A Sample Remote X-Windows Session
    
   This section explains the steps for using AIX X-Windows on a remote system.  Steps are listed in the box.  The detailed explanations that follow the box contain examples of what you can enter on your system to perform each step.
    
+--- Steps in Remote AIX X-Windows Usage -------------------------------+
¦                                                                       ¦
¦ 1.  Start an AIX Shell window on your display.                        ¦
¦                                                                       ¦
¦ 2.  Enable a particular remote system to use your display.            ¦
¦                                                                       ¦
¦ 3.  Log in to the remote system and start an X-Windows client program ¦
¦     on the remote system to display on your local screen.             ¦
¦                                                                       ¦
¦ 4.  Work just as you work on your own system.                         ¦
¦                                                                       ¦
¦ 5.  End the client program.                                           ¦
¦                                                                       ¦
+-----------------------------------------------------------------------+

3.8.1.1 More Detailed Information
    
   The examples in the following explanations assume that:
    
   Two RT systems or two PS/2 systems (*), or an RT system and a S/370
    system, or a PS/2 system* and a S/370 system are attached to one
    another through a communications link.
    
   The program TCP/IP manages the communications between the two systems
    and is installed and running correctly on both machines.
    
   AIX X-Windows is installed on both machines.
    
   The host name of your system (the local system) is norma.
    
   The host name of the system attached remotely to your system (the
    remote system) is jackie.
    
   You are logged in to and working at norma.
    
   You know how to log in to a remote computer system.
    
   You want to edit a file stored on system jackie using system norma.
    
   There is a single X Server running on system norma.
    
   To use aixwm and aixterm to edit a file on a remote system, perform the following steps:
    
1.  Start aixwm.
    
2.  To start an AIX Shell client program on your display, first select
    Tools from the menu.  The Tools submenu appears on your display. Then
    select AIX Shell from the Tools submenu.  A window with the window
    name AIX Shell appears on your display.
    
    Note:  In this example, the host name of your system is norma.  This
           is the first X Server you have opened on norma.  Therefore, the
           full default name of the X Server in which the AIX Shell window
           is running is norma:0.  norma is the host name and 0 is the
           display (server) number.
    
3.  To enable the remote system jackie to use your display, you enter the
    X-Windows xhost command.  First you move the mouse cursor into the AIX
    Shell window.  Then you enable the remote system jackie for X-Windows
    by entering:
    
         xhost + jackie
    
    The execution of xhost enables the specified remote system only until
    you terminate X-Windows.  However, you can eliminate the need to run
    xhost to enable a remote system by enabling the system by default in a
    file called /etc/X?.hosts (? is the display number).
    
    For example, the display norma:0 can be accessed by systems defined in
    the file /etc/X0.hosts on the system with a host name of norma.  In
    both the display name and the file name, 0 indicates the number of the
    display that the remote system is allowed to access using X-Windows.
    
    There must be a separate /etc/Xn.hosts file on the local system, which
    contains one host name per line, for each display that a remote system
    will access through X-Windows.
    
    For more info about the xhost command, see "xhost" in topic 2.10.
    
4.  Log in to the remote system from the AIX Shell window on your system
    and open an X-Windows client program that runs on the remote system
    but displays on your system.
    
    For instance, if TCP/IP is the communications program managing the
    data link between your system norma and the remote system jackie, you
    can enter the following rexec command to log in to jackie and open a
    window that runs on jackie and appears on your display (attached to
    norma):
    
         rexec jackie aixterm -display norma:0 -n JACKIE
    
       The parts of the TCP/IP rexec command define the following:
    +-----------------------------------------------------------------------+
¦ rexec          ¦ The TCP/IP command that sends a specified command to ¦
¦                ¦ run on a specified remote system.  rexec initiates a ¦
¦                ¦ login process on the remote system that must         ¦
¦                ¦ complete successfully before the command is          ¦
¦                ¦ executed.                                            ¦ +----------------+------------------------------------------------------¦
¦ jackie         ¦ The name of the remote system on which the command   ¦
¦                ¦ is to be run.                                        ¦
+----------------+------------------------------------------------------¦
¦ aixterm        ¦ The X-Windows command that is to be run on the       ¦
¦                ¦ remote system.  In this case, aixterm opens a new    ¦
¦                ¦ X-Windows client program on jackie.                  ¦
+----------------+------------------------------------------------------¦
¦ -display       ¦ A parameter of the aixterm command that indicates    ¦
¦ norma:0        ¦ the full name of the display where the new window is ¦
¦                ¦ to appear.  In this case, the new window running on  ¦
¦                ¦ jackie appears on your display, which is physically  ¦
¦                ¦ attached to norma.  The host name norma and the      ¦
¦                ¦ display number 0 must be separated by a : (colon).   ¦
+----------------+------------------------------------------------------¦
¦ -n JACKIE      ¦ A flag of the aixterm command that indicates the     ¦
¦                ¦ window name to be used for the new window.           ¦
+----------------+------------------------------------------------------+
    
    For more information on the rexec command, see the Interface Program
    for use with TCP/IP publication.  For more information about the 
    aixterm command, see "aixterm" in topic 2.5.
    
    The aixterm command causes a rubber-band window to appear on your 
    display (norma:0) after you complete the login initiated by the rexec
    command.  You can press and hold down a mouse button to move the
    rubber-band window.  When you release the mouse button, the window
    border becomes a solid line and the window name JACKIE appears at the
    top of the new window.
    
    Note:  Although the work you perform in the new X-Windows client
           program is primarily processed by the remote system jackie,
           your current host name is not changed.  Your current host name
           is still norma (the name of your system) and the JACKIE window
           is the second window that you open from that current host.
           Therefore, the full default name of the display that the remote
           window JACKIE uses is norma:0.
    
5.  At this point, for example, you can start an editor and edit a file
    stored on the remote system jackie through the remote window named
    JACKIE.
    
    In general, through a window running on a remote system, you can run
    programs and access files that your login user ID on jackie has
    permission to run and access.  For example, you can use the programs
    and files stored on the remote machine jackie through the remote
    X-Windows client program JACKIE.  At the same time, through another
    window, you can use any program and file stored on your local system
    norma that your local user ID has permission to use.
    
6.  When you complete your work on the remote system jackie, you enter
    Ctrl-D to shut the remote window JACKIE.  This action also logs you
    off of the remote system.
        
    Note:  TCP/IP may not be required to run remote client programs.  For
           example, a system administrator might write a program to put
           up messages in an X-Windows window.  The system administrator
           can open such a message window on a remote system if the 
           following conditions are met:
    
             The remote system name is known.
             The remote system allows access.
    
    (*) PS/2 systems or PS/55 model 5570.

Content created and/or collected by:
Louis F. Ohland, Peter H. Wendt, David L. Beem, William R. Walsh, Tatsuo Sunagawa, Tomáš Slavotínek, Jim Shorney, Tim N. Clarke, Kevin Bowling, and many others.

Ardent Tool of Capitalism is maintained by Tomáš Slavotínek.
Last update: 16 Mar 2024 - Changelog | About | Legal & Contact