This manual describes features of the X-windows environ- ment on SGI and Aspect Station I. Functions of the SGI toolchest are described as well as several ways to set up your personal X-environment. For a full description of X- windows we refer to the books and WWW pages written on this subject.

This manual is available in: - PDF format -> unix-xwindows.pdf - FRAMEVIEWER format -> unix-xwindows.doc

The latest update can be found on the Bruker FTP servers:

on ftp.bruker.de in the directories: /pub/nmr/courses+manuals/pdf /pub/nmr/courses+manuals/doc

on ftp.bruker.com in the directories: /pub/nmr/mirror.bruker.de/courses+manuals/pdf /pub/nmr/mirror.bruker.de/courses+manuals/doc

The README file describes its installation and usage.

It is also delivered as XWIN-NMR online help:

click Help -> Other topics -> Unix-Xwindows

Please send your comments to:

[email protected] Index

X-windows on SGI 1

Functions of the Toolchest 2

Customize your X-environment

- configuration files 5

- function keys in X-windows 8

- how to change the font of a UNIX shell 10

- how to start applications by mouse click 12

X-windows on Aspect Station 14

Appendix A: the command Editres 17 1 X-windows on SGI

After successful login on an SGI workstation you have at least one on your screen, the so called Toolchest. The Toolchest offers you the possibility to start applications by mouse click. One of these applications is a UNIX shell or UNIX window. In a UNIX shell you can enter UNIX commands like pwd, ls, cd etc. or you can start other applications.

Operating system: IRIX

Default : 4Dwm

User specific resources files: .xsession .Xresources .sgisession .4Dwmrc .auxchestrc UNIX shells: - xterm - winterm

Useful X commands: xlsfonts, xdpyinfo, xfontsel, xman, xhost, xterm, winterm, xwininfo, xprop, editres.

Manual Pages: - man X - man 4Dwm - man (see commands above) 2 Functions of the Toolchest

The Toolchest is a small window on the desktop of an SGI workstation.

The Toolchest: - automatically appears when you log in at a terminal which is directly connected to the workstation - offers you a list of system tools and applications - allows you to start tools and applications by mouse click - can be customized in your personal file .auxchestrc - can be started with the command toolchest when you are logged in over the network

The Toolchest usually contains the following buttons:

* Desktop - open a UNIX shell, log out, customize * Selected - handle files and directories graphically * Find - find tools and applications on the local host - find files, hosts, printers etc. network wide * System - start the system management tools for disks, printers, network, system software, users etc. - restart the window manager, restart the host * Help - the SGI online books and manual pages 3

examples

* Open a UNIX window (a UNIX shell) Desktop -> Unix Shell

* log out Desktop -> Log Out or type endsession [-f] in a UNIX shell

* Switch window auto placement on/off Desktop -> Customize -> Windows

* Enable remote display permanently IRIX >= 6.3 Desktop -> Customize -> Desktop -> Enable remote .. or enter xhost + in your .profile or .cshrc

* Change the UNIX default editor (SGI default is jot) Desktop -> Customize -> Desktop [-> Utilities] or type desktop in a UNIX shell

* Open a window with icons for several applications find -> applications

* General system information and setup System -> System Manager

* Install a new user System -> User Manager 1

1.For IRIX >= 6.3: System -> System Manager -> Security and Access Control -> User manager 4

* Install a new printer System -> Printer manager We recommend to install a printer with cfpp in XWIN-NMR (see XWIN-NMR manual) 1. * Install system software System -> Software Manager - can be used to install SGI software - cannot be used to install Bruker software

* Restart the 4Dwm window manager System [-> Utilities] -> Restart Window Manager

* Shutdown the computer System -> System Shutdown or type init 0 in a UNIX shell

* Reboot the computer System -> Restart System or type init 6 in a UNIX shell

* The online books; help on various SGI topics Help -> Online Books - you can search for keywords in all books - corresponds to the UNIX command insight

* A list of all UNIX commands and their manual pages. Help -> Man Pages - each manual pages corresponds to the output of the command man

1.Network printer installation is described in the XWIN-NMR online help; click help -> other topics. 5 Customize your X-environment configuration files

