1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
|
.TH 9MENU 1 "May 05 1997" "Plan 9 For X"
.SH NAME
9menu \- create a menu to run commands
.SH SYNOPSIS
.B 9menu
[
.BI \-display " displayname"
] [
.BI \-font " fname"
] [
.BI \-geometry " geom"
] [
.BI \-label " name"
] [
.BI \-fg " foreground-color"
] [
.BI \-bg " background-color"
] [
.BI \-shell " prog"
] [
.B \-popup
] [
.B \-popdown
] [
.B \-iconic
] [
.B \-teleport
] [
.B \-warp
] [
.B \-version
]
.IR menuitem [: command ]
\&...
.SH DESCRIPTION
.I 9menu
is a simple program that accepts a list of menu item and command
pairs on the command line.
It creates a window that consists of nothing but a menu.
When a particular item is selected, the corresponding command is executed.
Either
.B Button1
or
.B Button3
may be used to select an item.
.PP
Menu items and commands are separated by a colon. The colon and command
are optional. If they are missing, then the menu item is assumed to be
a command that can be executed directly.
.PP
A menu item consisting of the word
.B exit
will cause
.I 9menu
to exit.
Otherwise, the menu should be deleted from the window manager.
The
.B exit
menu item can be anywhere in the list, although by convention it is last.
If a command is supplied along with the
.B exit
item, that command will be executed before
.I 9menu
exits.
.PP
.I 9menu
accepts the following command line options.
.RS
.TP
.BI \-display " displayname"
Use the X display
.IR displayname ,
instead of the default display.
.TP
.BI \-font " fname"
Use the font
.IR fname ,
instead of one of the default fonts built into
.IR 9wm .
.TP
.BI \-geometry " geom"
Use
.I geom
(a geometry in standard X format) as the geometry of the menu.
This is most useful for specifying the initial location of the menu.
.I 9menu
will override the size part of the geometry specification. The window will
always be just large enough to hold the menu.
.TP
.BI \-label " name"
Change both the window and icon labels of the window to
.IR name .
The default label is the last component of the path used to run
.IR 9menu ,
typically,
.BR 9menu .
.TP
.BI \-fg " foreground-color"
Set the foreground color to
.IR foreground-color .
By default, the foreground color is black.
.TP
.BI \-bg " background-color"
Set the background color to
.IR background-color .
By default, the background color is white.
.TP
.BI \-shell " prog"
Use
.I prog
as the shell to run commands, instead of
.BR /bin/sh .
A popular alternative shell is
.IR rc (1).
If the shell cannot be executed,
.I 9menu
will
.I silently
fall back to using
.BR /bin/sh .
.TP
.B \-popup
Act like a pop-up menu. Once a menu item is selected,
.I 9menu
will exit.
This option overrides
.BR \-popdown .
.TP
.B \-popdown
Once an item is selected, the menu window will automatically iconify itself.
.TP
.B \-iconic
Start up in the iconified state.
.TP
.B \-teleport
Move the menu to where the mouse is when the menu is uniconified.
This option is particularly useful when combined with
.BR \-popdown .
.TP
.B \-warp
Warp the mouse to the menu when the menu is uniconified.
After the selection is made, restore the mouse to where it was.
This option is particularly useful when combined with
.BR \-popdown .
.TP
.B \-version
This option prints the version of
.I 9menu
on the standard output, and then exits with an exit value of zero.
.RE
.SH EXAMPLES
.ft B
.nf
9menu -label Remotes xterm 'acme:rsh acme xterm' 'herman:rsh herman 9term' &
.sp
9menu -label 'X progs' ghostview xdvi xeyes xneko exit &
.ft
.fi
.SH SEE ALSO
.IR sam (1),
.IR 9term (1),
.IR 9wm (1),
.IR rc (1),
.IR es (1).
.PP
.IR "The Plan 9 Programmer's Manual" .
.SH AUTHORS
The initial idea for this program was by Arnold Robbins, after having
worked with John Mackin's GWM Blit emulation.
Matty Farrow wrote a version using libXg, from which some ideas were borrowed.
This code was written by David Hogan and Arnold Robbins.
Rich Salz motivated the
.B \-shell
option.
Christopher Platt motivated the
.B \-teleport
option.
John O'Donnell supplied the basic code for the
.B \-fg
and
.B \-bg
options.
|