Blame


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