Each time you log in on an SGI, a series of files is executed: 1) the file /usr/lib/X11/xdm/Xsession is executed: this file executes the file /$HOME/.xsession 1, if it exists All further steps are performed by the file .xsession, if it exists, or else by its master file /usr/lib/X11/xdm/Xsession: 2) load the file /$HOME/.Xresources, if it exists 3) set the search path for X-resources 4) enable the hosts display access (xhost +) 5) start the window manager -> interpret the file: /$HOME/.4Dwmrc, if it exists, or else /usr/lib/X11/system.4Dwmrc 6) execute the file /$HOME/.sgisession, if it exists 7) start a toolchest window -> execute the file: /usr/lib/X11/system.chestrc and /$HOME/.auxchestrc, if it exists The files .xsession and .4Dwmrc replace their master files, the contents of .auxchestrc is added to system.chestrc.

The file .xsession - you can create a .xsession by copying the file Xsession: cp /usr/lib/X11/xdm/Xsession /$HOME/.xsession - edit this .xsession (e.g. vi) and make your changes, e.g.: * always remove the line xsession=$HOME/.xsession 2 * you can change the display access, e.g. xhost -host1 * you can start a different window manager, e.g. 1.HOME is a system environment variable which, by default, is set to your home directory 2.you can also remove the entire if-then-fi structure containing the command "exec $xsession" 6

The file .Xresources The file .Xresources can be used to set resources (names, fonts, positions, sizes, colours) of various applications.

Many applications have their own default resource file, which usually resides in a directory app-defaults, e.g.: /u/prog/app-defaults/XWinNmr /usr/lib/X11/app-defaults/XClock /usr/lib/X11/app-defaults/Toolchest You can change or extend these default resources in the file .Xresources in your home directory, e.g.: XWinNmr*background: green XClock*geometry: 200x200+50+50 Toolchest*fontList: 9x15bold for the applications xwinnmr, xclock and toolchest.

Entries in your .Xresources usually start with the name of the corresponding file in app-defaults. 1

To activate the change in your .Xresources you can: - log out and log in again or - type: xrdb -load .Xresources

Resources of UNIX applications can also be set with com- mand line arguments, e.g.: xclock -g 200x200+50+50 toolchest -fn 9x15bold A powerful tool to set up your .Xresources interactively is editres. An example of this is described in Appendix A. 1.This is usually the name of the application with the first letter capitalized. When the application starts with an "x", the first and second letter are capitalized. 7

The file .4Dwmrc This file is a resource file for the 4Dwm window manager. If it exists, it is used instead of /usr/lib/X11/system.4Dwmrc. The file .4Dwmrc can be used to add or change: - menus - key bindings - mouse button bindings Additional menus allow you to start your own application by mouse click from the background screen. This will be discussed on page 12 of this document.

The file .sgisession This file can be used to automatically start applications upon login. You can just enter the names of the applications as they would be entered in a UNIX shell, e.g.: insight & xclock & netscape The ’&’ starts the application in background. If you don’t do this, applications might wait for each other to finish. 1

The file .auxchestrc This file can be used to add functions to the Toolchest. The application toolchest will interpret the two files: /usr/lib/X11/system.chestrc and /usr/people//.auxchestrc This will be discussed on page 12 of this in document.

1.This only counts for applications that do not return the UNIX prompt after start up. 8 Function keys in X-windows

set function keys for an "xterm" UNIX shell - type cd to change to your home directory - edit (e.g. vi) the file .Xresources; enter your personal choice of function keys, e.g.: XTerm*VT100.Translations: #override \ ShiftF1: string("ftp ftp.bruker.de") \n\ CtrlF1: string("cd /pub/nmr/xwinnmr/patches") \n\ F1: string("cd /pub/nmr/courses+manuals") \n\ ShiftF2: string("netscape") \n\ CtrlF2: string("http://www.bruker.de") \n\ F2: string("http://www.bruker.com") \n\ To include a carriage return, add string(0x0a), e.g.: ShiftF1: string("ftp ftp.bruker.de") string(0x0a) \n\

- edit (e.g. vi) the file .auxchestrc; enter the following lines: Menu Desktop { "Xkey" f.exec "xterm" } - log out and log in again - click on Desktop -> Xkey, which will open a new xterm, in which you can use the function keys.

