Merge branch 'master' into type
[xmenu] / xmenu.1
CommitLineData
5a83c7dc 1.TH XMENU 1
08f16589 2.SH NAME
3xmenu \- menu utility for X
4.SH SYNOPSIS
5.B xmenu
28f784a7 6.RB [ \-irtw ]
05cfe1a0 7.RB [ -p
8.IR position ]
3bec05ea 9.RI [ title ]
08f16589 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
3bec05ea 17The options are as follows:
18.TP
71b4db92 19.B -i
20Disable icons.
7832d2cf 21This makes xmenu loading faster when not using icons.
71b4db92 22.TP
05cfe1a0 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
237da982 28.BR INTxINT[:MONITOR] ,
05cfe1a0 29where the first INT is the x position and the second INT is the y position.
237da982 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.
05cfe1a0 56.TP
1146fd81 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
28f784a7 61.B -t
62If this option is set, the type-to-select feature is enabled,
63so typing a string will select the first item matching it.
64.TP
3bec05ea 65.B -w
66Asks the window manager to draw a border around the menus.
71b4db92 67This option may be buggy in some window managers,
68specially tiled ones that do not respect window hints.
3bec05ea 69.PP
08f16589 70Each item read from stdin has the following format:
71.IP
72.EX
33376f54 73ITEM := [TABS] [[IMAGE TABS] LABEL [TABS OUTPUT]] NEWLINE
08f16589 74.EE
75.PP
6b5123e7 76That means that each item is composed by
33376f54 77tabs, followed by an optional image specification, followed by tabs
78followed by a label, followed by more tabs, followed by an output,
6b5123e7 79and ended by a newline. Brackets group optional elements.
08f16589 80.IP
81The initial tabs indicate the menu hierarchy:
82items indented with a tab is shown in a submenu of the preceding item not indented.
6b5123e7 83An item without initial tabs is a top-level item.
08f16589 84.IP
33376f54 85The image is a string of the form "IMG:/path/to/image.png".
86It specifies a image to be shown as icon at the left of the entry.
87.IP
08f16589 88The label is the string that will be shown as a item in the menu.
89An item without label is considered a separator and is drawn as a thin line in the menu
90separating the item above from the item below.
91.IP
6b5123e7 92The output is the string that will be output after selecting the item.
93If an item does not have an output, its label is used as its output.
08f16589 94.IP
95The newline terminates the item specification.
3bec05ea 96.PP
97If the argument
98.I title
99is given, the title of the menu window is set to it.
858338d9 100.SH USAGE
101.B xmenu
102is controlled by the mouse,
103but can also be controlled by the keyboard.
104Items can be selected using the arrow keys,
105Tab (with and without Shift),
45115feb 106Home, End,
2b0484b1 107Enter and Esc, and 1-9 keys.
858338d9 108.TP
45115feb 109.BR Home
110Select the first item in the menu.
111.TP
112.BR End
113Select the last item in the menu.
114.TP
28f784a7 115.BR Down
116Cycle through the items in the regular direction.
117.TP
118.BR Tab
858338d9 119Cycle through the items in the regular direction.
28f784a7 120If the type-to-select feature is enabled, and there is a typed string in memory,
121cycle through matching items instead.
122.TP
123.BR Up
124Cycle through the items in the reverse direction.
858338d9 125.TP
28f784a7 126.BR Shift-Tab
858338d9 127Cycle through the items in the reverse direction.
28f784a7 128If the type-to-select feature is enabled, and there is a typed string in memory,
129cycle through matching items instead.
858338d9 130.TP
131.BR Right ", " Enter
132Select the highlighted item.
133.TP
134.B Left
135Go to the menu above.
136.TP
137.B Esc
138Go to the menu above or exit xmenu.
45115feb 139.PP
140Additional key bindings can be set at compile time by changing the
141.B config.h
142file.
f644b8bc 143.SH RESOURCES
144.B
145xmenu
146understands the following X resources.
147.TP
148.B xmenu.font
149The font in which the labels should be drawn.
cdeaefaa 150Multiple fonts can be added as fallback fonts;
151they must be separated by a comma.
f644b8bc 152.TP
153.B xmenu.background
5a83c7dc 154The background color of non-selected items in the menu.
f644b8bc 155.TP
156.B xmenu.foreground
5a83c7dc 157The color of the label text of non-selected items in the menu.
f644b8bc 158.TP
159.B xmenu.selbackground
5a83c7dc 160The background color of selected items in the menu.
f644b8bc 161.TP
162.B xmenu.selforeground
5a83c7dc 163The color of the label text of selected items in the menu.
f644b8bc 164.TP
165.B xmenu.border
166The color of the border around the menu.
167.TP
168.B xmenu.separator
5a83c7dc 169The color of the separator between items in the menu.
f644b8bc 170.TP
92e7609b 171.B xmenu.gap
172The gap, in pixels, between the menus.
173.TP
f644b8bc 174.B xmenu.width
175The minimum width, in pixels, of the items in the menu.
176.TP
685ca30d 177.B xmenu.height
178The size in pixels of the height of a single menu item.
f644b8bc 179.TP
fd530f3f 180.B xmenu.borderWidth
f644b8bc 181The size in pixels of the border around the menu.
182.TP
fd530f3f 183.B xmenu.separatorWidth
f644b8bc 184The size in pixels of the item separator.
27c03246 185.TP
186.B xmenu.alignment
187If set to
188.BR "\(dqleft\(dq" ,
189.BR "\(dqcenter\(dq" ,
190or
191.BR "\(dqright\(dq" ,
192text is aligned to the left, center, or right of the menu, respectively.
193By default, text is aligned to the left.
f644b8bc 194
08f16589 195.SH EXAMPLES
d584fba6 196The following script illustrates the use of
08f16589 197.BR xmenu .
c49dad28 198The output is redirected to
199.IR sh (1),
200creating a command to be run by the shell.
08f16589 201.IP
202.EX
203#!/bin/sh
204
6b5123e7 205cat <<EOF | xmenu | sh &
08f16589 206Applications
33376f54 207 IMG:./web.png Web Browser firefox
d584fba6 208 IMG:./gimp.png Image editor gimp
33376f54 209Terminal (xterm) xterm
210Terminal (urxvt) urxvt
211Terminal (st) st
08f16589 212
33376f54 213Shutdown poweroff
214Reboot reboot
08f16589 215EOF
216.EE
217.PP
218For example, by selecting \(lqApplications\(rq, a new menu will appear.
d584fba6 219Selecting \(lqWeb Browser\(rq in the new menu opens firefox.
08f16589 220.SH SEE ALSO
221.IR dmenu (1),
222.IR 9menu (1),
223.IR thingmenu (1)