MGR(1)

NAME
mgr - Bellcore window manager

SYNOPSIS
mgr [ -ffont_dir ] [ -iicon_dir ] [ -sstartup_file ] [ -c ] [ -n ] [ -x ] [ -v ] [ -Fdefault_font ] [ -dlist ] [ -M mouse_type ] [ -m mouse_device ] [ -Bwindow_buff ] [ -bshell_buff ] [ -Ppoll_interval ] [ -Sscreen ] [ -ppattern ]

DESCRIPTION
MGR is a graphics window manager. It permits the creation and manipulation of overlapping windows, with different processes running in each window. The user controls the function and layout of the display with a mouse. Windows are updated asynchronously even if they are partially (or completely) obscured by other windows, although obscured windows may arrange to have their output suspended until the window is uncovered.

Each window runs a terminal emulator which, in addition to the functions normally required to run screen oriented programs, such as vi(1), provides primitives for drawing lines, doing bit-blts, and performing administrative functions such as reshaping the window, changing fonts, or starting a new window. Details of the terminal emulator operation are described in the MGR - C Language Application Interface.

  Startup file format
Upon invocation MGR reads commands from the "startup file", $HOME/.mgrc (see -s flag above) to initialize the display. Commands are placed one per line with the command arguments separated by spaces or tabs. The following commands are supported:

initcmd command [ args... ]
    This command line is handed to the shell and executed at the time the startup file is read.

suspendcmd command [ args... ]
    This command line is handed to the shell and executed each time MGR suspends it self, either due to a main menu selection or the Left-z key.

resumecmd command [ args... ]
    This command line is handed to the shell and executed each time MGR resumes after a suspension.

quitcmd command [ args... ]
    This command line is handed to the shell and executed just before MGR quits, either due to a main menu selection or the Left-Q key.

colors n0 n1 n2 n3
    This changes the colors used in the system menu and the screen background. The foreground and background colors in the system (left mouse button) menu are n0 and n1 while the screen background pattern combines colors n2 and n3.

slide dx dy
    This changes the screen offset of a child menu from a parent menu from the default of 40, 10 pixels.

page dx dy
    This changes the screen offset between the parts of paged menus from the default of 5, -5 pixels.

map n0 n1 n2 n3 n4 n5 n6 n7
    This changes the meaning of the mouse buttons. Each n[0-7] represents one of the 8 states of the three mouse buttons. The default mapping is: 0 1 2 3 4 5 6 7. To change the meaning of the left and right buttons, 0 4 2 6 1 5 3 7 would be used(L=1,M=2,R=4). It is possible to map a button out of existence, which may have grave consequences.

font font_number font_name
    The default font may be overridden by specifying the font font name which is to be substituted for the font at position font_number. Font numbers are small integers, in the range of 0-99. The font_names are found in the font directory, by default /usr/mgr/font. See the -f flag above.

window x y wide high [ font_number ]
    A window is created whose corner is at the coordinates (x, y) and whose size is (wide, high). Units are in pixels, with x and y increasing to the right and down respectively. Wide and high can be set in terms of characters in the current font by appending the letter "c" to the value. If x and y are -1, then they are replaced by values that causes new windows to "tile" across the screen. Setting wide and high to -1 is identical to setting them to "80c" and "24c" respectively. The scope of the window command continues until either another window command or done is reached. The rest of the options, shell, start, init, flags, and newwindow apply only to the current window command.

    shell command [ args... ]
        Command is the name of the command or shell to be started in the window. If command is not specified, then the environment variable $SHELL, or /bin/csh is used.

    active
        This window will be active.

    windowsetid i0
        Specifies the setid of the window must be i0.

    start command
        The command is sent to the shell upon startup, as if it had been typed at the keyboard.

    init initial_string
        The initial string is sent to the window upon startup. The string is terminated by white space, the remainder of the line may be used as a comment. The codes: \\, \b, \f \e, \n, \r, \Mx or \s may be used to represent \, backspace formfeed, escape, newline, return, x|0200, or space respectively.

    flags flag...
        Normally a window self destructs when the original process running in it dies. if nokill is specified, the window hangs around until specifically snuffed by the user. The background flag sets a condition which is presently a default anyway, that this window when non-active will be updated continuously, without waiting for it to be raised. The expose flag requests that this window be exposed, or moved in front of the other windows, as soon as it has something to output.

    newwindow
        The current window specification is not to be used to initialize the display, but instead will be used when Left n or Right n to create a new window.

done
    done must be the last line in the startup file if any window commands are specified, or the last window command will not take affect.

  Using the mouse
User interaction with MGR is with the mouse. Moving the mouse causes a corresponding movement of the mouse cursor, usually an arrow pointing to the upper left. The left or command button of mouse activates a menu whose options depend upon the current mouse position. An option is chosen by moving the mouse vertically while the command button is depressed, releasing the button when the appropriate selection is highlighted.

When the mouse is over the background pattern, or at the extreme left edge of the screen, the command menu is activated by the mouse. The command menu options are:

new window
    A new window is created by moving the the mouse cursor (now a box) to the upper left corner of the window, depressing the command button, sweeping out the window, then releasing the command button. The new window, if it is big enough, is started with a shell running in it.

redraw
    The background and windows are redrawn. This is useful if a process unknown to MGR scribbles on the display. It is left to the processing running in a window to fix the contents of its window.

quit
    MGR is terminated, after the quit is confirmed. Alternately, MGR may be suspended (ala ^Z in csh ).

