Adding the -p 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
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
33.BR INTxINT ,
34where the first INT is the x position and the second INT is the y position.
35.TP
3bec05ea 36.B -w
37Asks the window manager to draw a border around the menus.
71b4db92 38This option may be buggy in some window managers,
39specially tiled ones that do not respect window hints.
3bec05ea 40.PP
08f16589 41Each item read from stdin has the following format:
42.IP
43.EX
33376f54 44ITEM := [TABS] [[IMAGE TABS] LABEL [TABS OUTPUT]] NEWLINE
08f16589 45.EE
46.PP
6b5123e7 47That means that each item is composed by
33376f54 48tabs, followed by an optional image specification, followed by tabs
49followed by a label, followed by more tabs, followed by an output,
6b5123e7 50and ended by a newline. Brackets group optional elements.
08f16589 51.IP
52The initial tabs indicate the menu hierarchy:
53items indented with a tab is shown in a submenu of the preceding item not indented.
6b5123e7 54An item without initial tabs is a top-level item.
08f16589 55.IP
33376f54 56The image is a string of the form "IMG:/path/to/image.png".
57It specifies a image to be shown as icon at the left of the entry.
58.IP
08f16589 59The label is the string that will be shown as a item in the menu.
60An item without label is considered a separator and is drawn as a thin line in the menu
61separating the item above from the item below.
62.IP
6b5123e7 63The output is the string that will be output after selecting the item.
64If an item does not have an output, its label is used as its output.
08f16589 65.IP
66The newline terminates the item specification.
3bec05ea 67.PP
68If the argument
69.I title
70is given, the title of the menu window is set to it.
858338d9 71.SH USAGE
72.B xmenu
73is controlled by the mouse,
74but can also be controlled by the keyboard.
75Items can be selected using the arrow keys,
76Tab (with and without Shift),
77Enter and Esc.
78.TP
79.BR Down ", " Tab
80Cycle through the items in the regular direction.
81.TP
82.BR Up ", " Shift-Tab
83Cycle through the items in the reverse direction.
84.TP
85.BR Right ", " Enter
86Select the highlighted item.
87.TP
88.B Left
89Go to the menu above.
90.TP
91.B Esc
92Go to the menu above or exit xmenu.
f644b8bc 93.SH RESOURCES
94.B
95xmenu
96understands the following X resources.
97.TP
98.B xmenu.font
99The font in which the labels should be drawn.
100.TP
101.B xmenu.background
5a83c7dc 102The background color of non-selected items in the menu.
f644b8bc 103.TP
104.B xmenu.foreground
5a83c7dc 105The color of the label text of non-selected items in the menu.
f644b8bc 106.TP
107.B xmenu.selbackground
5a83c7dc 108The background color of selected items in the menu.
f644b8bc 109.TP
110.B xmenu.selforeground
5a83c7dc 111The color of the label text of selected items in the menu.
f644b8bc 112.TP
113.B xmenu.border
114The color of the border around the menu.
115.TP
116.B xmenu.separator
5a83c7dc 117The color of the separator between items in the menu.
f644b8bc 118.TP
92e7609b 119.B xmenu.gap
120The gap, in pixels, between the menus.
121.TP
f644b8bc 122.B xmenu.width
123The minimum width, in pixels, of the items in the menu.
124.TP
685ca30d 125.B xmenu.height
126The size in pixels of the height of a single menu item.
f644b8bc 127.TP
fd530f3f 128.B xmenu.borderWidth
f644b8bc 129The size in pixels of the border around the menu.
130.TP
fd530f3f 131.B xmenu.separatorWidth
f644b8bc 132The size in pixels of the item separator.
133
08f16589 134.SH EXAMPLES
d584fba6 135The following script illustrates the use of
08f16589 136.BR xmenu .
c49dad28 137The output is redirected to
138.IR sh (1),
139creating a command to be run by the shell.
08f16589 140.IP
141.EX
142#!/bin/sh
143
6b5123e7 144cat <<EOF | xmenu | sh &
08f16589 145Applications
33376f54 146 IMG:./web.png Web Browser firefox
d584fba6 147 IMG:./gimp.png Image editor gimp
33376f54 148Terminal (xterm) xterm
149Terminal (urxvt) urxvt
150Terminal (st) st
08f16589 151
33376f54 152Shutdown poweroff
153Reboot reboot
08f16589 154EOF
155.EE
156.PP
157For example, by selecting \(lqApplications\(rq, a new menu will appear.
d584fba6 158Selecting \(lqWeb Browser\(rq in the new menu opens firefox.
08f16589 159.SH SEE ALSO
160.IR dmenu (1),
161.IR 9menu (1),
162.IR thingmenu (1)