Each key can be used for three different commands by using the Shift and Control modifiers. Note that the order of the lines is important: Shift, Ctrl, . Type man xterm for more information on xterm. 9

set function keys for a "winterm" UNIX shell - type cd to change to your home directory - edit (e.g. vi) the file keymap - enter your personal key functions e.g.: F1(shift): send("lpstat -t") F1(control): send("ps -fulp") F1(): send("ps -ef | grep xwin") F2(shift): send("cd ‘curd -a‘") F2(control): send("/etc/init.d/bruker_lmgr stop") F2(): send("/etc/init.d/bruker_lmgr start") - edit (e.g. vi) the file .auxchestrc; enter the following line: Menu Desktop { "Winkey" f.exec "xwsh -name winterm -key keymap" } - log out and log in again - click on Desktop -> Winkey, which will open a new win- term in which you can use the function keys

Each key can be used for three different commands by using the Shift and Control modifiers. Note that the order of the lines is important: key(shift), key(control), key().

Type man winterm for more information on winterm. 10 How to change the font

change the font in an existing UNIX shell

- move the mouse into a UNIX shell - press the right mouse button - a small popup window will appear; click on Font - a font window showing the available fonts will appear: * click on Include proportional width fonts * Select Family, Style and Size of the font the selected font and the Font Name will be shown * click on Accept to install the font in the current shell

create a Toolchest entry for a UNIX shell with a user defined font - type cd to change to your home directory - select a font as described above but do not click Accept, move the mouse into the Font Name bar and click the left button three times to mark the font name - go back to a UNIX shell, edit (e.g vi) the file .auxchestrc and enter a line like: Menu Desktop { "Shell Font" f.exec "winterm -fn -*-helvetica-bold..." } after the option -fn you can enter the font which you marked before by clicking the middle mouse button - log out and log in again - click on Toolchest -> Desktop -> Shell Font 11

The file .auxchestrc can also be used to create Toolchest entries for other applications.

automatically open a UNIX shell upon login with a user defined font - type cd to change to your home directory - edit (e.g vi) the file .sgisession and enter lines like: winterm -fn -*-courier-bold-r-normal--24..... winterm -fn screen-bold13 -iconic - log out and log in again two UNIX shells will be started on login with the indicated fonts, the second shell will appear as an icon

The font selection, as it was described above, allows you to choose three font attributes; Family, Style and Size. You can also use the command xfontsel, which allows you to choose all font attributes separately: - type xfontsel - select the font attributes - click on select - move the mouse into the file where you want to enter the font, e.g. .sgisession, .auxchestrc - click the middle mouse button to enter the fontname

The command xlsfonts shows the list of available fonts. 12 Start applications with the mouse

Frequently used applications, or UNIX commands which are not part of the Toolchest, can be added to the X-windows menu. You can then start them by mouse click.

Start your applications from the Toolchest - type cd to change to your home directory - edit (e.g vi) the file .auxchestrc and make an entry like: Menu Desktop { "Netscape" f.exec "netscape" "Viewer" f.exec "/usr/local/FrameViewer/bin/iviewer" } - log out and log in again - click on Desktop -> Netscape

If you are logged in on a host over the network, you do not have a Toolchest window of this host. Type toolchest& in a UNIX shell to get a Toolchest.

Start your applications by clicking anywhere on the background screen - type cd to change to your home directory - type ls .4Dwmrc - if the file .4Dwmrc does not exist: type cp /usr/lib/X11/system.4Dwmrc .4Dwmrc - type chmod 644 .4Dwmrc - edit (e.g vi) the file .4Dwmrc: 13

* search for the entry Menu Selected dynamic * in this menu, add lines like: "Netscape"f.exec "netscape" "Viewer" f.exec "/usr/local/FrameViewer/bin/iviewer" - click on System -> Restart Window Manager - click the right mouse button anywhere on the background screen, outside any UNIX or application window - a selection window will pop up; click Netscape

The Screen menu can only be used if you are logged in locally, at the console terminal, but not over the network.