When the mouse is over the active window, the fat bordered window the keyboard is connected to, the window menu is activated by depressing the command button. The window menu options are:

reshape
    Reshape reshapes the active window, using a procedure similar to new window above.

stretch
    Stretch allows the user to change the shape of the active window by dragging any corner of the window to a new location, leaving the opposite corner fixed. Different server configurations offer either Stretch or Reshape on this menu, but not both.

move
    An outline of the current window is moved along with the mouse until the command button is depressed and released. The current window is then moved to the new location.

bury
    The current window is made inactive. Another window (if any) becomes the active window.

cut The mouse may be used to sweep out and save text from the current window into a global buffer. A small scissors appears as the mouse cursor. Position the upper left corner of the scissors with the upper left corner of the first character to be saved, then push one of the mouse buttons, moving the mouse to sweep out the desired text. Releasing the button causes the outlined text to be saved. Using the command button with cut causes the current contents of the global buffer (if any) to be replaced by the indicated text. Either of the other two buttons causes the indicated text to be appended to the global buffer.

    The cut facility currently works only for windows containing a single font, aligned on the default character boundaries. Applications which use only the terminal emulator sub-set of MGR capabilities, such as the shell, mail, and editors automatically meet this restriction. Cuttability may be restored by issuing a clear (i.e. form feed) to the window. The window flashes and beeps if the cut operation could not be completed, usually the result of corrupted data in the window. In such cases, no text is saved. See MGR - C Language Application Interface for a detailed description of the various cut option settings.

paste
    The contents of the global buffer (if any) are inserted into the input stream of the current window. The global buffer is filled using cut above, or under program control.

destroy
    All processes associated with the current window are sent a hangup signal, and the window is destroyed.

When the mouse is clicked on any window except the active window, that window moves to the front and becomes the active window.

  Using hotkeys
When MGR is invoked from the console keyboard, many of the system menu functions have keyboard equivalents. Some of the more interesting ones are activated by typing a character with the 8th bit set (Left and Right on Sun workstations):

space bar
    to activate the previous window

Back Space
    to activate the bottom window

c   to initiate a cut-text operation

p   to initiate a paste operation

h   hide the top window on the bottom

l   to clear the active window

m   initiate a cut-text operation which will automatically cause a paste operation when completed

n   to start a new window, 80 x 24 characters (if it will fit), placed in the "tile" position of its window-set ID

N   start a new window by sweeping with the mouse

Q   to exit MGR quickly

1-9 to activate the window with window-set ID 1 through 9

0   activates the window with window-set ID 10, a synonym for w10<Return>

wnumber<Return>
    activate the window with window-set ID number

r   to redraw the windows

R   to redraw the windows

z   to suspend MGR

There are other characters that cause MGR to display debugging information which may disrupt the screen; they are i, I, M, +, -, #, and ?. Use "redraw", either from the command menu on the mouse or "right r" to restore the screen display.

The environment variable DEFAULT_FONT may be assigned the full path name of a MGR font, which will then replace MGR's built in default font.

OPTIONS

-ffont_dir
    Use font_dir as the directory to find the fonts, instead of /usr/mgr/font.

-iicon_dir
    Use icon_dir as the directory to find the icons, instead of /usr/mgr/icon.

-sstartup_file
    Use startup file instead of $HOME/.mgrc to obtain initial configuration information. See the description of startup commands below.

-c  At startup, don't initialize a default colormap.

-x  Don't use a startup file upon execution.

-v  Don't run MGR at all. Print the current version number and creation date instead.

-Fdefault_font
    Use default_font as the pathname of a MGR font to be used in place of MGR's builtin default font.

-dlist
    Print debugging information on stderr. list is one or more of the characters: *ABCFLMNPSUbcdefilmnoptuwy each of which turns on debugging output for some aspect of MGR.

-Mmouse_type
    Use a mouse interface protocol appropriate for talking to a mouse_type mouse, instead of the default Microsoft mouse protocol. The permissible arguments for mouse_type are microsoft, mousesystems3, mousesystems5, mmseries, logitech, ps2, and busmouse. The default protocol can easily be changed at configure/compile time.

-mmouse_device
    Use mouse_device instead of /dev/mouse to obtain mouse coordinates.

-Sscreen
    Use screen instead of /dev/fb as the display device.

-Bwin_buff
    Process characters to a window in up to win_buff byte chunks (the default is 40).

-bshell_buff
    Buffer up to shell_buff bytes of output from a program before writing it on a window (the default is 256).

-Ppoll_interval
    When output is pending in a window, wait poll_interval micro-seconds on every polling loop to give more process time to the processes running in the windows. The default is zero.

-ppattern
    Use the bitmap pattern as background instead of the default pattern.

FILES

/dev/mouse
    place to obtain mouse coordinates.

/dev/fb
    name of the display.

/usr/mgr/icon
    place to find MGR icons.

/usr/mgr/font
    place to find MGR fonts.

$HOME/.mgrc
    place to find startup commands.

/dev/bell
    For ringing the bell.

/dev/[pt]ty[pq]?
    Name of the pseudo-tty's.

SEE ALSO
MGR - C Language Application Interface
many clients in chapter 1, bitmap(5) font(5)

BUGS

*   A separate application program, set_console(1L) is required to prevent others from scribbling on /dev/console and messing up the display.

A separate application program,
    set_colormap(1L) is required to change the colormap on a color display.

*   As MGR requires exclusive control of the mouse, it may not be invoked from within itself.

*   Only fixed-width fonts are supported.

AUTHOR
Stephen A. Uhler, changes by lots of people