• Keine Ergebnisse gefunden

Adding Clients to a Window Manager’s Root Menu

root menu

Menu displayed by placing the pointer on the root window and clicking a mouse button.

You can customize a window manager’s root menus so that users can start clients by selecting a menu item.

Configuring a Window Manager’s Menus

The host-basedncdrunwmlauncher utility starts either the localNCD Window Manager or the local Motif Window Manager. The launcher reads its configuration file and sends the information to the local window manager. When the local window manager starts, it displays the user’s root menus as specified in the launcher’s configuration file.

Tip

The local NCD window managers’

default root menus list many of the NCD local clients and a selection for quitting the local window manager.

Mouse buttons not bound to a menu in the launcher configuration file display the default menu when the pointer is on the root window.

To customize root menus:

1. Set up a launcher configuration file on the host on which the launcher runs. (The following sections describe how to compose commands for starting clients in the launcher configuration file.)

2. Place a command to startncdrunwm in a session startup file, such asXsession or.xsession.

The following example runsncdrunwm on the boot host and starts the localNCD Window Manager on the display named in the environment variableDISPLAY. ncdrunwm -d $DISPLAY

If thencdrunwm program quits, the local window manager also quits unless you includencdrunwm’s-k option. With the -k option, the local window manager rkeeps running but the customized root menus no longer function.

To restartncdrunwm and regain the customized root menus, usencdrestartwm:

$ ncdrestartwm

You can also usencdrestartwmto restart the window manager after altering the launcher configuration file or window

Launcher Configuration Files

A launcher configuration file is anASCII file that follows the format conventions ofmwm’ssystem.mwmrc file.

ncdrunwm can read any of the following launcher

configuration files. It uses the first file it finds and searches for files in the following order:

1. A file specified usingncdrunwm’s -foption 2. A .launchrc file in the user’s home directory 3. A .mwmrc file in the user’s home directory

4. A systemwide launcher file,/usr/lib/X11/system.launchrc 5. A systemwidemwm file,/usr/lib/X11/system.mwmrc Sample systemwide menu configuration files (system.launchrc andsystem.mwmrc) are available from theNCD FTP site. Edit them to suit your environment or use them as guidelines for the syntax to use in launcher configuration files for individual users.

The syntax used for defining root menus in a launcher configuration file is:"label" [!]functionwhere:

Place an exclamation mark (!) beforefunctions that are composed of commands (such as a remote shell command).

When the function is anmwm f.* function name (such as f.menu orf.title), the exclamation mark is unnecessary.

Tip

Including unsupported functions in a launcher configuration file results in a warning message that the launcher is ignoring unknown keyword:

function.

Themwmfunctions supported byncdrunwmare:f.kill,f.lower, f.maximize,f.minimize,f.move, f.normalize,f.resize,f.exec, f.menu,f.nop,f.quit_mwm,f.restart,f.separator, andf.title. label Is the item label that appears in the root menu. function Is thef.* function or command executed when

the user selects the item.

Adding Local Clients to a Root Menu

Tip

Do not use remote shell commands to start window managers. Use the host-basedncdrunwm application launcher instead.

To start local clients, use remote shell commands (rshorremsh) asfunctions in launcher configuration entries. When you use remote shell commands to start local clients, a daemon in the terminal responds to the remote shell request and starts the local client.

Remote shell command syntax is:

rsh hostname command options where:

Tip

You can also use remote shell commands in startup files (such as XDM Xsession and .xsession files).

For example, the following command starts the Terminal Host Chooser on a terminal with the hostname ncdu10:

rsh ncdu10 term

When you include a remote shell command in a launcher configuration file as afunction, enclose the entire command and its options in single or double quotes.

The following entries in a launcher configuration file create a root menu item for starting anNCD Terminal Emulator via TELNET:

"Local Telnet" ! "rsh $NCDNAME term -ctype telnet &"

Entries inmwm launcher configuration files for starting local clients include themwm function name, for example:

"Local Telnet" f.exec "rsh $NCDNAME term -ctype telnet &"

Adding Host-Based Clients to a Root Menu

xterm (1)

A standard host-based terminal emulator client.

To start host-based clients from a window manager menu, you must define the display on which you want the client to run.

hostname Is the terminal where the local client is to run. command Is the local client command.

options Are the command options listed in Table 7-1 and in the man pages.

Adding Local Clients to the Default Root Menu

The default root menu lists a number of local client commands. If you do not configure root menus or if some mouse buttons are not bound to a root menu, pressing a mouse button in the root window displays the default root menu.

To add local clients to the default root menu, add commands in theexec-command-menu table.

For example, to add a command to the menu to start a specific Java applet, you could add the following line:

{ "Draw Demo" "appletviewer http://java.sun.com/applets/DrawTest/example1.html" }

The default entries inexec-command-menu are listed in Table 7-2.

Table 7-2 Default Root Menu Contents

Menu Label Command

Show Console console

Start Terminal term

Start Dialer dialer

Start 3270 tn3270

Start 3179G tn3270 -gddm -loadps -E -S3 Start Keymap Editor keymap_editor

Show Memory show memory

Show X Connections show connections

Lock Screen lock

Setup User Preferences pref

Login login

Logout logout