Remote Login Menus
One of the first things I do when I begin work for a
client who has
lots of systems and uses a window manager is set up
a remote login
menu. I go back and forth among remote systems as I
find new fires
to stamp out, and typing rsh or rlogin soon gets old.
Besides, the ability to have a separate window for each
multiple parallel operations easy. This ease becomes
when the systems are disparate and my work entails comparing
configurations with one another.
By preparing a systems menu and attaching it to the
you can easily select which system you want when you
want it --
or multiple windows on the same system if you need that.
knows what commands and parameters to execute. Just
select the system's
Each System a Window
In Sun's OpenWindows system, the window manager is olwm(1).
When you start OpenWindows, it looks in your home directory
hidden file called .openwin-menu. If there is no such
olwm uses the default menu file, $OPENWINHOME/lib/openwin-menu.
All users must have $OPENWINHOME defined in their environments.
Specific submenus and programs are associated with the
If you don't want the central menu's default settings
or any of its
submenus' settings, or you want to add to any of the
menus, you must
create your own. If you want everyone to have a menu
the one documented, you could, of course, copy and change
files. But that may not be a good idea.
The easiest way to create your own menu is to copy the
into your home directory:
cp $OPENWINHOME/lib/openwin-menu $HOME/.openwin-menu
With a private copy of .openwin-menu, change
or add whatever you like. To keep the menus organized,
create a subdirectory
named ow in your home directory. All submenus will go
The two submenus referred to by the central menu are
and "openwin-menu-utilities." Copy those central
into the ow subdirectory. I shortened their names as
them to ow-menu-prog and ow-menu-util. There will
be one more submenu for the systems menu. Once the new
menu is in
your home directory, restart OpenWindows to activate
Listing 1 shows the customized .openwin-menu file. The
words and phrases in the first field represent the menu
The name may be followed by identifying keywords, such
which gives the menu window's title, or MENU, which
the name of a submenu.
When MENU appears it may be followed by the submenu
by the name of a file containing the submenu information.
case, "Programs" and "Utilities"
do not refer to the
central menu files; instead, the private .openwin- menu
to my copies of them in my ow subdirectory. That way,
system will use the submenus with my private modifications.
Listing 2 shows the ~/ow/ow-menu-prog file as I modified
If PIN is named next to the TITLE, a pushpin image
appears on the title bar of the menu. Click the mouse
on that pushpin
and the menu will stay on the desktop until it's removed.
will be used in the systems submenu.
If the word DEFAULT appears next to a menu selection,
menu item is automatically selected if a user clicks
on the submenu's
name in the main menu without opening the submenu. When
is opened, the DEFAULT item is highlighted. One of my
about the original programs menu was that cmdtool
was set as the default. cmdtool is a text editor style
window that keeps track of the previous user commands
outputs, allowing scrolling back and forth. It uses
more local system
resources to keep track of all that than the shelltool
can slow down the local system. The only cmdtool I want
my screen is the console window. If I need a cmdtool
special purpose, I'll start one from the menu. So, I
The only other change I made was to set the cmdtool
options to start in reverse video (-rv). The standard
lettering on white background -- a desperate attempt
to make screens
look like pieces of paper -- is too harsh on my eyes.
On my laptop's
LCD screen, this isn't a problem, but 20-inch CRTs with
white blaring at me for too long hurts. The -rv option
the problem by using white letters on a black background.
Listing 3 shows the customized ~/ow/ow-menu-util submenu.
This illustrates how to embed a menu within the submenu
than call another file containing the submenu commands.
the submenu definition ends when a line repeating the
title line appears with the keyword END following it.
only change I made in this ow-menu-util submenu was
the "Lock Screen" option to be the default
so that I could
simply select "Utilities" from the main menu
to lock my screen
when I walk away from it. I also added the -mode random
make the lock program interesting.
Back in Listing 1, the keyword SEPARATOR generates a
line in the menu display. This blank line makes visual
simple: single-space related items, skip a line to show
some new relationship
among items. I made sure that a SEPARATOR preceded and
my "Systems" MENU option. SEPARATOR gets used
often in the systems submenu to separate one group of
another. This new "Systems" option refers
to a new file named
to correspond with the other submenu files, ow-menu-sys.
Listing 4 shows the ow-menu-sys submenu I created to
the systems I was concerned with. This shows a lot of
I wouldn't put many more in this submenu. Instead of
adding more systems
to this one, I'd keep a few important ones in this submenu
more submenus to subclassify the other systems.
The systems in the top half, named level4 and level6
and the ones named after colors are all Sun systems.
Those in the
bottom half, named beginning with "hp" and
"system," are Hewlett-Packard systems. level4
level6 are the Sun servers, while the colored systems
regular workstations. level4 is labeled -s to identify
it as the NIS slave server. level6 is labeled -m because
it is the NIS master. hpserv and hpscd064 are the
HP servers. The "system" machines are HP workstations,
those ending with a "t" are cluster stations
served by the
system named without the "t."
For each system named in the menu, I exec a shelltool
the menu item is selected. The -Wl (that's an "ell"
after the "W," not a one) denotes the next
argument as the
window's label. Labeling the window with the system's
name makes it
very easy to see which window is on which system when
many are cascaded
across the screen.
When logging in to many remote systems is a workaday
up a systems menu can make the job simpler -- not only
but for coworkers, too. While I was explaining some
details on my
screen to a group manager, he asked about the little
to the side of my desktop. I explained the systems menu
to him briefly
and continued our discussion. Within an hour, he had
copied the files
discussed here and was happily clicking his way through
About the Author
Larry Reznick has been programming professionally since
1978. He is currently
working on systems programming in UNIX, MS-DOS, and
He teaches C, C++, and UNIX language courses
at American River College and at the University of California,