1 912fd0cc 2023-05-29 aa .Dd May 29, 2023
9 912fd0cc 2023-05-29 aa .Op Fl font Ar font
10 912fd0cc 2023-05-29 aa .Op Fl bg Ar colour
11 912fd0cc 2023-05-29 aa .Op Fl fg Ar colour
12 912fd0cc 2023-05-29 aa .Op Fl sbg Ar colour
13 912fd0cc 2023-05-29 aa .Op Fl sfg Ar colour
14 912fd0cc 2023-05-29 aa .Op Fl bc Ar colour
15 912fd0cc 2023-05-29 aa .Op Fl bw Ar width
16 912fd0cc 2023-05-29 aa .Op Fl hp Ar pad
17 912fd0cc 2023-05-29 aa .Op Fl vp Ar pad
20 912fd0cc 2023-05-29 aa .Sh DESCRIPTION
23 912fd0cc 2023-05-29 aa draws a menu, based on stdin
24 912fd0cc 2023-05-29 aa (here refer to a later section)
25 912fd0cc 2023-05-29 aa and prints the user's choice to stdout.
26 912fd0cc 2023-05-29 aa The options are as follows:
27 912fd0cc 2023-05-29 aa .Bl -tag -width Ds
28 912fd0cc 2023-05-29 aa .It Fl font Ar font
29 912fd0cc 2023-05-29 aa The font to be used for displaying text.
30 912fd0cc 2023-05-29 aa Corresponds to the resource font.
32 77968eb5 2023-05-29 aa .Dq DejaVu Sans Mono-10 .
33 912fd0cc 2023-05-29 aa .It Fl bg Ar colour
34 912fd0cc 2023-05-29 aa Specifies the normal background colour.
35 912fd0cc 2023-05-29 aa Corresponds to the resource background.
38 912fd0cc 2023-05-29 aa .It Fl fg Ar colour
39 912fd0cc 2023-05-29 aa Specifies the normal foreground colour.
40 912fd0cc 2023-05-29 aa Corresponds to the resource foreground.
43 912fd0cc 2023-05-29 aa .It Fl sbg Ar colour
44 912fd0cc 2023-05-29 aa Specifies the background colour for selected item.
45 912fd0cc 2023-05-29 aa Corresponds to the resource selectedBackground.
48 912fd0cc 2023-05-29 aa .It Fl sfg Ar colour
49 912fd0cc 2023-05-29 aa Specifies the foreground colour for selected item.
50 912fd0cc 2023-05-29 aa Corresponds to the resource selectedForeground.
53 912fd0cc 2023-05-29 aa .It Fl bc Ar colour
54 912fd0cc 2023-05-29 aa Specifies the border colour.
55 912fd0cc 2023-05-29 aa Corresponds to the resource borderColour.
58 912fd0cc 2023-05-29 aa .It Fl bw Ar width
59 912fd0cc 2023-05-29 aa Specifies the border width.
60 912fd0cc 2023-05-29 aa Corresponds to the resource borderWidth.
62 912fd0cc 2023-05-29 aa .It Fl hp Ar pad
63 912fd0cc 2023-05-29 aa Specifies the horizontal padding.
64 912fd0cc 2023-05-29 aa Corresponds to the resource horizontalPadding.
66 912fd0cc 2023-05-29 aa .It Fl vp Ar pad
67 912fd0cc 2023-05-29 aa Specifies the vertical padding.
68 912fd0cc 2023-05-29 aa Corresponds to the resource verticalPadding.
71 912fd0cc 2023-05-29 aa The horizontal position to spawn the window at.
72 912fd0cc 2023-05-29 aa Default corresponds to the horizontal position of the pointer.
74 912fd0cc 2023-05-29 aa The vertical position to spawn the window at.
75 912fd0cc 2023-05-29 aa Default corresponds to the vertical position of the pointer.
78 912fd0cc 2023-05-29 aa The options, which correspond to a resource take precedence over that
82 912fd0cc 2023-05-29 aa reads contents of the menu on stdin.
83 912fd0cc 2023-05-29 aa The input consists of one, or several newline-separated entries (items).
84 912fd0cc 2023-05-29 aa Each entry has the following format:
86 912fd0cc 2023-05-29 aa .Dl ITEM := [KEYS] TAB LABEL
88 912fd0cc 2023-05-29 aa The optional KEYS field consists of one or more space-separated key
89 912fd0cc 2023-05-29 aa strings, such that can be used with
90 912fd0cc 2023-05-29 aa .Xr XStringToKeysym 3 .
91 912fd0cc 2023-05-29 aa Pressing any of these keys immediately select this item.
92 912fd0cc 2023-05-29 aa Keys are configured case-insensitively.
93 912fd0cc 2023-05-29 aa .Ss Key and button bindings
95 912fd0cc 2023-05-29 aa can be intuitively controlled with mouse by bringing the pointer over
96 912fd0cc 2023-05-29 aa the desired item and clicking.
97 912fd0cc 2023-05-29 aa Additional key and button bindings are as follows:
98 912fd0cc 2023-05-29 aa .Bl -tag -width Ds
99 912fd0cc 2023-05-29 aa .It Scroll down , j , down , control-n
100 912fd0cc 2023-05-29 aa Move selection one item down.
101 912fd0cc 2023-05-29 aa .It Scroll up , k , up , control-p
102 912fd0cc 2023-05-29 aa Move selection one item up.
103 912fd0cc 2023-05-29 aa .It Escape , control-c
104 912fd0cc 2023-05-29 aa Quit, outputting nothing.
105 912fd0cc 2023-05-29 aa .It Return , control-m , control-j
106 912fd0cc 2023-05-29 aa Quit, outputting the selected item.
107 912fd0cc 2023-05-29 aa .It Button 1, button 2, button 3
109 912fd0cc 2023-05-29 aa If the pointer is inside the window, output the selected item,
110 912fd0cc 2023-05-29 aa otherwise output nothing.
112 912fd0cc 2023-05-29 aa .Sh RESOURCES
114 912fd0cc 2023-05-29 aa understands the following resources:
115 912fd0cc 2023-05-29 aa .Bl -tag -width Ds
116 912fd0cc 2023-05-29 aa .It Ic xitems.font
117 912fd0cc 2023-05-29 aa Specifies the font to be used for displaying text.
118 912fd0cc 2023-05-29 aa .It Ic xitems.foreground , xitems,background
119 912fd0cc 2023-05-29 aa Specifies the normal foreground and background colours.
120 912fd0cc 2023-05-29 aa .It Ic xitems.selectedForeground , xitems,selectedBackground
121 912fd0cc 2023-05-29 aa Specifies the foreground and background colours for selected items.
122 912fd0cc 2023-05-29 aa .It Ic xitems.borderColour
123 912fd0cc 2023-05-29 aa Specifies the border colour.
124 912fd0cc 2023-05-29 aa .It Ic xitems.borderWidth
125 912fd0cc 2023-05-29 aa Specifies the border width.
126 912fd0cc 2023-05-29 aa .It Ic xitems.verticalPadding , xitems.horizontalPadding
127 912fd0cc 2023-05-29 aa Specifies the vertical and horizontal padding.
130 912fd0cc 2023-05-29 aa The following script displays a menu with items
131 912fd0cc 2023-05-29 aa .Dq Monitor ,
135 912fd0cc 2023-05-29 aa Each can be selected by pressing the key, corresponding to the capital
136 912fd0cc 2023-05-29 aa letter, or the Cyrillic key, sharing the same position.
139 912fd0cc 2023-05-29 aa creates a similar menu, and selecting anything else runs the
140 912fd0cc 2023-05-29 aa corresponding command.
141 912fd0cc 2023-05-29 aa .Bd -literal -offset indent
146 912fd0cc 2023-05-29 aa m Cyrillic_softsign Monitor
147 912fd0cc 2023-05-29 aa t Cyrillic_e xTerm
148 912fd0cc 2023-05-29 aa e Cyrillic_u xCalc
152 912fd0cc 2023-05-29 aa monitormenu() {
154 912fd0cc 2023-05-29 aa b Cyrillic_i xBiff
155 912fd0cc 2023-05-29 aa c Cyrillic_es xConsole
161 912fd0cc 2023-05-29 aa [ -z "$s" ] && exit
163 912fd0cc 2023-05-29 aa if [ "$s" = Monitor ]; then
167 912fd0cc 2023-05-29 aa fi | tr '[A-Z]' '[a-z]' | sh
170 912fd0cc 2023-05-29 aa .An Alexander Arkhipov Aq Mt aa@manpager.net .
171 912fd0cc 2023-05-29 aa .Sh EXIT STATUS