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