Both menus, Toolchest and Screen, allow you to create sub- menus, e.g. a list of remote hosts: - make an entry in .auxchestrc (Menu Desktop) or in .4Dwmrc (Menu Selected dynamic) like: "Remote hosts" f.menu RemoteHosts - make a new entry like: Menu RemoteHosts { "host1" f.exec "winterm -t host1 -n host1 -e rlogin host1" "host2" f.exec "winterm -t host2 -n host2 -e rlogin host2" } These entries allow you to log in on the remote hosts host1 and host2 by mouse click. Note that the file /etc/hosts.equiv or .rhosts must be set up correctly on the remote hosts.

The options -t and -n in this example set the title of the window and its icon. 14 X-windows on Aspect Station I

On Aspect Station workstations all programs (applications and UNIX commands) are started from a UNIX shell. One or more UNIX shells are automatically opened on login. You can customize you personal environment to start programs by mouse click on the background screen.

Operating system: RISC/os

Default window manager: mwm

X-windows resource files: .xsession .xresources .mwmrc Manual pages: man X

UNIX shell: xterm

Useful X commands: xlsfonts, xdpyinfo, xfontsel, xman, xhost, xterm, xwininfo, xprop.

Manual Pages: - man X - man mwm - man (see commands above) 15

start your own applications by clicking anywhere on the background screen - type cd to change to your home directory - type ls .mwmrc - if the file .mwmrc does not exist: type cp /usr/lib/X11/mwm/system.mwmrc .mwmrc - type chmod 644 .mwmrc - edit (e.g vi) the file .mwmrc: * search for the entry DefaultRootMenu * in this menu, add lines like: "Xwinnmr"f.exec "xwinnmr" "Shmrm" f.exec "shmrm" - log out and log in again to activate the change - click the right mouse button on the desktop, outside any UNIX or application window - a selection window will pop up; click xwinnmr

The Screen menu can be used if you are logged in on a ter- minal which is directly connected to the workstation.

Screen menus allow you to create submenus, e.g. a list of remote hosts: - make an entry in .mwmrc (in DefaultRootMenu) like: "Remote hosts" f.menu RemoteHosts - make a new entry like: Menu RemoteHosts { "host1" f.exec "xterm -ti host1 -na host1 -e rlogin host1" "host2" f.exec "xterm -ti host2 -na host2 -e rlogin host2" } 16

These entries allow you to log in on the remote hosts host1 and host2 by mouse click. Note that the file /etc/hosts.equiv or .rhosts must be set up correctly on the remote hosts. The options -ti and -na in this example set the titles of the window and its icon.

set the font of a UNIX shell - type cd to change to your home directory - select a font with xfontsel or xlsfonts - edit (e.g vi) the file .xresources and enter a line like: XTerm*font 9x15bold No tabs or blanks are allowed at the end of this line!

set function keys for a "xterm" UNIX shell - type cd to change to your home directory - edit (e.g vi) the file .xresources and enter a line like: XTerm*VT100.Translations: #override \ ShiftF1: string("ftp ftp.bruker.de") \n\ CtrlF1: string("cd /pub/nmr/xwinnmr/patches") \n\ F1: string("cd /pub/nmr/courses+manuals") To include a carriage return, add string(0x0a), e.g.: ShiftF1: string("ftp ftp.bruker.de") string(0x0a) \n\ 17 Appendix A set up resources with editres

The command editres can be used to: - set resources for a program or parts of an program - immediately view the result of the changes - store the resources in the file .Xresources

Example: set the colour of the xwinnmr command line - start xwinnmr - type editres in a UNIX window * click Commands -> Get Widget Tree, then click anywhere in the xwinnmr window * click Tree -> Select Widget in Client, then click on the command line in the xwinnmr window * click Commands -> Show Resource Box - click on background - enter a colour in the field "Enter Resource Value" - complete the resource specification: click XmForm 1 - click Apply and view the result - click Set Save File and enter .Xresources - click Save to store the resource in the file .Xresources - click Popdown Resource Box to exit the Resourcebox

Note that for xwinnmr, the initial resource specification in the resourcebox is incomplete like .a..c.d. A complete resource specification looks like .a.b.c.d or .a*c.d. Xwinnmr resources can be set for the command line, the status line, the menu bar, the buttons and the menu. 2 1.The resources line is the upper line in the ResourceBox 2.You can set different resources (e.g. colours) for every menu like File, Acquire, Process etc.