Renaming routine and spliting it into subroutines
[xmenu] / xmenu.1
CommitLineData
08f16589 1.TH PROG 1
2.SH NAME
3xmenu \- menu utility for X
4.SH SYNOPSIS
5.B xmenu
08f16589 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
08f16589 13Each item read from stdin has the following format:
14.IP
15.EX
6b5123e7 16ITEM := [TABS] [LABEL [TABS OUTPUT]] NEWLINE
08f16589 17.EE
18.PP
6b5123e7 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.
08f16589 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.
6b5123e7 25An item without initial tabs is a top-level item.
08f16589 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
6b5123e7 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.
08f16589 33.IP
34The newline terminates the item specification.
858338d9 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.
f644b8bc 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
fd530f3f 86.B xmenu.padding
87The size in pixels of the padding around the label text in items in the menu.
f644b8bc 88.TP
fd530f3f 89.B xmenu.borderWidth
f644b8bc 90The size in pixels of the border around the menu.
91.TP
fd530f3f 92.B xmenu.separatorWidth
f644b8bc 93The size in pixels of the item separator.
94
08f16589 95.SH EXAMPLES
c49dad28 96The following is an script exemplifying the use of
08f16589 97.BR xmenu .
c49dad28 98The output is redirected to
99.IR sh (1),
100creating a command to be run by the shell.
08f16589 101.IP
102.EX
103#!/bin/sh
104
6b5123e7 105cat <<EOF | xmenu | sh &
08f16589 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)