Blob


1 MYMENU(1) - General Commands Manual
3 # NAME
5 **mymenu** - simple menu for XOrg
7 # SYNOPSIS
9 **mymenu**
10 \[**-Aamvh**]
11 \[**-B** *colors*]
12 \[**-b** *borders*]
13 \[**-C** *color*]
14 \[**-c** *color*]
15 \[**-d** *separator*]
16 \[**-e** *window*]
17 \[**-f** *font*]
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*]
30 # DESCRIPTION
32 The
33 **mymenu**
34 utility a simple graphical menu for XOrg. It read the items from
35 **stdin**
36 and print the user selection to
37 **stdout**
38 on exit.
40 The following options are available and take the maximum precedence
41 over the (respective) ones defined in the
42 **X Resource Database**
44 **-A**
46 > The user must chose one of the option (or none) and is not able to
47 > arbitrary enter text
49 **-a**
51 > The first completion (if any) is always selected. This is like dmenu.
53 **-B** *colors*
55 > Override the borders color. Parsed as MyMenu.border.color.
57 **-b** *borders*
59 > Override the borders size. Parsed as MyMenu.border.size.
61 **-C** *color*
63 > Override the completion background color. See
64 > MyMenu.completion.background.
66 **-c** *color*
68 > Override the completion foreground color. See
69 > MyMenu.completion.foreground.
71 **-d** *separator*
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.
78 **-e** *windowid*
80 > Embed into the given window id.
82 **-H** *val*
84 > Override the height. Parsed as MyMenu.height.
86 **-h**
88 > Print a small usage message to stderr.
90 **-f** *font*
92 > Override the font. See MyMenu.font.
94 **-l** *layout*
96 > Override the layout. Parsed as MyMenu.layout.
98 **-m**
100 > The user can select multiple entry via C-m. Please consult
101 > *KEYS*
102 > for more info.
104 **-P** *padding*
106 > Override the padding. See the MyMenu.padding resource.
108 **-p** *prompt*
110 > Override the prompt
112 **-S** *color*
114 > Override the highlighted completion background color. See
115 > MyMenu.completion\_highlighted.background.
117 **-s** *color*
119 > Override the highlighted completion foreground color. See
120 > MyMenu.completion\_highlighted.foreground.
122 **-T** *color*
124 > Override the prompt background color. See MyMenu.prompt.background.
126 **-t** *color*
128 > Override the prompt foreground color. See MyMenu.prompt.foreground.
130 **-v**
132 > Print version and exit.
134 **-W** *val*
136 > Override the width. Parsed as MyMenu.width.
138 **-x** *val*
140 > Override the positioning on the X axis, parsed as the resource MyMenu.x
142 **-y** *val*
144 > Override the positioning on the Y axis, parsed as the resource MyMenu.y
146 # RESOURCES
148 MyMenu.font
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
152 > are supported.
154 MyMenu.layout
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.
162 Mymenu.prompt
164 > A string that is rendered before the user input. Default to "$ ".
166 MyMenu.width
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
171 > monitor width).
173 MyMenu.height
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).
179 MyMenu.x
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.
185 > start
187 > > Alias for 0;
189 > middle
191 > > Compute the correct value to make sure that mymenu will be
192 > > horizontally centered;
194 > end
196 > > Compute the correct value to make sure that mymenu will be right
197 > > aligned.
199 MyMenu.y
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.
205 MyMenu.padding
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.
214 MyMenu.border.size
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.
226 MyMenu.border.color
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.
255 # COLORS
257 MyMenu accept colors only in the form of:
259 * #rgb
261 * #rrggbb
263 * #aarrggbb
265 The opacity is assumed 0xff (no transparency) if not provided.
267 # KEYS
269 This is the list of keybinding recognized by
270 **mymenu**.
271 In the following examples, C-c means Control-c.
273 Esc
275 > Close the menu without selecting any entry
277 C-c
279 > The same as Esc
281 Enter
283 > Close the menu and print to stdout what the user typed
285 C-m
287 > Confirm but keep looping (if enabled), otherwise complete only
289 Tab
291 > Expand the prompt to the next possible completion
293 Shift Tab
295 > Expand the prompt to the previous possible completion
297 C-n
299 > The same as Tab
301 C-p
303 > The same as Shift-Tab
305 Backspace
307 > Delete the last character
309 C-h
311 > The same as Backspace
313 C-w
315 > Delete the last word
317 C-u
319 > Delete the whole line
321 C-i
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.
330 # EXIT STATUS
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
334 fails.
336 # EXAMPLES
338 * Create a simple menu with a couple of entry
340 cat <<EOF | $SHELL -c "$(mymenu -p "Exec: ")"
341 firefox
342 zzz
343 xcalc -stipple
344 xlock
345 gimp
346 EOF
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/ .*$//")
353 fi
355 # SEE ALSO
357 dmenu(1)
358 sysexits(3)
360 # AUTHORS
362 Omar Polo &lt;omar.polo@europecom.net&gt;
364 # CAVEATS
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
375 "middle", and
376 **after that**
377 you are overriding the width, the window
378 **will not be**
379 centered.
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
383 well.
385 OpenBSD 6.4 - September 19, 2018