Renaming routine and spliting it into subroutines
[xmenu] / xmenu.1
... / ...
CommitLineData
1.TH PROG 1
2.SH NAME
3xmenu \- menu utility for X
4.SH SYNOPSIS
5.B xmenu
6.SH DESCRIPTION
7.B xmenu
8is a menu for X,
9it reads a list of newline-separated items from stdin,
10shows a menu for the user to select one of the items,
11and outputs the item selected to stdout.
12.PP
13Each item read from stdin has the following format:
14.IP
15.EX
16ITEM := [TABS] [LABEL [TABS OUTPUT]] NEWLINE
17.EE
18.PP
19That means that each item is composed by
20tabs, followed by a label, followed by more tabs, followed by an output,
21and ended by a newline. Brackets group optional elements.
22.IP
23The initial tabs indicate the menu hierarchy:
24items indented with a tab is shown in a submenu of the preceding item not indented.
25An item without initial tabs is a top-level item.
26.IP
27The label is the string that will be shown as a item in the menu.
28An item without label is considered a separator and is drawn as a thin line in the menu
29separating the item above from the item below.
30.IP
31The output is the string that will be output after selecting the item.
32If an item does not have an output, its label is used as its output.
33.IP
34The newline terminates the item specification.
35.SH USAGE
36.B xmenu
37is controlled by the mouse,
38but can also be controlled by the keyboard.
39Items can be selected using the arrow keys,
40Tab (with and without Shift),
41Enter and Esc.
42.TP
43.BR Down ", " Tab
44Cycle through the items in the regular direction.
45.TP
46.BR Up ", " Shift-Tab
47Cycle through the items in the reverse direction.
48.TP
49.BR Right ", " Enter
50Select the highlighted item.
51.TP
52.B Left
53Go to the menu above.
54.TP
55.B Esc
56Go to the menu above or exit xmenu.
57.SH RESOURCES
58.B
59xmenu
60understands the following X resources.
61.TP
62.B xmenu.font
63The font in which the labels should be drawn.
64.TP
65.B xmenu.background
66The background color of non-selected itens in the menu.
67.TP
68.B xmenu.foreground
69The color of the label text of non-selected itens in the menu.
70.TP
71.B xmenu.selbackground
72The background color of selected itens in the menu.
73.TP
74.B xmenu.selforeground
75The color of the label text of selected itens in the menu.
76.TP
77.B xmenu.border
78The color of the border around the menu.
79.TP
80.B xmenu.separator
81The color of the separator between itens in the menu.
82.TP
83.B xmenu.width
84The minimum width, in pixels, of the items in the menu.
85.TP
86.B xmenu.padding
87The size in pixels of the padding around the label text in items in the menu.
88.TP
89.B xmenu.borderWidth
90The size in pixels of the border around the menu.
91.TP
92.B xmenu.separatorWidth
93The size in pixels of the item separator.
94
95.SH EXAMPLES
96The following is an script exemplifying the use of
97.BR xmenu .
98The output is redirected to
99.IR sh (1),
100creating a command to be run by the shell.
101.IP
102.EX
103#!/bin/sh
104
105cat <<EOF | xmenu | sh &
106Applications
107 Web Browser firefox
108 Image editor gimp
109Terminal (xterm) xterm
110Terminal (urxvt) urxvt
111Terminal (st) st
112
113Shutdown poweroff
114Reboot reboot
115EOF
116.EE
117.PP
118For example, by selecting \(lqApplications\(rq, a new menu will appear.
119Selecting \(lqWeb Browser\(rq in the new menu will open firefox.
120.SH SEE ALSO
121.IR dmenu (1),
122.IR 9menu (1),
123.IR thingmenu (1)