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