Moving XSetWMProtocols to setupmenu()
[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
99.B xmenu.width
100The minimum width, in pixels, of the items in the menu.
101.TP
685ca30d 102.B xmenu.height
103The size in pixels of the height of a single menu item.
f644b8bc 104.TP
fd530f3f 105.B xmenu.borderWidth
f644b8bc 106The size in pixels of the border around the menu.
107.TP
fd530f3f 108.B xmenu.separatorWidth
f644b8bc 109The size in pixels of the item separator.
110
08f16589 111.SH EXAMPLES
d584fba6 112The following script illustrates the use of
08f16589 113.BR xmenu .
c49dad28 114The output is redirected to
115.IR sh (1),
116creating a command to be run by the shell.
08f16589 117.IP
118.EX
119#!/bin/sh
120
6b5123e7 121cat <<EOF | xmenu | sh &
08f16589 122Applications
33376f54 123 IMG:./web.png Web Browser firefox
d584fba6 124 IMG:./gimp.png Image editor gimp
33376f54 125Terminal (xterm) xterm
126Terminal (urxvt) urxvt
127Terminal (st) st
08f16589 128
33376f54 129Shutdown poweroff
130Reboot reboot
08f16589 131EOF
132.EE
133.PP
134For example, by selecting \(lqApplications\(rq, a new menu will appear.
d584fba6 135Selecting \(lqWeb Browser\(rq in the new menu opens firefox.
08f16589 136.SH SEE ALSO
137.IR dmenu (1),
138.IR 9menu (1),
139.IR thingmenu (1)