[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
System User's Guide: Operating System and Devices

AIXwindows Startup Files Overview

When working in a graphical window environment, there are also certain initialization files the system uses.

Because different computer systems have different ways of starting the X server and AIXwindows, you should consult with your system administrator to learn how to get started. Usually, the X server and AIXwindows are started from a shell script that runs automatically when you log in. You may, however, find that you need to start the X server or AIXwindows or both.

If you log in and find that your display is functioning as a single terminal, with no windows displayed, you can start X by entering:

xinit

If this command does not start X, check with your system administrator to ensure that the X11 directory containing executable programs is in your search path. The appropriate path may differ from one system to another.

If you log in and find one or more windows without frames, you can start AIXwindows Window Manager by entering:

mwm &
Note: Before entering this command, make sure that the pointer rests within a window that has a system prompt.

Because AIXwindows permits plenty of customization both by programmers writing AIXwindows applications and by users, you may find that mouse buttons or other functions do not operate as you might expect from reading this documentation. You can reset your AIXwindows environment to the default behavior by pressing and holding the following four keys:

Alt-Ctrl-Shift-!

You can return to the customized behavior by pressing this key sequence again. If your system does not permit this combination of keystrokes, you can also restore default behavior from the default root menu.

This section discusses the following initialization files:

.xinitrc File

The xinit command uses a customizable shell script file that lists the X client programs to start. The .xinitrc file in your home directory controls the windows and applications that start up when you start AIXwindows.

The xinit command first looks for the $XINITRC environment variable to start AIXwindows. If the $XINITRC environment variable is not found, it looks for the $HOME/.xinitrc shell script. If the $HOME/.xinitrc shell script is not found, the xinit command starts the /usr/lib/X11/$LANG/xinitrc shell script. If /usr/lib/X11/$LANG/xinitrc is not found, it looks for the /usr/lpp/X11/defaults /$LANG/xinitrc shell script. If that script is not found, it searches for the /usr/lpp/X11/defaults/xinitrc shell script.

The xinitrc shell script starts commands, such as the mwm (AIXwindows Window Manager), aixterm, and xclock commands.

The xinit command performs the following operations:

The following example shows the part of the xinitrc file you can customize:

# This script is invoked by /usr/lpp/X11/bin/xinit
  
.
.
.
#***************************************************************
#  Start the X clients. Change the following lines to         *
#  whatever command(s) you desire!                          *
#  The default clients are an analog clock (xclock), an lft  *
#  terminal emulator (aixterm), the X Desktop Manager (xdt),    *
#  and the Motif Window Manager (mwm).                       *
#****************************************************************
# If not X-Station then invoke the DPS copyright 
if [ -z "$XSTATION" ]
then
  /usr/lpp/DPS/bin/copyright -x &
fi
aixterm =80x25+0-0 -fg Wheat -bg MidnightBlue &
if [ -z "$XSTATION" ]
then
  sleep 3      # allow for DPS copyright to show up
fi
if [ -x /usr/lpp/X11/bin/xdt3 ]
then 
  /usr/lpp/X11/bin/xdt3 &
fi
exec mwm

.Xdefaults File

If you work in an AIXwindows interface, you can customize this interface with the .Xdefaults file. AIXwindows allows you to specify your preferences for visual characteristics, such as colors and fonts.

Many aspects of a windows-based application's appearance and behavior are controlled by sets of variables called resources. The visual or behavioral aspect of a resource is determined by its assigned value. There are several different types of values for resources. For example, resources that control color can be assigned predefined values such as DarkSlateBlue or Black. Resources that specify dimensions are assigned numeric values. Some resources take Boolean values (True or False).

If you do not have a .Xdefaults file in your home directory, you can create one with any text editor. Once you have this file in your home directory, you can set resource values in it as you wish. A sample default file called Xdefaults.tmpl is in the /usr/lpp/X11/defaults directory.

The following example shows part of a typical .Xdefaults file:

*AutoRaise: on
*DeIconifyWarp: on
*warp:on
*TitleFont:andysans12
*scrollBar: true
*font: Rom10.500
Mwm*menu*foreground: black
Mwm*menu*background: CornflowerBlue
Mwm*menu*RootMenu*foreground: black
Mwm*menu*RootMenu*background: CornflowerBlue
Mwm*icon*foreground: grey25
Mwm*icon*background: LightGray
Mwm*foreground: black
Mwm*background: LightSkyBlue
Mwm*bottomShadowColor: Blue1
Mwm*topShadowColor: CornflowerBlue
Mwm*activeForeground: white
Mwm*activeBackground: Blue1
Mwm*activeBottomShadowColor: black
Mwm*activeTopShadowColor: LightSkyBlue
Mwm*border: black
Mwm*highlight:white
aixterm.foreground: green
aixterm.background: black
aixterm.fullcursor: true
aixterm.ScrollKey: on
aixterm.autoRaise: true
aixterm.autoRaiseDelay: 2
aixterm.boldFont:Rom10.500
aixterm.geometry: 80x25
aixterm.iconFont: Rom8.500
aixterm.iconStartup: false
aixterm.jumpScroll: true
aixterm.reverseWrap: true
aixterm.saveLines: 500
aixterm.scrollInput: true
aixterm.scrollKey: false
aixterm.title: AIX

.mwmrc File

Most of the features that you want to customize can be set with resources in your .Xdefaults file. However, key bindings, mouse button bindings, and menu definitions for your window manager are specified in the supplementary .mwmrc file, which is referenced by resources in the .Xdefaults file.

If you do not have a .mwmrc file in your home directory, you can copy it as follows:

cp /usr/lib/X11/system.mwmrc .mwmrc

Because the .mwmrc file overrides the systemwide effects of the system.mwmrc file, your specifications do not interfere with the specifications of other users.

The following example shows part of the typical system.mwmrc file:

#  DEFAULT mwm RESOURCE DESCRIPTION FILE (system.mwmrc)
#
# menu pane descriptions
#
# Root Menu Description
Menu RootMenu
{ "Root Menu"        f.title
  no-label           f.separator
  "New Window"       f.exec "aixterm &"
  "Shuffle Up"       f.circle_up
  "Shuffle Down"     f.circle_down
  "Refresh"          f.refresh
  no-label           f.separator
  "Restart"          f.restart
  "Quit"             f.quit_mwm
}
# Default Window Menu Description
 
Menu DefaultWindowMenu MwmWindowMenu
{ "Restore"   _R   Alt<Key>F5              f.normalize
  "Move"      _M   Alt<Key>F7              f.move
  "Size"      _S   Alt<Key>F8              f.resize
  "Minimize"  _n   Alt<Key>F9              f.minimize
  "Maximize"  _x   Alt<Key>F10             f.maximize
  "Lower"     _L   Alt<Key>F3              f.lower
  no-label                                 f.separator
  "Close"     _C   Alt<Key>F4              f.kill
}
# no acclerator window menu
Menu NoAccWindowMenu
{
  "Restore"   _R     f.normalize
  "Move"      _M     f.move
  "Size"      _S     f.resize
  "Minimize"  _n     f.minimize
  "Maximize"  _x     f.maximize
  "Lower"     _L     f.lower
  no-label           f.separator
  "Close"     _C     f.kill
}
Keys DefaultKeyBindings
{
  Shift<Key>Escape             icon|window        f.post_wmenu
  Meta<Key>space               icon|window        f.post_wmenu
  Meta<Key>Tab                 root|icon|window   f.next_key
  Meta Shift<Key>Tab           root|icon|window   f.prev_key
  Meta<Key>Escape              root|icon|window   f.next_key
  Meta Shift<Key>Escape        root|icon|window   f.prev_key
  Meta Ctrl Shift<Key>exclam   root|icon|window   f.set_behavior
}
#
# button binding descriptions
#
Buttons DefaultButtonBindings
{
  <Btn1Down>         frame|icon             f.raise
  <Btn3Down>         frame|icon             f.post_wmenu
  <Btn1Down>         root                   f.menu  RootMenu
  <Btn3Down>         root                   f.menu  RootMenu
  Meta<Btn1Down>     icon|window            f.lower
  Meta<Btn2Down>     window|icon            f.resize
  Meta<Btn3Down>     window                 f.move
}
Buttons PointerButtonBindings
{
  <Btn1Down>        frame|icon             f.raise
  <Btn2Down>        frame|icon             f.post_wmenu
  <Btn3Down>        frame|icon             f.lower
  <Btn1Down>        root                   f.menu  RootMenu
  Meta<Btn2Down>    window|icon            f.resize
  Meta<Btn3Down>    window|icon            f.move
}
#
#  END OF mwm RESOURCE DESCRIPTION FILE
#

Related Information

Commands Overview

Processes Overview

File Systems Overview

Directory Overview

Files Overview

File and System Security

User Environment and System Information

Customization Procedures

Customizing the InfoExplorer ASCII Program

Shells Overview

Korn Shell or POSIX Shell

Bourne Shell

C Shell


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]