Adding Xinerama support
[xmenu] / xmenu.1
... / ...
CommitLineData
1.TH XMENU 1
2.SH NAME
3xmenu \- menu utility for X
4.SH SYNOPSIS
5.B xmenu
6.RB [ \-iw ]
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.
21.B xmenu
22allocates a space at the left side of the menu for the icons;
23if there is no icon, then this space will be blank.
24Setting the
25.B -i
26option removes this space, making the menu narrower.
27.TP
28.BI -p " position"
29Set the position to spawn xmenu.
30Without this option, xmenu spawns next to the cursor.
31.I position
32is a string of the form
33.BR INTxINT[:MONITOR] ,
34where the first INT is the x position and the second INT is the y position.
35The monitor part between brackets is optional.
36.B MONITOR
37can be a number from 0 to the number of monitors minus 1;
38or it can be a string like
39.B current
40or
41.BR cursor .
42If present, the monitor specifies that the position is relative to the upper left corner
43of that monitor.
44If
45.B monitor
46is
47.B current
48or
49.BR cursor ,
50the monitor to be used is that where the cursor is in.
51For example,
52.B -p 0x0:cursor
53specifies that
54.B xmenu
55must spawn at the position 0x0 of the monitor where the cursor is in.
56And
57.B -p 100x500:0
58specifies that
59.B xmenu
60must spawn at the position 100x500 of the monitor 0.
61.TP
62.B -w
63Asks the window manager to draw a border around the menus.
64This option may be buggy in some window managers,
65specially tiled ones that do not respect window hints.
66.PP
67Each item read from stdin has the following format:
68.IP
69.EX
70ITEM := [TABS] [[IMAGE TABS] LABEL [TABS OUTPUT]] NEWLINE
71.EE
72.PP
73That means that each item is composed by
74tabs, followed by an optional image specification, followed by tabs
75followed by a label, followed by more tabs, followed by an output,
76and ended by a newline. Brackets group optional elements.
77.IP
78The initial tabs indicate the menu hierarchy:
79items indented with a tab is shown in a submenu of the preceding item not indented.
80An item without initial tabs is a top-level item.
81.IP
82The image is a string of the form "IMG:/path/to/image.png".
83It specifies a image to be shown as icon at the left of the entry.
84.IP
85The label is the string that will be shown as a item in the menu.
86An item without label is considered a separator and is drawn as a thin line in the menu
87separating the item above from the item below.
88.IP
89The output is the string that will be output after selecting the item.
90If an item does not have an output, its label is used as its output.
91.IP
92The newline terminates the item specification.
93.PP
94If the argument
95.I title
96is given, the title of the menu window is set to it.
97.SH USAGE
98.B xmenu
99is controlled by the mouse,
100but can also be controlled by the keyboard.
101Items can be selected using the arrow keys,
102Tab (with and without Shift),
103Enter and Esc.
104.TP
105.BR Down ", " Tab
106Cycle through the items in the regular direction.
107.TP
108.BR Up ", " Shift-Tab
109Cycle through the items in the reverse direction.
110.TP
111.BR Right ", " Enter
112Select the highlighted item.
113.TP
114.B Left
115Go to the menu above.
116.TP
117.B Esc
118Go to the menu above or exit xmenu.
119.SH RESOURCES
120.B
121xmenu
122understands the following X resources.
123.TP
124.B xmenu.font
125The font in which the labels should be drawn.
126Multiple fonts can be added as fallback fonts;
127they must be separated by a comma.
128.TP
129.B xmenu.background
130The background color of non-selected items in the menu.
131.TP
132.B xmenu.foreground
133The color of the label text of non-selected items in the menu.
134.TP
135.B xmenu.selbackground
136The background color of selected items in the menu.
137.TP
138.B xmenu.selforeground
139The color of the label text of selected items in the menu.
140.TP
141.B xmenu.border
142The color of the border around the menu.
143.TP
144.B xmenu.separator
145The color of the separator between items in the menu.
146.TP
147.B xmenu.gap
148The gap, in pixels, between the menus.
149.TP
150.B xmenu.width
151The minimum width, in pixels, of the items in the menu.
152.TP
153.B xmenu.height
154The size in pixels of the height of a single menu item.
155.TP
156.B xmenu.borderWidth
157The size in pixels of the border around the menu.
158.TP
159.B xmenu.separatorWidth
160The size in pixels of the item separator.
161
162.SH EXAMPLES
163The following script illustrates the use of
164.BR xmenu .
165The output is redirected to
166.IR sh (1),
167creating a command to be run by the shell.
168.IP
169.EX
170#!/bin/sh
171
172cat <<EOF | xmenu | sh &
173Applications
174 IMG:./web.png Web Browser firefox
175 IMG:./gimp.png Image editor gimp
176Terminal (xterm) xterm
177Terminal (urxvt) urxvt
178Terminal (st) st
179
180Shutdown poweroff
181Reboot reboot
182EOF
183.EE
184.PP
185For example, by selecting \(lqApplications\(rq, a new menu will appear.
186Selecting \(lqWeb Browser\(rq in the new menu opens firefox.
187.SH SEE ALSO
188.IR dmenu (1),
189.IR 9menu (1),
190.IR thingmenu (1)