Blob


1 MYMENU(1) - General Commands Manual
3 # NAME
5 **mymenu** - simple menu for XOrg
7 # SYNOPSIS
9 **mymenu**
10 \[**-Aahmv**]
11 \[**-B** *colors*]
12 \[**-b** *size*]
13 \[**-C** *color*]
14 \[**-c** *color*]
15 \[**-d** *separator*]
16 \[**-e** *window*]
17 \[**-f** *font*]
18 \[**-G** *color*]
19 \[**-g** *size*]
20 \[**-H** *height*]
21 \[**-I** *color*]
22 \[**-i** *size*]
23 \[**-J** *color*]
24 \[**-j** *size*]
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*]
36 # DESCRIPTION
38 The
39 **mymenu**
40 utility a simple graphical menu for XOrg. It read the items from
41 **stdin**
42 and print the user selection to
43 **stdout**
44 on exit.
46 The following options are available and take the maximum precedence
47 over the (respective) ones defined in the
48 **X Resource Database**
50 **-A**
52 > The user must chose one of the option (or none) and is not able to
53 > arbitrary enter text
55 **-a**
57 > The first completion (if any) is always selected. This is like dmenu.
59 **-B** *colors*
61 > Override the borders color. Parsed as MyMenu.border.color.
63 **-b** *borders*
65 > Override the borders size. Parsed as MyMenu.border.size.
67 **-C** *color*
69 > Override the completion background color. See
70 > MyMenu.completion.background.
72 **-c** *color*
74 > Override the completion foreground color. See
75 > MyMenu.completion.foreground.
77 **-d** *separator*
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.
84 **-e** *windowid*
86 > Embed into the given window id.
88 **-f** *font*
90 > Override the font. See MyMenu.font.
92 **-G** *color*
94 > Override the border colors of the prompt. See
95 > MyMenu.prompt.border.color.
97 **-g** *size*
99 > Override the border size of the prompt. See
100 > MyMenu.prompt.border.size.
102 **-H** *val*
104 > Override the height. Parsed as MyMenu.height.
106 **-h**
108 > Print a small usage message to stderr.
110 **-I** *color*
112 > Override the border colors of the completion. See
113 > MyMenu.completion.border.color.
115 **-i** *size*
117 > Override the border size of the completion. See
118 > MyMenu.completion.border.size.
120 **-J** *color*
122 > Override the border colors of the completion. See
123 > MyMenu.completion\_highlighted.border.color.
125 **-j** *size*
127 > Override the border size of the completion. See
128 > MyMenu.completion\_highlighted.border.size.
130 **-l** *layout*
132 > Override the layout. Parsed as MyMenu.layout.
134 **-m**
136 > The user can select multiple entry via C-m. Please consult
137 > *KEYS*
138 > for more info.
140 **-P** *padding*
142 > Override the padding. See the MyMenu.prompt.padding resource.
144 **-p** *prompt*
146 > Override the prompt
148 **-S** *color*
150 > Override the highlighted completion background color. See
151 > MyMenu.completion\_highlighted.background.
153 **-s** *color*
155 > Override the highlighted completion foreground color. See
156 > MyMenu.completion\_highlighted.foreground.
158 **-T** *color*
160 > Override the prompt background color. See MyMenu.prompt.background.
162 **-t** *color*
164 > Override the prompt foreground color. See MyMenu.prompt.foreground.
166 **-v**
168 > Print version and exit.
170 **-W** *val*
172 > Override the width. Parsed as MyMenu.width.
174 **-x** *val*
176 > Override the positioning on the X axis, parsed as the resource MyMenu.x
178 **-y** *val*
180 > Override the positioning on the Y axis, parsed as the resource MyMenu.y
182 # RESOURCES
184 MyMenu.font
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
188 > are supported.
190 MyMenu.layout
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.
198 MyMenu.prompt
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
205 > to 0.
207 MyMenu.prompt.border.color
209 > Parsed like MyMenu.border.color, but affects only the prompt. Default
210 > to #000 (black).
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.
218 MyMenu.width
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
223 > monitor width).
225 MyMenu.height
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).
231 MyMenu.x
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.
237 > start
239 > > Alias for 0;
241 > middle
243 > > Compute the correct value to make sure that mymenu will be
244 > > horizontally centered;
246 > end
248 > > Compute the correct value to make sure that mymenu will be right
249 > > aligned.
251 MyMenu.y
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.
257 MyMenu.border.size
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
270 > screen width.
272 MyMenu.border.color
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.
329 # COLORS
331 MyMenu accept colors only in the form of:
333 * #rgb
335 * #rrggbb
337 * #aarrggbb
339 The opacity is assumed 0xff (no transparency) if not provided.
341 # KEYS
343 This is the list of keybinding recognized by
344 **mymenu**.
345 In the following examples, C-c means Control-c.
347 Esc
349 > Close the menu without selecting any entry
351 C-c
353 > The same as Esc
355 Enter
357 > Close the menu and print to stdout what the user typed
359 C-m
361 > Confirm but keep looping (if enabled), otherwise complete only
363 Tab
365 > Expand the prompt to the next possible completion
367 Shift Tab
369 > Expand the prompt to the previous possible completion
371 C-n
373 > The same as Tab
375 C-p
377 > The same as Shift-Tab
379 Backspace
381 > Delete the last character
383 C-h
385 > The same as Backspace
387 C-w
389 > Delete the last word
391 C-u
393 > Delete the whole line
395 C-i
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.
404 # EXIT STATUS
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
408 fails.
410 # EXAMPLES
412 * Create a simple menu with a couple of entry
414 cat <<EOF | $SHELL -c "$(mymenu -p "Exec: ")"
415 firefox
416 zzz
417 xcalc -stipple
418 xlock
419 gimp
420 EOF
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/ .*$//")
427 fi
429 # SEE ALSO
431 dmenu(1)
432 sysexits(3)
434 # AUTHORS
436 Omar Polo &lt;omar.polo@europecom.net&gt;
438 # CAVEATS
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
449 "middle", and
450 **after that**
451 you are overriding the width, the window
452 **will not be**
453 centered.
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
457 well.
459 OpenBSD 6.4 - October 17, 2018