Fixing position in some wms when using -w
[xmenu] / xmenu.1
CommitLineData
5a83c7dc 1.TH XMENU 1
08f16589 2.SH NAME
3xmenu \- menu utility for X
4.SH SYNOPSIS
5.B xmenu
71b4db92 6.RB [ \-iw ]
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.
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
05cfe1a0 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
237da982 33.BR INTxINT[:MONITOR] ,
05cfe1a0 34where the first INT is the x position and the second INT is the y position.
237da982 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.
05cfe1a0 61.TP
3bec05ea 62.B -w
63Asks the window manager to draw a border around the menus.
71b4db92 64This option may be buggy in some window managers,
65specially tiled ones that do not respect window hints.
3bec05ea 66.PP
08f16589 67Each item read from stdin has the following format:
68.IP
69.EX
33376f54 70ITEM := [TABS] [[IMAGE TABS] LABEL [TABS OUTPUT]] NEWLINE
08f16589 71.EE
72.PP
6b5123e7 73That means that each item is composed by
33376f54 74tabs, followed by an optional image specification, followed by tabs
75followed by a label, followed by more tabs, followed by an output,
6b5123e7 76and ended by a newline. Brackets group optional elements.
08f16589 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.
6b5123e7 80An item without initial tabs is a top-level item.
08f16589 81.IP
33376f54 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
08f16589 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
6b5123e7 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.
08f16589 91.IP
92The newline terminates the item specification.
3bec05ea 93.PP
94If the argument
95.I title
96is given, the title of the menu window is set to it.
858338d9 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.
f644b8bc 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.
cdeaefaa 126Multiple fonts can be added as fallback fonts;
127they must be separated by a comma.
f644b8bc 128.TP
129.B xmenu.background
5a83c7dc 130The background color of non-selected items in the menu.
f644b8bc 131.TP
132.B xmenu.foreground
5a83c7dc 133The color of the label text of non-selected items in the menu.
f644b8bc 134.TP
135.B xmenu.selbackground
5a83c7dc 136The background color of selected items in the menu.
f644b8bc 137.TP
138.B xmenu.selforeground
5a83c7dc 139The color of the label text of selected items in the menu.
f644b8bc 140.TP
141.B xmenu.border
142The color of the border around the menu.
143.TP
144.B xmenu.separator
5a83c7dc 145The color of the separator between items in the menu.
f644b8bc 146.TP
92e7609b 147.B xmenu.gap
148The gap, in pixels, between the menus.
149.TP
f644b8bc 150.B xmenu.width
151The minimum width, in pixels, of the items in the menu.
152.TP
685ca30d 153.B xmenu.height
154The size in pixels of the height of a single menu item.
f644b8bc 155.TP
fd530f3f 156.B xmenu.borderWidth
f644b8bc 157The size in pixels of the border around the menu.
158.TP
fd530f3f 159.B xmenu.separatorWidth
f644b8bc 160The size in pixels of the item separator.
161
08f16589 162.SH EXAMPLES
d584fba6 163The following script illustrates the use of
08f16589 164.BR xmenu .
c49dad28 165The output is redirected to
166.IR sh (1),
167creating a command to be run by the shell.
08f16589 168.IP
169.EX
170#!/bin/sh
171
6b5123e7 172cat <<EOF | xmenu | sh &
08f16589 173Applications
33376f54 174 IMG:./web.png Web Browser firefox
d584fba6 175 IMG:./gimp.png Image editor gimp
33376f54 176Terminal (xterm) xterm
177Terminal (urxvt) urxvt
178Terminal (st) st
08f16589 179
33376f54 180Shutdown poweroff
181Reboot reboot
08f16589 182EOF
183.EE
184.PP
185For example, by selecting \(lqApplications\(rq, a new menu will appear.
d584fba6 186Selecting \(lqWeb Browser\(rq in the new menu opens firefox.
08f16589 187.SH SEE ALSO
188.IR dmenu (1),
189.IR 9menu (1),
190.IR thingmenu (1)