Blob


1 .Dd $Mdocdate$
2 .Dt MYMENU 1
3 .Os
4 .Sh NAME
5 .Nm mymenu
6 .Nd simple menu for XOrg
7 .Sh DESCRIPTION
8 The
9 .Nm
10 utility a simple graphical menu for XOrg. It read the items from
11 .Ic stdin
12 and print the user selection to
13 .Ic stdout
14 on exit.
15 .Sh OPTIONS
16 .Bl -tag -width Ds
17 .It Fl a
18 The first completion (if any) is always selected. This is like dmenu.
19 .It Fl h
20 Print a small usage message to stderr.
21 .It Fl v
22 Print version and exit.
23 .El
24 .Sh RESOURCES
26 The appearance of the menu is defined through the \fBX Resource
27 Database\fR.
28 .Bl -tag -width Ds
29 .It MyMenu.font
30 The font name to use. By default is set to "fixed" if compiled without
31 Xft(3) support, "monospace" otherwise. Without Xft(3) only bitmap font
32 are supported.
33 .It MyMenu.layout
34 The layout of the menu. The possible values are "horizontal" and
35 "vertical", with the default being "horizontal". Every other value
36 than "horizontal" is treated like "vertical", but this is kinda an
37 implementation detail and not something to be relied on, since in the
38 future other layout could be added as well.
39 .It Mymenu.prompt
40 A string that is rendered before the user input. Default to "$ ".
41 .It MyMenu.width
42 The width of the menu. If a numeric value is given (e.g. 400) is
43 interpreted as pixel, if it ends with a percentage symbol `%'
44 (e.g. 40%) the relative percentage will be computed (relative to the
45 monitor width).
46 .It MyMenu.height
47 The height of the menu. Like MyMenu.width if a numeric value is given
48 is interpreted as pixel, if it ends with a percentage symbol `%' the
49 relative percentage will be computed (relative to the monitor height).
50 .It MyMenu.x
51 The X coordinate of the topmost left corner of the window. Much like
52 MyMenu.height and MyMenu.width both a pixel dimension and percentage
53 could be supplied. In addition to it, some special value can be used.
54 .Bl -tag
55 .It start
56 Alias for 0;
57 .It middle
58 Compute the correct value to make sure that mymenu will be
59 horizontally centered;
60 .It end
61 Compute the correct value to make sure that mymenu will be right
62 aligned.
63 .El
64 .It MyMenu.y
65 The Y coordinate of the topmost left corner of the window. Like the X
66 coordinate a pixel dimension, percentage dimension or the special
67 value "start", "middle", "end" could be supplied.
68 .It MyMenu.padding
69 Change the padding. In the horizontal layout the padding is the space
70 between the rectangle of the completion and the text as well as the
71 space between the prompt and the first completion. In the horizontal
72 layout the padding is the horizontal spacing between the window edge
73 and the text as well as the space up and down the text within the
74 completion. The default value is 10.
75 .It MyMenu.border.size
76 A list of number separated by spaces to specify the border of the
77 window. The field is parsed like some CSS properties (i.e. padding),
78 that is: if only one value is provided then it'll be used for all
79 borders; if two value are given than the first will be used for the
80 top and bottom border and the former for the left and right border;
81 with three value the first is used for the top border, the second for
82 the left and right border and the third for the bottom border. If four
83 value are given, they'll be applied to the respective border
84 clockwise. Other values will be ignored. The default value is 0.
85 .It MyMenu.border.color
86 A list of colors for the borders. This field is parsed like the
87 MyMenu.border.size. The default value is black.
88 .It MyMenu.prompt.background
89 The background of the prompt.
90 .It MyMenu.prompt.foreground
91 The text color (foreground) of the prompt.
92 .It MyMenu.completion.background
93 The background of the completions.
94 .It MyMenu.completion.foreground
95 The text color of the completions.
96 .It MyMenu.completion_highlighted.background
97 The background of the selected completion.
98 .It MyMenu.completion_highlighted.foreground
99 The foreground of the selected completion.
100 .El
102 .Sh KEYS
103 This is the list of keybinding recognized by
104 .Li Nm Ns .
105 In the following examples, C-c means Control-c.
106 .Bl -tag -width indent-two
107 .It Esc
108 Close the menu without selecting any entry
109 .It C-c
110 The same as Esc
111 .It Enter
112 Close the menu and print to stdout what the user typed
113 .It C-m
114 The same as Enter
115 .It Tab
116 Expand the prompt to the next possible completion
117 .It Shift Tab
118 Expand the prompt to the previous possible completion
119 .It C-n
120 The same as Tab
121 .It C-p
122 The same as Shift-Tab
123 .It Backspace
124 Delete the last character
125 .It C-h
126 The same as Backspace
127 .It C-w
128 Delete the last word
129 .It C-u
130 Delete the whole line
131 .It C-i
132 Toggle the ``first selected'' style. Sometimes, especially with the -a
133 option, could be handy to disable that behaviour. Let's say that
134 you've typed ``fire'' and the first completion is ``firefox'' but you
135 really want to choose ``fire''. While you can type some spaces, this
136 keybinding is a more elegant way to change, at runtime, the behaviour
137 of the first completion.
138 .El
140 .Sh BUGS
141 .Bl -bullet
142 .It
143 If, instead of a numeric value, a not-valid number that terminates
144 with the % sign is supplied, then the default value for that field
145 will be treated as a percentage. Since this is a misuse of the
146 resources this behavior isn't strictly considered a bug.
147 .It
148 C-w (delete last word) does not work well with multi-byte string. The
149 whole UTF-8 support is still kinda naïve and should be improved.
150 .El
152 .Sh EXIT STATUS
154 0 when the user select an entry, 1 when the user press Esc, EX_USAGE
155 if used with wrong flags and EX_UNAVAILABLE if the connection to X
156 fails.
158 .Sh SEE ALSO
159 .Xr dmenu 1
160 .Xr sysexits 3
162 .Sh AUTHORS
163 .An Omar Polo <omar.polo@europecom.net>