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 or center
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 > mx and my
253 > > These stands for x and y coordinate of the mouse respectively.
255 MyMenu.y
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.
261 MyMenu.border.size
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
274 > screen width.
276 MyMenu.border.color
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.
333 # COLORS
335 MyMenu accept colors only in the form of:
337 * #rgb
339 * #rrggbb
341 * #aarrggbb
343 The opacity is assumed 0xff (no transparency) if not provided.
345 # KEYS
347 This is the list of keybinding recognized by
348 **mymenu**.
349 In the following examples, C-c means Control-c.
351 Esc
353 > Close the menu without selecting any entry
355 C-c
357 > The same as Esc
359 Enter
361 > Close the menu and print to stdout what the user typed
363 C-m
365 > Confirm but keep looping (if enabled), otherwise complete only
367 Tab
369 > Expand the prompt to the next possible completion
371 Shift Tab
373 > Expand the prompt to the previous possible completion
375 C-n
377 > The same as Tab
379 C-p
381 > The same as Shift-Tab
383 Backspace
385 > Delete the last character
387 C-h
389 > The same as Backspace
391 C-w
393 > Delete the last word
395 C-u
397 > Delete the whole line
399 C-i
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.
408 Button1
410 > Clicking on the prompt area closes mymenu, clicking on an item will
411 > confirm it.
413 Button3
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)
422 # EXIT STATUS
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
426 fails.
428 # EXAMPLES
430 * Create a simple menu with a couple of entry
432 cat <<EOF | $SHELL -c "$(mymenu -p "Exec: ")"
433 firefox
434 zzz
435 xcalc -stipple
436 xlock
437 gimp
438 EOF
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/ .*$//")
445 fi
447 # SEE ALSO
449 dmenu(1)
450 sysexits(3)
452 # AUTHORS
454 Omar Polo &lt;omar.polo@europecom.net&gt;
456 # CAVEATS
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
467 "middle", and
468 **after that**
469 you are overriding the width, the window
470 **will not be**
471 centered.
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
475 well.
477 * Clicking past the last item will be equivalent to clicking the last item.
479 Void Linux - October 20, 2019