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 > > These stands for x and y coordinate of the mouse respectively.
257 > The Y coordinate of the topmost left corner of the window. Like the X
258 > coordinate a pixel dimension, percentage dimension or the special
259 > value "start", "middle"/"center", "end" or "mx"/"my" could be supplied.
263 > A list of number separated by spaces to specify the border of the
264 > window. The field is parsed like some CSS properties (i.e. padding),
265 > that is: if only one value is provided then it'll be used for all
266 > borders; if two value are given than the first will be used for the
267 > top and bottom border and the former for the left and right border;
268 > with three value the first is used for the top border, the second for
269 > the left and right border and the third for the bottom border. If four
270 > value are given, they'll be applied to the respective border
271 > clockwise. Other values will be ignored. The default value is 0.
273 > This particular option accepts a percentage (e.g. 10%) relative to the
278 > A list of colors for the borders. This field is parsed like the
279 > MyMenu.border.size. The default value is black.
281 MyMenu.prompt.background
283 > The background of the prompt.
285 MyMenu.prompt.foreground
287 > The text color (foreground) of the prompt.
289 MyMenu.completion.background
291 > The background of the completions.
293 MyMenu.completion.foreground
295 > The text color of the completions.
297 MyMenu.completion.border.size
299 > Parsed like MyMenu.border.size, but affects only the
300 > completion. Default to 0.
302 MyMenu.completion.border.color
304 > Parsed like MyMenu.border.color, but affects only the
305 > completion. Default to #000 (black).
307 MyMenu.completion.padding
309 > Parsed like MyMenu.prompt.padding. Default to 10.
311 MyMenu.completion\_highlighted.background
313 > The background of the selected completion.
315 MyMenu.completion\_highlighted.foreground
317 > The foreground of the selected completion.
319 MyMenu.completion\_highlighted.border.size
321 > Parsed like MyMenu.border.size, but affects only the completion
322 > highlighted. Default to 0.
324 MyMenu.completion\_highlighted.border.color
326 > Parsed like MyMenu.border.color, but affects only the completion
327 > highlighted. Default to #000 (black).
329 MyMenu.completion\_highlighted.padding
331 > Parsed like MyMenu.prompt.padding. Default to 10.
335 MyMenu accept colors only in the form of:
343 The opacity is assumed 0xff (no transparency) if not provided.
347 This is the list of keybinding recognized by
349 In the following examples, C-c means Control-c.
353 > Close the menu without selecting any entry
361 > Close the menu and print to stdout what the user typed
365 > Confirm but keep looping (if enabled), otherwise complete only
369 > Expand the prompt to the next possible completion
373 > Expand the prompt to the previous possible completion
381 > The same as Shift-Tab
385 > Delete the last character
389 > The same as Backspace
393 > Delete the last word
397 > Delete the whole line
401 > Toggle the \`\`first selected'' style. Sometimes, especially with the -a
402 > option, could be handy to disable that behaviour. Let's say that
403 > you've typed \`\`fire'' and the first completion is \`\`firefox'' but you
404 > really want to choose \`\`fire''. While you can type some spaces, this
405 > keybinding is a more elegant way to change, at runtime, the behaviour
406 > of the first completion.
410 > Clicking on the prompt area closes mymenu, clicking on an item will
415 > Clicking on the prompt area closes mymenu, clicking on an item will
416 > confirm but keep looping (if enabled) the clicked item, like C-m
418 Button4,Button5 / scroll
420 > Scroll through the completions (without changing the selection)
424 0 when the user select an entry, 1 when the user press Esc, EX\_USAGE
425 if used with wrong flags and EX\_UNAVAILABLE if the connection to X
430 * Create a simple menu with a couple of entry
432 cat <<EOF | $SHELL -c "$(mymenu -p "Exec: ")"
440 * Select and play a song from the current mpd playlist
442 fmt="%position% %artist% - %title%"
443 if song=$(mpc playlist -f "$fmt" | mymenu -p "Song: " -A -d " "); then
444 mpc play $(echo $song | sed "s/ .*$//")
454 Omar Polo <omar.polo@europecom.net>
458 * If, instead of a numeric value, a not-valid number that terminates
459 with the % sign is supplied, then the default value for that field
460 will be treated as a percentage. Since this is a misuse of the
461 resources this behavior isn't strictly considered a bug.
463 * Keep in mind that sometimes the order of the options matter. First are
464 parsed (if any) the xrdb options, then the command line flags
465 **in the provided order!**
466 That meas that if you're providing first the x coordinate, let's say
469 you are overriding the width, the window
473 As a general rule of thumb, if you're overriding the width and/or the
474 height of the window, remember to override the x and y coordinates as
477 * Clicking past the last item will be equivalent to clicking the last item.
479 Void Linux - October 20, 2019