1 MYMENU(1) - General Commands Manual
5 **mymenu** - simple menu for XOrg
11 \[**-B** *colors*]
13 \[**-C** *color*]
14 \[**-c** *color*]
15 \[**-d** *separator*]
16 \[**-e** *window*]
18 \[**-G** *color*]
20 \[**-H** *height*]
21 \[**-I** *color*]
23 \[**-J** *color*]
25 \[**-l** *layout*]
26 \[**-P** *padding*]
27 \[**-p** *prompt*]
28 \[**-S** *color*]
29 \[**-s** *color*]
30 \[**-T** *color*]
31 \[**-t** *color*]
32 \[**-W** *width*]
33 \[**-x** *coord*]
34 \[**-y** *coord*]
40 utility a simple graphical menu for XOrg. It read the items from
42 and print the user selection to
46 The following options are available and take the maximum precedence
47 over the (respective) ones defined in the
48 **X Resource Database**
52 > The user must chose one of the option (or none) and is not able to
53 > arbitrary enter text
57 > The first completion (if any) is always selected. This is like dmenu.
61 > Override the borders color. Parsed as MyMenu.border.color.
65 > Override the borders size. Parsed as MyMenu.border.size.
69 > Override the completion background color. See
70 > MyMenu.completion.background.
74 > Override the completion foreground color. See
75 > MyMenu.completion.foreground.
79 > Define a string to be used as a separator (mnemonic: delimiter). Only
80 > the text after the separator will be rendered, but the original string
81 > will be returned. Useful to embed custom data on every entry. See the
82 > mpd example for hints on how this can be useful.
86 > Embed into the given window id.
90 > Override the font. See MyMenu.font.
94 > Override the border colors of the prompt. See
95 > MyMenu.prompt.border.color.
99 > Override the border size of the prompt. See
100 > MyMenu.prompt.border.size.
104 > Override the height. Parsed as MyMenu.height.
108 > Print a small usage message to stderr.
112 > Override the border colors of the completion. See
113 > MyMenu.completion.border.color.
117 > Override the border size of the completion. See
118 > MyMenu.completion.border.size.
122 > Override the border colors of the completion. See
123 > MyMenu.completion\_highlighted.border.color.
127 > Override the border size of the completion. See
128 > MyMenu.completion\_highlighted.border.size.
132 > Override the layout. Parsed as MyMenu.layout.
136 > The user can select multiple entry via C-m. Please consult
142 > Override the padding. See the MyMenu.prompt.padding resource.
146 > Override the prompt
150 > Override the highlighted completion background color. See
151 > MyMenu.completion\_highlighted.background.
155 > Override the highlighted completion foreground color. See
156 > MyMenu.completion\_highlighted.foreground.
160 > Override the prompt background color. See MyMenu.prompt.background.
164 > Override the prompt foreground color. See MyMenu.prompt.foreground.
168 > Print version and exit.
172 > Override the width. Parsed as MyMenu.width.
176 > Override the positioning on the X axis, parsed as the resource MyMenu.x
180 > Override the positioning on the Y axis, parsed as the resource MyMenu.y
186 > The font name to use. By default is set to "fixed" if compiled without
187 > Xft(3) support, "monospace" otherwise. Without Xft(3) only bitmap font
192 > The layout of the menu. The possible values are "horizontal" and
193 > "vertical", with the default being "horizontal". Every other value
194 > than "horizontal" is treated like "vertical", but this is kinda an
195 > implementation detail and not something to be relied on, since in the
196 > future other layout could be added as well.
200 > A string that is rendered before the user input. Default to "$ ".
202 MyMenu.prompt.border.size
204 > Parsed like MyMenu.border.size, but affects only the prompt. Default
207 MyMenu.prompt.border.color
209 > Parsed like MyMenu.border.color, but affects only the prompt. Default
212 MyMenu.prompt.padding
214 > Parsed like MyMenu.border.size. The padding is the space between the
215 > end of the borderd and the start of the text, in any direction (top,
216 > bottom, left, right). Default to 10.
220 > The width of the menu. If a numeric value is given (e.g. 400) is
221 > interpreted as pixel, if it ends with a percentage symbol \`%'
222 > (e.g. 40%) the relative percentage will be computed (relative to the
227 > The height of the menu. Like MyMenu.width if a numeric value is given
228 > is interpreted as pixel, if it ends with a percentage symbol \`%' the
229 > relative percentage will be computed (relative to the monitor height).
233 > The X coordinate of the topmost left corner of the window. Much like
234 > MyMenu.height and MyMenu.width both a pixel dimension and percentage
235 > could be supplied. In addition to it, some special value can be used.
243 > > Compute the correct value to make sure that mymenu will be
244 > > horizontally centered;
248 > > Compute the correct value to make sure that mymenu will be right
253 > The Y coordinate of the topmost left corner of the window. Like the X
254 > coordinate a pixel dimension, percentage dimension or the special
255 > value "start", "middle", "end" could be supplied.
259 > A list of number separated by spaces to specify the border of the
260 > window. The field is parsed like some CSS properties (i.e. padding),
261 > that is: if only one value is provided then it'll be used for all
262 > borders; if two value are given than the first will be used for the
263 > top and bottom border and the former for the left and right border;
264 > with three value the first is used for the top border, the second for
265 > the left and right border and the third for the bottom border. If four
266 > value are given, they'll be applied to the respective border
267 > clockwise. Other values will be ignored. The default value is 0.
269 > This particular option accepts a percentage (e.g. 10%) relative to the
274 > A list of colors for the borders. This field is parsed like the
275 > MyMenu.border.size. The default value is black.
277 MyMenu.prompt.background
279 > The background of the prompt.
281 MyMenu.prompt.foreground
283 > The text color (foreground) of the prompt.
285 MyMenu.completion.background
287 > The background of the completions.
289 MyMenu.completion.foreground
291 > The text color of the completions.
293 MyMenu.completion.border.size
295 > Parsed like MyMenu.border.size, but affects only the
296 > completion. Default to 0.
298 MyMenu.completion.border.color
300 > Parsed like MyMenu.border.color, but affects only the
301 > completion. Default to #000 (black).
303 MyMenu.completion.padding
305 > Parsed like MyMenu.prompt.padding. Default to 10.
307 MyMenu.completion\_highlighted.background
309 > The background of the selected completion.
311 MyMenu.completion\_highlighted.foreground
313 > The foreground of the selected completion.
315 MyMenu.completion\_highlighted.border.size
317 > Parsed like MyMenu.border.size, but affects only the completion
318 > highlighted. Default to 0.
320 MyMenu.completion\_highlighted.border.color
322 > Parsed like MyMenu.border.color, but affects only the completion
323 > highlighted. Default to #000 (black).
325 MyMenu.completion\_highlighted.padding
327 > Parsed like MyMenu.prompt.padding. Default to 10.
331 MyMenu accept colors only in the form of:
339 The opacity is assumed 0xff (no transparency) if not provided.
343 This is the list of keybinding recognized by
345 In the following examples, C-c means Control-c.
349 > Close the menu without selecting any entry
357 > Close the menu and print to stdout what the user typed
361 > Confirm but keep looping (if enabled), otherwise complete only
365 > Expand the prompt to the next possible completion
369 > Expand the prompt to the previous possible completion
377 > The same as Shift-Tab
381 > Delete the last character
385 > The same as Backspace
389 > Delete the last word
393 > Delete the whole line
397 > Toggle the \`\`first selected'' style. Sometimes, especially with the -a
398 > option, could be handy to disable that behaviour. Let's say that
399 > you've typed \`\`fire'' and the first completion is \`\`firefox'' but you
400 > really want to choose \`\`fire''. While you can type some spaces, this
401 > keybinding is a more elegant way to change, at runtime, the behaviour
402 > of the first completion.
406 0 when the user select an entry, 1 when the user press Esc, EX\_USAGE
407 if used with wrong flags and EX\_UNAVAILABLE if the connection to X
412 * Create a simple menu with a couple of entry
414 cat <<EOF | $SHELL -c "$(mymenu -p "Exec: ")"
422 * Select and play a song from the current mpd playlist
424 fmt="%position% %artist% - %title%"
425 if song=$(mpc playlist -f "$fmt" | mymenu -p "Song: " -A -d " "); then
426 mpc play $(echo $song | sed "s/ .*$//")
436 Omar Polo <omar.polo@europecom.net>
440 * If, instead of a numeric value, a not-valid number that terminates
441 with the % sign is supplied, then the default value for that field
442 will be treated as a percentage. Since this is a misuse of the
443 resources this behavior isn't strictly considered a bug.
445 * Keep in mind that sometimes the order of the options matter. First are
446 parsed (if any) the xrdb options, then the command line flags
447 **in the provided order!**
448 That meas that if you're providing first the x coordinate, let's say
451 you are overriding the width, the window
455 As a general rule of thumb, if you're overriding the width and/or the
456 height of the window, remember to override the x and y coordinates as
459 OpenBSD 6.4 - October 17, 2018