5a83c7dc |
1 | .TH XMENU 1 |
08f16589 |
2 | .SH NAME |
3 | xmenu \- menu utility for X |
4 | .SH SYNOPSIS |
5 | .B xmenu |
78fb523f |
6 | .RB [ \-irw ] |
05cfe1a0 |
7 | .RB [ -p |
8 | .IR position ] |
3bec05ea |
9 | .RI [ title ] |
08f16589 |
10 | .SH DESCRIPTION |
11 | .B xmenu |
12 | is a menu for X, |
13 | it reads a list of newline-separated items from stdin, |
14 | shows a menu for the user to select one of the items, |
15 | and outputs the item selected to stdout. |
16 | .PP |
3bec05ea |
17 | The options are as follows: |
18 | .TP |
71b4db92 |
19 | .B -i |
20 | Disable icons. |
7832d2cf |
21 | This makes xmenu loading faster when not using icons. |
71b4db92 |
22 | .TP |
05cfe1a0 |
23 | .BI -p " position" |
24 | Set the position to spawn xmenu. |
25 | Without this option, xmenu spawns next to the cursor. |
26 | .I position |
27 | is a string of the form |
237da982 |
28 | .BR INTxINT[:MONITOR] , |
05cfe1a0 |
29 | where the first INT is the x position and the second INT is the y position. |
237da982 |
30 | The monitor part between brackets is optional. |
31 | .B MONITOR |
32 | can be a number from 0 to the number of monitors minus 1; |
33 | or it can be a string like |
34 | .B current |
35 | or |
36 | .BR cursor . |
37 | If present, the monitor specifies that the position is relative to the upper left corner |
38 | of that monitor. |
39 | If |
40 | .B monitor |
41 | is |
42 | .B current |
43 | or |
44 | .BR cursor , |
45 | the monitor to be used is that where the cursor is in. |
46 | For example, |
47 | .B -p 0x0:cursor |
48 | specifies that |
49 | .B xmenu |
50 | must spawn at the position 0x0 of the monitor where the cursor is in. |
51 | And |
52 | .B -p 100x500:0 |
53 | specifies that |
54 | .B xmenu |
55 | must spawn at the position 100x500 of the monitor 0. |
05cfe1a0 |
56 | .TP |
1146fd81 |
57 | .B -r |
58 | If this option is set, the right mouse button is disabled; |
59 | so pressing it will not trigger any menu item. |
60 | .TP |
3bec05ea |
61 | .B -w |
62 | Asks the window manager to draw a border around the menus. |
71b4db92 |
63 | This option may be buggy in some window managers, |
64 | specially tiled ones that do not respect window hints. |
45b2e22f |
65 | .TP |
66 | \fB\-x\fP [\fImod\fP-]\fIbutton\fP |
67 | This option requires an argument of the form |
68 | \fImod\fP-\fIbutton\fP or \fIbutton\fP; where |
69 | .I mod |
70 | is |
71 | .B Mod1 |
72 | to |
73 | .BR Mod5 , |
74 | or |
75 | .B Alt |
76 | (equivalent to |
77 | .BR Mod1 ), |
78 | or |
79 | .B Super |
80 | (equivalent to |
81 | .BR Mod4 ); |
82 | and |
83 | .I button |
84 | is the number of a mouse button. |
85 | When this option is used, |
86 | .B pmenu |
87 | listens to button presses on the root window, |
88 | and shows the pie menu when the given button is pressed, |
89 | together with the given modifier, |
90 | on the root window. |
91 | For example, invoking |
92 | .B pmenu |
93 | with the option |
94 | .B -x Super-3 |
95 | makes a menu open when clicking with the third mouse button on the root window, |
96 | or when clicking with the third mouse button together with the Super (Mod4) modifier on any window. |
97 | This option makes |
98 | .B pmenu |
99 | run continuously; |
100 | so it should be used when |
101 | .B pmenu |
102 | is invoked in background on a X startup file (like |
103 | .BR "~/.xinitrc" ). |
104 | .TP |
105 | \fB\-X\fP [\fImod\fP-]\fIbutton\fP |
106 | Just like |
107 | .BR \-x , |
108 | but also pass the click to the root window |
109 | (for the window manager to use it, for example). |
110 | This option is incompatible with |
111 | .BR \-x . |
3bec05ea |
112 | .PP |
08f16589 |
113 | Each item read from stdin has the following format: |
114 | .IP |
115 | .EX |
33376f54 |
116 | ITEM := [TABS] [[IMAGE TABS] LABEL [TABS OUTPUT]] NEWLINE |
08f16589 |
117 | .EE |
118 | .PP |
6b5123e7 |
119 | That means that each item is composed by |
33376f54 |
120 | tabs, followed by an optional image specification, followed by tabs |
121 | followed by a label, followed by more tabs, followed by an output, |
6b5123e7 |
122 | and ended by a newline. Brackets group optional elements. |
08f16589 |
123 | .IP |
124 | The initial tabs indicate the menu hierarchy: |
125 | items indented with a tab is shown in a submenu of the preceding item not indented. |
6b5123e7 |
126 | An item without initial tabs is a top-level item. |
08f16589 |
127 | .IP |
33376f54 |
128 | The image is a string of the form "IMG:/path/to/image.png". |
523b3d5e |
129 | It specifies the path to a image file to be shown as icon at the left of the entry. |
130 | If the path does not begin with "/", "./" or "../", |
131 | the file is searched on the paths specified in the |
132 | .B ICONPATH |
133 | environment variable. |
33376f54 |
134 | .IP |
08f16589 |
135 | The label is the string that will be shown as a item in the menu. |
136 | An item without label is considered a separator and is drawn as a thin line in the menu |
137 | separating the item above from the item below. |
138 | .IP |
6b5123e7 |
139 | The output is the string that will be output after selecting the item. |
140 | If an item does not have an output, its label is used as its output. |
08f16589 |
141 | .IP |
142 | The newline terminates the item specification. |
3bec05ea |
143 | .PP |
144 | If the argument |
145 | .I title |
146 | is given, the title of the menu window is set to it. |
858338d9 |
147 | .SH USAGE |
148 | .B xmenu |
149 | is controlled by the mouse, |
150 | but can also be controlled by the keyboard. |
151 | Items can be selected using the arrow keys, |
152 | Tab (with and without Shift), |
45115feb |
153 | Home, End, |
2b0484b1 |
154 | Enter and Esc, and 1-9 keys. |
78fb523f |
155 | Items can also be selected by typing the first several characters in it. |
858338d9 |
156 | .TP |
45115feb |
157 | .BR Home |
158 | Select the first item in the menu. |
159 | .TP |
160 | .BR End |
161 | Select the last item in the menu. |
162 | .TP |
28f784a7 |
163 | .BR Down |
164 | Cycle through the items in the regular direction. |
165 | .TP |
166 | .BR Tab |
858338d9 |
167 | Cycle through the items in the regular direction. |
78fb523f |
168 | When the type\-to\-select feature is active, cycle through matching items instead. |
28f784a7 |
169 | .TP |
170 | .BR Up |
171 | Cycle through the items in the reverse direction. |
858338d9 |
172 | .TP |
28f784a7 |
173 | .BR Shift-Tab |
858338d9 |
174 | Cycle through the items in the reverse direction. |
78fb523f |
175 | When the type\-to\-select feature is active, cycle through matching items instead. |
858338d9 |
176 | .TP |
177 | .BR Right ", " Enter |
178 | Select the highlighted item. |
179 | .TP |
180 | .B Left |
181 | Go to the menu above. |
182 | .TP |
183 | .B Esc |
184 | Go to the menu above or exit xmenu. |
45115feb |
185 | .PP |
78fb523f |
186 | .B xmenu |
187 | features the type\-to\-select selecting style, |
188 | where typing a string will select the first item matching it. |
189 | .PP |
45115feb |
190 | Additional key bindings can be set at compile time by changing the |
191 | .B config.h |
192 | file. |
f644b8bc |
193 | .SH RESOURCES |
194 | .B |
195 | xmenu |
196 | understands the following X resources. |
197 | .TP |
198 | .B xmenu.font |
199 | The font in which the labels should be drawn. |
cdeaefaa |
200 | Multiple fonts can be added as fallback fonts; |
201 | they must be separated by a comma. |
f644b8bc |
202 | .TP |
203 | .B xmenu.background |
5a83c7dc |
204 | The background color of non-selected items in the menu. |
f644b8bc |
205 | .TP |
206 | .B xmenu.foreground |
5a83c7dc |
207 | The color of the label text of non-selected items in the menu. |
f644b8bc |
208 | .TP |
209 | .B xmenu.selbackground |
5a83c7dc |
210 | The background color of selected items in the menu. |
f644b8bc |
211 | .TP |
212 | .B xmenu.selforeground |
5a83c7dc |
213 | The color of the label text of selected items in the menu. |
f644b8bc |
214 | .TP |
215 | .B xmenu.border |
216 | The color of the border around the menu. |
217 | .TP |
218 | .B xmenu.separator |
5a83c7dc |
219 | The color of the separator between items in the menu. |
f644b8bc |
220 | .TP |
92e7609b |
221 | .B xmenu.gap |
222 | The gap, in pixels, between the menus. |
223 | .TP |
f644b8bc |
224 | .B xmenu.width |
225 | The minimum width, in pixels, of the items in the menu. |
226 | .TP |
685ca30d |
227 | .B xmenu.height |
228 | The size in pixels of the height of a single menu item. |
f644b8bc |
229 | .TP |
fd530f3f |
230 | .B xmenu.borderWidth |
f644b8bc |
231 | The size in pixels of the border around the menu. |
232 | .TP |
fd530f3f |
233 | .B xmenu.separatorWidth |
f644b8bc |
234 | The size in pixels of the item separator. |
27c03246 |
235 | .TP |
236 | .B xmenu.alignment |
237 | If set to |
238 | .BR "\(dqleft\(dq" , |
239 | .BR "\(dqcenter\(dq" , |
240 | or |
241 | .BR "\(dqright\(dq" , |
242 | text is aligned to the left, center, or right of the menu, respectively. |
243 | By default, text is aligned to the left. |
523b3d5e |
244 | .TP |
245 | .B xmenu.maxItems |
246 | Maximum number of items to be displayed in a menu. |
247 | If more a menu has more than this number of items, |
248 | they will be scrolled with arrow buttons. |
249 | .SH ENVIRONMENT |
250 | The following environment variables affect the execution of |
251 | .BR pmenu . |
252 | .TP |
253 | .B DISPLAY |
254 | The display to start |
255 | .B pmenu |
256 | on. |
257 | .TP |
258 | .B ICONPATH |
259 | A colon-separated list of directories used to search for the location of image files. |
08f16589 |
260 | .SH EXAMPLES |
d584fba6 |
261 | The following script illustrates the use of |
08f16589 |
262 | .BR xmenu . |
c49dad28 |
263 | The output is redirected to |
264 | .IR sh (1), |
265 | creating a command to be run by the shell. |
08f16589 |
266 | .IP |
267 | .EX |
268 | #!/bin/sh |
269 | |
6aee4109 |
270 | xmenu <<EOF | sh & |
08f16589 |
271 | Applications |
33376f54 |
272 | IMG:./web.png Web Browser firefox |
d584fba6 |
273 | IMG:./gimp.png Image editor gimp |
33376f54 |
274 | Terminal (xterm) xterm |
275 | Terminal (urxvt) urxvt |
276 | Terminal (st) st |
08f16589 |
277 | |
33376f54 |
278 | Shutdown poweroff |
279 | Reboot reboot |
08f16589 |
280 | EOF |
281 | .EE |
282 | .PP |
283 | For example, by selecting \(lqApplications\(rq, a new menu will appear. |
d584fba6 |
284 | Selecting \(lqWeb Browser\(rq in the new menu opens firefox. |
08f16589 |
285 | .SH SEE ALSO |
286 | .IR dmenu (1), |
287 | .IR 9menu (1), |
288 | .IR thingmenu (1) |