Blob


1 .Dd $Mdocdate$
2 .Dt MYMENU 1
3 .Os
4 .Sh NAME
5 .Nm mymenu
6 .Nd simple menu for XOrg
7 .Sh SYNOPSIS
8 .Nm
9 .Bk -words
10 .Op Fl hva
11 .Op Fl p Ar prompt
12 .Op Fl x Ar coord
13 .Op Fl y Ar coord
14 .Op Fl W Ar width
15 .Op Fl H Ar height
16 .Op Fl P Ar padding
17 .Op Fl l Ar layout
18 .Op Fl f Ar font
19 .Op Fl b Ar borders
20 .Op Fl B Ar colors
21 .Op Fl t Ar color
22 .Op Fl T Ar color
23 .Op Fl c Ar color
24 .Op Fl C Ar color
25 .Op Fl s Ar color
26 .Op Fl S Ar color
27 .Op Fl w Ar window
28 .Ek
29 .Sh DESCRIPTION
30 The
31 .Nm
32 utility a simple graphical menu for XOrg. It read the items from
33 .Ic stdin
34 and print the user selection to
35 .Ic stdout
36 on exit.
38 The following options are available and take the maximum precedence
39 over the (respective) ones defined in the
40 .Sy X Resource Database
41 .Bl -tag -width indent-two
42 .It Fl h
43 Print a small usage message to stderr.
44 .It Fl v
45 Print version and exit.
46 .It Fl a
47 The first completion (if any) is always selected. This is like dmenu.
48 .It Fl p Ar prompt
49 Override the prompt
50 .It Fl x Ar val
51 Override the positioning on the X axis, parsed as the resource MyMenu.x
52 .It Fl y Ar val
53 Override the positioning on the Y axis, parsed as the resource MyMenu.y
54 .It Fl P Ar padding
55 Override the padding. See the MyMenu.padding resource.
56 .It Fl l Ar layout
57 Override the layout. Parsed as MyMenu.layout.
58 .It Fl f Ar font
59 Override the font. See MyMenu.font.
60 .It Fl w Ar val
61 Override the width. Parsed as MyMenu.width.
62 .It Fl h Ar val
63 Override the height. Parsed as MyMenu.height.
64 .It Fl b Ar borders
65 Override the borders size. Parsed as MyMenu.border.size.
66 .It Fl B Ar colors
67 Override the borders color. Parsed as MyMenu.border.color.
68 .It Fl t Ar color
69 Override the prompt foreground color. See MyMenu.prompt.foreground.
70 .It Fl T Ar color
71 Override the prompt background color. See MyMenu.prompt.background.
72 .It Fl c Ar color
73 Override the completion foreground color. See MyMenu.completion.foreground.
74 .It Fl C Ar color
75 Override the completion background color. See MyMenu.completion.background.
76 .It Fl s Ar color
77 Override the highlighted completion foreground color. See MyMenu.completion_highlighted.foreground.
78 .It Fl S Ar color
79 Override the highlighted completion background color. See MyMenu.completion_highlighted.background.
80 .It Fl w Ar window
81 Embed into the given window id.
82 .El
83 .Sh RESOURCES
84 .Bl -tag -width Ds
85 .It MyMenu.font
86 The font name to use. By default is set to "fixed" if compiled without
87 Xft(3) support, "monospace" otherwise. Without Xft(3) only bitmap font
88 are supported.
89 .It MyMenu.layout
90 The layout of the menu. The possible values are "horizontal" and
91 "vertical", with the default being "horizontal". Every other value
92 than "horizontal" is treated like "vertical", but this is kinda an
93 implementation detail and not something to be relied on, since in the
94 future other layout could be added as well.
95 .It Mymenu.prompt
96 A string that is rendered before the user input. Default to "$ ".
97 .It MyMenu.width
98 The width of the menu. If a numeric value is given (e.g. 400) is
99 interpreted as pixel, if it ends with a percentage symbol `%'
100 (e.g. 40%) the relative percentage will be computed (relative to the
101 monitor width).
102 .It MyMenu.height
103 The height of the menu. Like MyMenu.width if a numeric value is given
104 is interpreted as pixel, if it ends with a percentage symbol `%' the
105 relative percentage will be computed (relative to the monitor height).
106 .It MyMenu.x
107 The X coordinate of the topmost left corner of the window. Much like
108 MyMenu.height and MyMenu.width both a pixel dimension and percentage
109 could be supplied. In addition to it, some special value can be used.
110 .Bl -tag
111 .It start
112 Alias for 0;
113 .It middle
114 Compute the correct value to make sure that mymenu will be
115 horizontally centered;
116 .It end
117 Compute the correct value to make sure that mymenu will be right
118 aligned.
119 .El
120 .It MyMenu.y
121 The Y coordinate of the topmost left corner of the window. Like the X
122 coordinate a pixel dimension, percentage dimension or the special
123 value "start", "middle", "end" could be supplied.
124 .It MyMenu.padding
125 Change the padding. In the horizontal layout the padding is the space
126 between the rectangle of the completion and the text as well as the
127 space between the prompt and the first completion. In the horizontal
128 layout the padding is the horizontal spacing between the window edge
129 and the text as well as the space up and down the text within the
130 completion. The default value is 10.
131 .It MyMenu.border.size
132 A list of number separated by spaces to specify the border of the
133 window. The field is parsed like some CSS properties (i.e. padding),
134 that is: if only one value is provided then it'll be used for all
135 borders; if two value are given than the first will be used for the
136 top and bottom border and the former for the left and right border;
137 with three value the first is used for the top border, the second for
138 the left and right border and the third for the bottom border. If four
139 value are given, they'll be applied to the respective border
140 clockwise. Other values will be ignored. The default value is 0.
141 .It MyMenu.border.color
142 A list of colors for the borders. This field is parsed like the
143 MyMenu.border.size. The default value is black.
144 .It MyMenu.prompt.background
145 The background of the prompt.
146 .It MyMenu.prompt.foreground
147 The text color (foreground) of the prompt.
148 .It MyMenu.completion.background
149 The background of the completions.
150 .It MyMenu.completion.foreground
151 The text color of the completions.
152 .It MyMenu.completion_highlighted.background
153 The background of the selected completion.
154 .It MyMenu.completion_highlighted.foreground
155 The foreground of the selected completion.
156 .El
158 .Sh KEYS
159 This is the list of keybinding recognized by
160 .Li Nm Ns .
161 In the following examples, C-c means Control-c.
162 .Bl -tag -width indent-two
163 .It Esc
164 Close the menu without selecting any entry
165 .It C-c
166 The same as Esc
167 .It Enter
168 Close the menu and print to stdout what the user typed
169 .It C-m
170 The same as Enter
171 .It Tab
172 Expand the prompt to the next possible completion
173 .It Shift Tab
174 Expand the prompt to the previous possible completion
175 .It C-n
176 The same as Tab
177 .It C-p
178 The same as Shift-Tab
179 .It Backspace
180 Delete the last character
181 .It C-h
182 The same as Backspace
183 .It C-w
184 Delete the last word
185 .It C-u
186 Delete the whole line
187 .It C-i
188 Toggle the ``first selected'' style. Sometimes, especially with the -a
189 option, could be handy to disable that behaviour. Let's say that
190 you've typed ``fire'' and the first completion is ``firefox'' but you
191 really want to choose ``fire''. While you can type some spaces, this
192 keybinding is a more elegant way to change, at runtime, the behaviour
193 of the first completion.
194 .El
196 .Sh BUGS
197 .Bl -bullet
198 .It
199 If, instead of a numeric value, a not-valid number that terminates
200 with the % sign is supplied, then the default value for that field
201 will be treated as a percentage. Since this is a misuse of the
202 resources this behavior isn't strictly considered a bug.
203 .It
204 C-w (delete last word) does not work well with multi-byte string. The
205 whole UTF-8 support is still kinda naïve and should be improved.
206 .It
207 Keep in mind that sometimes the order of the options matter. First are
208 parsed (if any) the xrdb options, then the command line flags
209 .Sy in the provided order!
210 That meas that if you're providing first the x coordinate, let's say
211 "middle", and
212 .Sy after that
213 you are overriding the width, the window
214 .Sy will not be
215 centered.
217 As a general rule of thumb, if you're overriding the width and/or the
218 height of the window, remember to override the x and y coordinates as
219 well.
220 .El
222 .Sh EXIT STATUS
224 0 when the user select an entry, 1 when the user press Esc, EX_USAGE
225 if used with wrong flags and EX_UNAVAILABLE if the connection to X
226 fails.
228 .Sh SEE ALSO
229 .Xr dmenu 1
230 .Xr sysexits 3
232 .Sh AUTHORS
233 .An Omar Polo <omar.polo@europecom.net>