Blob


1 MYMENU(1) - General Commands Manual
3 # NAME
5 **mymenu** - simple menu for XOrg
7 # SYNOPSIS
9 **mymenu**
10 \[**-hva**]
11 \[**-p** *prompt*]
12 \[**-x** *coord*]
13 \[**-y** *coord*]
14 \[**-W** *width*]
15 \[**-H** *height*]
16 \[**-P** *padding*]
17 \[**-l** *layout*]
18 \[**-f** *font*]
19 \[**-b** *borders*]
20 \[**-B** *colors*]
21 \[**-t** *color*]
22 \[**-T** *color*]
23 \[**-c** *color*]
24 \[**-C** *color*]
25 \[**-s** *color*]
26 \[**-S** *color*]
27 \[**-w** *window*]
29 # DESCRIPTION
31 The
32 **mymenu**
33 utility a simple graphical menu for XOrg. It read the items from
34 **stdin**
35 and print the user selection to
36 **stdout**
37 on exit.
39 The following options are available and take the maximum precedence
40 over the (respective) ones defined in the
41 **X Resource Database**
43 **-h**
45 > Print a small usage message to stderr.
47 **-v**
49 > Print version and exit.
51 **-a**
53 > The first completion (if any) is always selected. This is like dmenu.
55 **-p** *prompt*
57 > Override the prompt
59 **-x** *val*
61 > Override the positioning on the X axis, parsed as the resource MyMenu.x
63 **-y** *val*
65 > Override the positioning on the Y axis, parsed as the resource MyMenu.y
67 **-P** *padding*
69 > Override the padding. See the MyMenu.padding resource.
71 **-l** *layout*
73 > Override the layout. Parsed as MyMenu.layout.
75 **-f** *font*
77 > Override the font. See MyMenu.font.
79 **-w** *val*
81 > Override the width. Parsed as MyMenu.width.
83 **-h** *val*
85 > Override the height. Parsed as MyMenu.height.
87 **-b** *borders*
89 > Override the borders size. Parsed as MyMenu.border.size.
91 **-B** *colors*
93 > Override the borders color. Parsed as MyMenu.border.color.
95 **-t** *color*
97 > Override the prompt foreground color. See MyMenu.prompt.foreground.
99 **-T** *color*
101 > Override the prompt background color. See MyMenu.prompt.background.
103 **-c** *color*
105 > Override the completion foreground color. See MyMenu.completion.foreground.
107 **-C** *color*
109 > Override the completion background color. See MyMenu.completion.background.
111 **-s** *color*
113 > Override the highlighted completion foreground color. See MyMenu.completion\_highlighted.foreground.
115 **-S** *color*
117 > Override the highlighted completion background color. See MyMenu.completion\_highlighted.background.
119 **-w** *window*
121 > Embed into the given window id.
123 # RESOURCES
125 MyMenu.font
127 > The font name to use. By default is set to "fixed" if compiled without
128 > Xft(3) support, "monospace" otherwise. Without Xft(3) only bitmap font
129 > are supported.
131 MyMenu.layout
133 > The layout of the menu. The possible values are "horizontal" and
134 > "vertical", with the default being "horizontal". Every other value
135 > than "horizontal" is treated like "vertical", but this is kinda an
136 > implementation detail and not something to be relied on, since in the
137 > future other layout could be added as well.
139 Mymenu.prompt
141 > A string that is rendered before the user input. Default to "$ ".
143 MyMenu.width
145 > The width of the menu. If a numeric value is given (e.g. 400) is
146 > interpreted as pixel, if it ends with a percentage symbol \`%'
147 > (e.g. 40%) the relative percentage will be computed (relative to the
148 > monitor width).
150 MyMenu.height
152 > The height of the menu. Like MyMenu.width if a numeric value is given
153 > is interpreted as pixel, if it ends with a percentage symbol \`%' the
154 > relative percentage will be computed (relative to the monitor height).
156 MyMenu.x
158 > The X coordinate of the topmost left corner of the window. Much like
159 > MyMenu.height and MyMenu.width both a pixel dimension and percentage
160 > could be supplied. In addition to it, some special value can be used.
162 > start
164 > > Alias for 0;
166 > middle
168 > > Compute the correct value to make sure that mymenu will be
169 > > horizontally centered;
171 > end
173 > > Compute the correct value to make sure that mymenu will be right
174 > > aligned.
176 MyMenu.y
178 > The Y coordinate of the topmost left corner of the window. Like the X
179 > coordinate a pixel dimension, percentage dimension or the special
180 > value "start", "middle", "end" could be supplied.
182 MyMenu.padding
184 > Change the padding. In the horizontal layout the padding is the space
185 > between the rectangle of the completion and the text as well as the
186 > space between the prompt and the first completion. In the horizontal
187 > layout the padding is the horizontal spacing between the window edge
188 > and the text as well as the space up and down the text within the
189 > completion. The default value is 10.
191 MyMenu.border.size
193 > A list of number separated by spaces to specify the border of the
194 > window. The field is parsed like some CSS properties (i.e. padding),
195 > that is: if only one value is provided then it'll be used for all
196 > borders; if two value are given than the first will be used for the
197 > top and bottom border and the former for the left and right border;
198 > with three value the first is used for the top border, the second for
199 > the left and right border and the third for the bottom border. If four
200 > value are given, they'll be applied to the respective border
201 > clockwise. Other values will be ignored. The default value is 0.
203 MyMenu.border.color
205 > A list of colors for the borders. This field is parsed like the
206 > MyMenu.border.size. The default value is black.
208 MyMenu.prompt.background
210 > The background of the prompt.
212 MyMenu.prompt.foreground
214 > The text color (foreground) of the prompt.
216 MyMenu.completion.background
218 > The background of the completions.
220 MyMenu.completion.foreground
222 > The text color of the completions.
224 MyMenu.completion\_highlighted.background
226 > The background of the selected completion.
228 MyMenu.completion\_highlighted.foreground
230 > The foreground of the selected completion.
232 # KEYS
234 This is the list of keybinding recognized by
235 **mymenu**.
236 In the following examples, C-c means Control-c.
238 Esc
240 > Close the menu without selecting any entry
242 C-c
244 > The same as Esc
246 Enter
248 > Close the menu and print to stdout what the user typed
250 C-m
252 > The same as Enter
254 Tab
256 > Expand the prompt to the next possible completion
258 Shift Tab
260 > Expand the prompt to the previous possible completion
262 C-n
264 > The same as Tab
266 C-p
268 > The same as Shift-Tab
270 Backspace
272 > Delete the last character
274 C-h
276 > The same as Backspace
278 C-w
280 > Delete the last word
282 C-u
284 > Delete the whole line
286 C-i
288 > Toggle the \`\`first selected'' style. Sometimes, especially with the -a
289 > option, could be handy to disable that behaviour. Let's say that
290 > you've typed \`\`fire'' and the first completion is \`\`firefox'' but you
291 > really want to choose \`\`fire''. While you can type some spaces, this
292 > keybinding is a more elegant way to change, at runtime, the behaviour
293 > of the first completion.
295 # BUGS
297 * If, instead of a numeric value, a not-valid number that terminates
298 with the % sign is supplied, then the default value for that field
299 will be treated as a percentage. Since this is a misuse of the
300 resources this behavior isn't strictly considered a bug.
302 * C-w (delete last word) does not work well with multi-byte string. The
303 whole UTF-8 support is still kinda naïve and should be improved.
305 * Keep in mind that sometimes the order of the options matter. First are
306 parsed (if any) the xrdb options, then the command line flags
307 **in the provided order!**
308 That meas that if you're providing first the x coordinate, let's say
309 "middle", and
310 **after that**
311 you are overriding the width, the window
312 **will not be**
313 centered.
315 As a general rule of thumb, if you're overriding the width and/or the
316 height of the window, remember to override the x and y coordinates as
317 well.
319 # EXIT STATUS
321 0 when the user select an entry, 1 when the user press Esc, EX\_USAGE
322 if used with wrong flags and EX\_UNAVAILABLE if the connection to X
323 fails.
325 # SEE ALSO
327 dmenu(1)
328 sysexits(3)
330 # AUTHORS
332 Omar Polo <omar.polo@europecom.net>
334 OpenBSD 6.3 - July 15, 2018