XNEWS(1) — USER COMMANDS
NAME
xnews — window system server
SYNOPSIS
xnews [ POSTSCRIPT-code ]
DESCRIPTION
The xnews command starts the X11/NeWS window system server. The server supports both the X11 protocol and the NeWS protocol. Clients connect to the server by opening the socket appropriate to the protocol they use. The X11 protocol is described in the X Window System Protocol, Version 11, from MIT. The C language binding to the X11 protocol is described in Xlib - C Language X Interface, Version 11, also from MIT.
The NeWS protocol is a superset of the POSTSCRIPT page description language, described in the POSTSCRIPT Language Reference Manual by Adobe Systems, Inc. NeWS extensions to the POSTSCRIPT language are described in The NeWS Programmer’s Guide, from Sun. The C client interface is also described there.
OPTIONS
[ POSTSCRIPT-code ]
The server interprets the POSTSCRIPT language code given as an argument on the command line. If no code is specified on the command line, xnews executes the following: (NeWS/init.ps) (r) file cvx exec &main This code fragment sets up the X11/NeWS server for its normal use. When specifying this argument, putting single quotes around the POSTSCRIPT-code will protect it from premature interpretation by the shell.
ENVIRONMENT VARIABLES
The X11/NeWS server recognizes the following environment variables:
FRAMEBUFFER
If unset, the default is /dev/fb. When the server starts up, it opens the display device named by FRAMEBUFFER .
OPENWINHOME
Should be set to the directory in which the servers’ directory hierarchy is installed. It is used to initialize the root menu to point to the correct copies of the programs it invokes and to determine which directories are searched for POSTSCRIPT initialization files, fonts, and other libraries and programs.
XNEWSHOME
Overrides OPENWINHOME for the server if it is installed in a non-standard place. Ordinarily it should be unset. In this case, the server will set it automatically from OPENWINHOME .
XVIEWHOME
Overrides OPENWINHOME for XView applications if they are installed in a nonstandard place. Ordinarily it should be unset. In this case, the server will set it automatically from OPENWINHOME .
FONTPATH
A list of directories, separated by semicolons, telling the server where to look for fonts. If unset, it defaults to $OPENWINHOME/lib/fonts.
LD_LIBRARY_PATH
This variable is used by the shared library linker to determine which directories to examine for shared libraries. It should normally be set to $OPENWINHOME/lib:/usr/lib.
NEWSSOCKET
When starting the server, if NEWSSOCKET is set, the server will listen on the socket named by NEWSSOCKET for NeWS clients. If NEWSSOCKET is unset, the server will first try to open the restricted socket number 144. If that fails, it will try 2000. If that fails, it will keep incrementing the socket number by 1 until it finds one on which it succeeds.
The socket on which the server listens for NeWS clients may also be set in your ~/.startup.ps file with a line of the following form: /NeWS_socket (%socketl2001) def The NeWS_socket POSTSCRIPT language variable overrides the NEWSSOCKET environment variable.
NEWSSERVER
Before starting a NeWS application, you can set this environment variable to tell the application which server to connect to. If unset, the application will default to the local server, socket 144. If socket 144 fails, it will try socket 2000. (For information on how to set this environment variable, see the manual page for newsserverstr.)
DISPLAY
Before starting an X11 application, you can set this environment variable to tell the application which server to connect to. If unset, you must specify the server on the application’s commandline with the -display option. It is of the following form: hostname:display.screen Here, hostname may be the name of a host, unix, or localhost. The display argument is normally 0. The .screen argument is optional.
NOSXSEL
If set, the server does not start up sv_xv_sel_svc, which is used for cut and paste between SunView and XView programs.
X11ONLY
Reduces memory consumption if no NeWS clients will be run. Causes the server to initialize without starting the POSTSCRIPT window manager, pswm, or loading the NeWS toolkit, which pswm depends on. Additionally, the NeWS connection listener is not started. The documentation for the features that X11ONLY turns off does not necessarily describe the effects of X11ONLY.
NEWSONLY
Reduces memory consumption if no X11 clients will be run. Causes the server to initialize without constructing data structures required by the X11 interpreter or making X11 specific NeWS operators available. It also avoids starting the POSTSCRIPT window manager, pswm, although it still loads the NeWS toolkit, and avoids starting the X11 connection listener. Additionally, it omits X11 programs from the rootmenu. The documentation for the features that NEWSONLY turns off does not necessarily describe the effects of NEWSONLY.
NOPSWM
Causes the server to initialize without starting the POSTSCRIPT window manager, pswm. Unlike X11ONLY, the objective is not to save memory consumption but rather to make it easier to run a different X11 window manager.
USAGE
Getting Started
To start the X11/NeWS server, check where the server’s directory hierarchy is installed. The recommended place is /home/openwin. Assuming it is installed on /home/openwin, set up your environment in the following way:
setenv OPENWINHOME /home/openwin
setenv LD_LIBRARY_PATH "$OPENWINHOME/lib:/usr/lib"
In your .login or .cshrc file, add $OPENWINHOME/bin and $OPENWINHOME/bin/xview to your PATH ahead of /usr/bin. If you have been running NeWS, you may have already set the FONTPATH variable. If so, unset it as follows: unsetenv FONTPATH If you have been running NeWS 1.1, you may have already set the FRAMEBUFFER variable. If so, unset it as follows: unsetenv FRAMEBUFFER
Multiple Framebuffers
If you have two monitors, or if you have a cg4 that you prefer to use as two framebuffers, you may wish either to run the X11/NeWS server on both or to run the server on one and SunView on the other.
To run SunView on one monitor and the X11/NeWS server on the other, first start sunview with the -d option. From SunView, set FRAMEBUFFER to the name of the other framebuffer. Then enter the following: unsetenv WINDOW_PARENT To start the X11/NeWS server, you can enter the following: xnews &; sleep 12; adjacentscreens <sunview-dev> -r $FRAMEBUFFER The sunview-dev argument is the name of the /dev device file that you started SunView on.
Alternately, you can add the following line to your ~/.startup.ps file: (adjacentscreens <sunview-dev> -r $FRAMEBUFFER) runprogram When you have added the line, you can start the server simply by typing xnews &.
You can then move the mouse back and forth between the two monitors, with SunView on the left and X11/NeWS on the right. See adjacentscreens for changing the configuration. If you want to start SunView applications from the terminal emulator in which you unset the WINDOW_PARENT environment variable, you must reset it to /dev/win0.
To run the X11/NeWS server on both monitors, you must start up two copies of the server, one for each framebuffer: this is necessary because support for two framebuffers from one server is not available yet. The following shell script takes two arguments (the framebuffer on the left and the framebuffer on the right), starts two copies of the server, and allows the mouse to move between them.
#! /bin/sh
export FRAMEBUFFER; FRAMEBUFFER=$1; xnews &
sleep 30
export FRAMEBUFFER; FRAMEBUFFER=$2; xnews &
sleep 12
adjacentscreens $1 -r $2
Alternately, if you always start the first server on dev1 and the second server on dev2, add the following to your .startup.ps file:
(FRAMEBUFFER) () ?getenv
(dev2) eq {
(adjacentscreens dev1 -r dev2) runprogram
} if
To treat a cg4 as two framebuffers, become superuser and
enter the following:
cd /dev
MAKEDEV /dev/bwtwo0
ln -s fb cgfour0_clr
When the X11/NeWS server is started on /dev/fb on a cg4, it displays in the color plane group and displays the cursor in the monochrome plane. If you switch either to another X11/NeWS server or to SunView running in the monochrome plane using adjacentscreens, the cursor leaves a little blotch in the other display. To avoid the little blotch, use cgfour0_clr instead of fb.
So, to run SunView in monochrome and X11/NeWS in color, start sunview -d /dev/bwtwo0, and start X11/NeWS with FRAMEBUFFER set to /dev/cgfour0_clr. To run SunView in color and X11/NeWS in monochrome, start SunView on /dev/fb, and start the X11/NeWS server with FRAMEBUFFER set to /dev/bwtwo0. To run two copes of the X11/NeWS server, use the above script with the arguments /dev/bwtwo0 and /dev/cgfour0_clr.
After Startup
Immediately after starting the server, the console is set to be the workstation screen. This means that messages to the console will disrupt the entire window system display. To avoid disruption, a console window should be started as soon as possible after system initialization.
A console window is available from the root pop-up menu, in the Utilities pull-right menu.
Root Menu
The Root Menu user interface follows the OPEN LOOK Graphical User Interface specification.
To pop up the root menu, position the cursor anywhere in the root background and press the Menu button on the mouse. By default, the Menu button is the right button. If you click the button (that is, release it immediately after pressing it), the menu will stay up. You can make selections in the menu by clicking the Menu button over the items in the menu, or you may dismiss the menu by clicking the Menu button in the root background.
Menu items with an arrow on the right denote pull-right menus. Clicking the Menu button in these will pop up another level of menu.
You can also use mouse-drag to operate menus. If you press the Menu button down and hold it down, the menu will appear. As you move the mouse through the menu, the highlight will track the mouse. If you move the mouse to the right side of a pull-right item, the next level of menu will appear. To select a menu item in this mode, simply let go of the Menu button while the cursor is over your selection. To dismiss the menu, let go of the Menu button while the cursor is not over the menu.
Window Management
The window management user interface follows the OPEN LOOK Graphical User Interface specification.
When you start an application, it may prompt you with a crosshair cursor to drag out a rectangle the size of the new window. When it appears, its window comes up surrounded by a window frame. In the corners of the window frame are symbols called resize corners. The Select button, which by default is the left mouse button, may be used to drag a resize corner to the desired size. The symbol in the upper left hand corner may be clicked with the Select button to close the window, by default.
Pressing the Menu button anywhere in the window frame pops up the window menu. The window menu is operated the same way as the root menu.
FILES
If xnews is unable to open a file whose name does not start with /, and which cannot be found the directory you started from or in your home directory, it inserts $XNEWSHOME/lib at the front of the name and tries again.
$XNEWSHOME/etc/NeWS/∗.ps
Startup POSTSCRIPT language code.
$XNEWSHOME/lib/fonts/∗
Font library.
$XNEWSHOME/bin/xnews
The server.
$XNEWSHOME/lib/openwin-init
Shell script for initializing window client applications at server start-up.
$XNEWSHOME/lib/openwin-menu
Template for default root menu. See buidmenu.
~/openwin-init
User override of $XNEWSHOME/lib/openwin-init
~/openwin-menu
User override of $XNEWSHOME/lib/openwin-menu
~/.user.ps
User-definable server customizations, loaded after other system ∗.ps files
~/.startup.ps
User-definable server customizations, loaded before other system ∗.ps files.
SEE ALSO
psh(1), psterm(1), psview(1), say(1), journalling(1), kbd_mode(1), newshost(1), newsserverstr(1), psman(1), hyperview(1), buildmenu
NeWS Programmer’s Guide
POSTSCRIPT Language Reference Manual, Adobe Systems Inc., Addison-Wesley
X Window System Protocol, Version 11, MIT
Xlib - C Language X Interface, Version 11, MIT
BUGS
Some parts of the POSTSCRIPT language have yet to be implemented. See the appendix in the NeWS Programmer’s Guide entitled Omissions and Implementation Limits.
The server is not yet completely robust when it runs out of memory. This out-of-memory condition occurs because swap space has been used up. Swap space is a resource that is shared by all the processes running on your machine.
When running SunView 1 programs, you may see Window display lock broken... messages.
If you do not have a console window, messages to the console disrupt the entire window system display.
Anyone who can gain access (legitmately or otherwise) to the system on which the server is running, or to any system allowed to access the server, has, through either the X11 or the NeWS protocol, unrestricted access to the resources of the server. They can monitor the keyboard and the mouse, read information from the screen, and interfere with the operation of other clients.
TRADEMARK
POSTSCRIPT is a registered trademark of Adobe Systems Inc.
Sun Release 4.1 — Last change: 16 June 1989