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