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