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