Moving XSetWMProtocols to setupmenu()
[xmenu] / xmenu.1
... / ...
CommitLineData
1.TH XMENU 1
2.SH NAME
3xmenu \- menu utility for X
4.SH SYNOPSIS
5.B xmenu
6.RB [ \-w ]
7.RI [ title ]
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
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
21Each item read from stdin has the following format:
22.IP
23.EX
24ITEM := [TABS] [[IMAGE TABS] LABEL [TABS OUTPUT]] NEWLINE
25.EE
26.PP
27That means that each item is composed by
28tabs, followed by an optional image specification, followed by tabs
29followed by a label, followed by more tabs, followed by an output,
30and ended by a newline. Brackets group optional elements.
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.
34An item without initial tabs is a top-level item.
35.IP
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
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
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.
45.IP
46The newline terminates the item specification.
47.PP
48If the argument
49.I title
50is given, the title of the menu window is set to it.
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.
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
82The background color of non-selected items in the menu.
83.TP
84.B xmenu.foreground
85The color of the label text of non-selected items in the menu.
86.TP
87.B xmenu.selbackground
88The background color of selected items in the menu.
89.TP
90.B xmenu.selforeground
91The color of the label text of selected items in the menu.
92.TP
93.B xmenu.border
94The color of the border around the menu.
95.TP
96.B xmenu.separator
97The color of the separator between items in the menu.
98.TP
99.B xmenu.width
100The minimum width, in pixels, of the items in the menu.
101.TP
102.B xmenu.height
103The size in pixels of the height of a single menu item.
104.TP
105.B xmenu.borderWidth
106The size in pixels of the border around the menu.
107.TP
108.B xmenu.separatorWidth
109The size in pixels of the item separator.
110
111.SH EXAMPLES
112The following script illustrates the use of
113.BR xmenu .
114The output is redirected to
115.IR sh (1),
116creating a command to be run by the shell.
117.IP
118.EX
119#!/bin/sh
120
121cat <<EOF | xmenu | sh &
122Applications
123 IMG:./web.png Web Browser firefox
124 IMG:./gimp.png Image editor gimp
125Terminal (xterm) xterm
126Terminal (urxvt) urxvt
127Terminal (st) st
128
129Shutdown poweroff
130Reboot reboot
131EOF
132.EE
133.PP
134For example, by selecting \(lqApplications\(rq, a new menu will appear.
135Selecting \(lqWeb Browser\(rq in the new menu opens firefox.
136.SH SEE ALSO
137.IR dmenu (1),
138.IR 9menu (1),
139.IR thingmenu (1)