1 MYMENU(1) - General Commands Manual
5 **mymenu** - simple menu for XOrg
11 \[**-B** *colors*]
12 \[**-b** *borders*]
13 \[**-C** *color*]
14 \[**-c** *color*]
15 \[**-d** *separator*]
16 \[**-e** *window*]
18 \[**-H** *height*]
19 \[**-l** *layout*]
20 \[**-P** *padding*]
21 \[**-p** *prompt*]
22 \[**-T** *color*]
23 \[**-t** *color*]
24 \[**-S** *color*]
25 \[**-s** *color*]
26 \[**-W** *width*]
27 \[**-x** *coord*]
28 \[**-y** *coord*]
34 utility a simple graphical menu for XOrg. It read the items from
36 and print the user selection to
40 The following options are available and take the maximum precedence
41 over the (respective) ones defined in the
42 **X Resource Database**
46 > The user must chose one of the option (or none) and is not able to
47 > arbitrary enter text
51 > The first completion (if any) is always selected. This is like dmenu.
55 > Override the borders color. Parsed as MyMenu.border.color.
59 > Override the borders size. Parsed as MyMenu.border.size.
63 > Override the completion background color. See
64 > MyMenu.completion.background.
68 > Override the completion foreground color. See
69 > MyMenu.completion.foreground.
73 > Define a string to be used as a separator. Only the text after the
74 > separator will be rendered, but the original string will be
75 > returned. Useful to embed custom data on every entry. See the mpd
76 > example for hints on how this can be useful.
80 > Embed into the given window id.
84 > Override the height. Parsed as MyMenu.height.
88 > Print a small usage message to stderr.
92 > Override the font. See MyMenu.font.
96 > Override the layout. Parsed as MyMenu.layout.
100 > The user can select multiple entry via C-m. Please consult
106 > Override the padding. See the MyMenu.padding resource.
110 > Override the prompt
114 > Override the highlighted completion background color. See
115 > MyMenu.completion\_highlighted.background.
119 > Override the highlighted completion foreground color. See
120 > MyMenu.completion\_highlighted.foreground.
124 > Override the prompt background color. See MyMenu.prompt.background.
128 > Override the prompt foreground color. See MyMenu.prompt.foreground.
132 > Print version and exit.
136 > Override the width. Parsed as MyMenu.width.
140 > Override the positioning on the X axis, parsed as the resource MyMenu.x
144 > Override the positioning on the Y axis, parsed as the resource MyMenu.y
150 > The font name to use. By default is set to "fixed" if compiled without
151 > Xft(3) support, "monospace" otherwise. Without Xft(3) only bitmap font
156 > The layout of the menu. The possible values are "horizontal" and
157 > "vertical", with the default being "horizontal". Every other value
158 > than "horizontal" is treated like "vertical", but this is kinda an
159 > implementation detail and not something to be relied on, since in the
160 > future other layout could be added as well.
164 > A string that is rendered before the user input. Default to "$ ".
168 > The width of the menu. If a numeric value is given (e.g. 400) is
169 > interpreted as pixel, if it ends with a percentage symbol \`%'
170 > (e.g. 40%) the relative percentage will be computed (relative to the
175 > The height of the menu. Like MyMenu.width if a numeric value is given
176 > is interpreted as pixel, if it ends with a percentage symbol \`%' the
177 > relative percentage will be computed (relative to the monitor height).
181 > The X coordinate of the topmost left corner of the window. Much like
182 > MyMenu.height and MyMenu.width both a pixel dimension and percentage
183 > could be supplied. In addition to it, some special value can be used.
191 > > Compute the correct value to make sure that mymenu will be
192 > > horizontally centered;
196 > > Compute the correct value to make sure that mymenu will be right
201 > The Y coordinate of the topmost left corner of the window. Like the X
202 > coordinate a pixel dimension, percentage dimension or the special
203 > value "start", "middle", "end" could be supplied.
207 > Change the padding. In the horizontal layout the padding is the space
208 > between the rectangle of the completion and the text as well as the
209 > space between the prompt and the first completion. In the horizontal
210 > layout the padding is the horizontal spacing between the window edge
211 > and the text as well as the space up and down the text within the
212 > completion. The default value is 10.
216 > A list of number separated by spaces to specify the border of the
217 > window. The field is parsed like some CSS properties (i.e. padding),
218 > that is: if only one value is provided then it'll be used for all
219 > borders; if two value are given than the first will be used for the
220 > top and bottom border and the former for the left and right border;
221 > with three value the first is used for the top border, the second for
222 > the left and right border and the third for the bottom border. If four
223 > value are given, they'll be applied to the respective border
224 > clockwise. Other values will be ignored. The default value is 0.
228 > A list of colors for the borders. This field is parsed like the
229 > MyMenu.border.size. The default value is black.
231 MyMenu.prompt.background
233 > The background of the prompt.
235 MyMenu.prompt.foreground
237 > The text color (foreground) of the prompt.
239 MyMenu.completion.background
241 > The background of the completions.
243 MyMenu.completion.foreground
245 > The text color of the completions.
247 MyMenu.completion\_highlighted.background
249 > The background of the selected completion.
251 MyMenu.completion\_highlighted.foreground
253 > The foreground of the selected completion.
257 MyMenu accept colors only in the form of:
265 The opacity is assumed 0xff (no transparency) if not provided.
269 This is the list of keybinding recognized by
271 In the following examples, C-c means Control-c.
275 > Close the menu without selecting any entry
283 > Close the menu and print to stdout what the user typed
287 > Confirm but keep looping (if enabled), otherwise complete only
291 > Expand the prompt to the next possible completion
295 > Expand the prompt to the previous possible completion
303 > The same as Shift-Tab
307 > Delete the last character
311 > The same as Backspace
315 > Delete the last word
319 > Delete the whole line
323 > Toggle the \`\`first selected'' style. Sometimes, especially with the -a
324 > option, could be handy to disable that behaviour. Let's say that
325 > you've typed \`\`fire'' and the first completion is \`\`firefox'' but you
326 > really want to choose \`\`fire''. While you can type some spaces, this
327 > keybinding is a more elegant way to change, at runtime, the behaviour
328 > of the first completion.
332 0 when the user select an entry, 1 when the user press Esc, EX\_USAGE
333 if used with wrong flags and EX\_UNAVAILABLE if the connection to X
338 * Create a simple menu with a couple of entry
340 cat <<EOF | $SHELL -c "$(mymenu -p "Exec: ")"
348 * Select and play a song from the current mpd playlist
350 fmt="%position%) %artist% - %title%"
351 if song=$(mpc playlist -f "$fmt" | mymenu -p "Song: " -A -d ") "); then
352 mpc play $(echo $song | sed "s/).*$//")
362 Omar Polo <omar.polo@europecom.net>
366 * If, instead of a numeric value, a not-valid number that terminates
367 with the % sign is supplied, then the default value for that field
368 will be treated as a percentage. Since this is a misuse of the
369 resources this behavior isn't strictly considered a bug.
371 * Keep in mind that sometimes the order of the options matter. First are
372 parsed (if any) the xrdb options, then the command line flags
373 **in the provided order!**
374 That meas that if you're providing first the x coordinate, let's say
377 you are overriding the width, the window
381 As a general rule of thumb, if you're overriding the width and/or the
382 height of the window, remember to override the x and y coordinates as
385 OpenBSD 6.4 - September 16, 2018