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