2009-10-10 00:20:23 +04:00
|
|
|
|
.TH "WIMENU" 1 "Oct, 2009" "wmii-@VERSION@"
|
2009-05-14 08:14:24 +04:00
|
|
|
|
|
|
|
|
|
.SH NAME
|
|
|
|
|
.P
|
|
|
|
|
wimenu \- The wmii menu program
|
|
|
|
|
|
|
|
|
|
.SH SYNOPSIS
|
|
|
|
|
.P
|
2009-10-27 04:25:53 +03:00
|
|
|
|
wimenu \fI[\-i]\fR \fI[\-h \fI<history file>\fR]\fR \fI[\-n \fI<history count>\fR]\fR \fI[\-p \fI<prompt>\fR]\fR
|
2009-05-14 08:14:24 +04:00
|
|
|
|
.P
|
|
|
|
|
wimenu \-v
|
|
|
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
|
.P
|
|
|
|
|
\fBwimenu\fR is \fBwmii\fR's standard menu program. It's used
|
|
|
|
|
extensively by \fBwmii\fR and related programs to prompt the user
|
|
|
|
|
for input. The standard configuration uses it to launch
|
|
|
|
|
programs, select views, and perform standard actions. It
|
2009-10-11 14:09:06 +04:00
|
|
|
|
supports basic item completion and history searching.
|
2009-05-14 08:14:24 +04:00
|
|
|
|
|
2009-10-27 04:25:53 +03:00
|
|
|
|
.SH BASIC ARGUMENTS
|
|
|
|
|
.P
|
|
|
|
|
Normal use of \fBwimenu\fR shouldn't require any arguments other than the
|
|
|
|
|
following. More advanced options are documented below.
|
2009-05-14 08:14:24 +04:00
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
\-h \fI<history file>\fR
|
|
|
|
|
Causes \fBwimenu\fR to read its command history from
|
|
|
|
|
\fI<history file>\fR and to append its result to that file if
|
|
|
|
|
\fI\-n\fR is given.
|
|
|
|
|
.TP
|
|
|
|
|
\-i
|
|
|
|
|
Causes matching of completion items to be performed in a
|
|
|
|
|
case insensitive manner.
|
|
|
|
|
.TP
|
2009-10-27 04:25:53 +03:00
|
|
|
|
\-n \fI<count>\fR
|
|
|
|
|
Write at most \fI<count>\fR items back to the history file.
|
|
|
|
|
The file is never modified unless this option is
|
|
|
|
|
provided. Duplicates are filtered out within a 20 item
|
|
|
|
|
sliding window before this limit is imposed.
|
|
|
|
|
.TP
|
|
|
|
|
\-p \fI<prompt>\fR
|
|
|
|
|
The string \fI<prompt>\fR will be show before the input field
|
|
|
|
|
when the menu is opened.
|
2010-10-08 00:31:42 +04:00
|
|
|
|
.TP
|
|
|
|
|
\-r \fI<rows>\fR
|
|
|
|
|
Display completion items as a vertical list, one per
|
|
|
|
|
row, rather than a horizontal list, side\-by\-side. A
|
|
|
|
|
maximum of \fI<rows>\fR rows will be displayed.
|
2009-10-27 04:25:53 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.SH ADVANCED ARGUMENTS
|
|
|
|
|
.TP
|
|
|
|
|
\-a
|
|
|
|
|
The address at which to connect to \fBwmii\fR.
|
|
|
|
|
.TP
|
2009-05-14 08:14:24 +04:00
|
|
|
|
\-K
|
|
|
|
|
Prevents \fBwimenu\fR from initializing its default key
|
|
|
|
|
bindings. WARNING: If you do this, be sure to bind a key
|
2009-10-11 14:09:06 +04:00
|
|
|
|
with the Accept or Reject action, or you will have no way
|
2009-05-14 08:14:24 +04:00
|
|
|
|
to exit \fBwimenu\fR.
|
|
|
|
|
.TP
|
|
|
|
|
\-k \fI<key file>\fR
|
|
|
|
|
Key bindings will be read from \fI<key file>\fR. Bindings
|
|
|
|
|
appear as:
|
|
|
|
|
|
|
|
|
|
\fI<key>\fR \fI[action]\fR \fI[args]\fR
|
|
|
|
|
|
|
|
|
|
where \fI<key>\fR is a key name, similar to the format used by
|
|
|
|
|
wmii. For action and args, please refer to the default
|
|
|
|
|
bindings, provided in the source distribution under
|
|
|
|
|
cmd/menu/keys.txt, or use strings(1) on the \fBwimenu\fR
|
2009-10-11 14:09:06 +04:00
|
|
|
|
executable (this level of customization is reserved for the
|
|
|
|
|
determined).
|
2009-05-14 08:14:24 +04:00
|
|
|
|
.TP
|
|
|
|
|
\-s \fI<screen>\fR
|
2009-10-11 14:09:06 +04:00
|
|
|
|
Suggests that the menu open on Xinerama screen \fI<screen>\fR.
|
2009-10-27 04:25:53 +03:00
|
|
|
|
.TP
|
|
|
|
|
\-S \fI<command separator>\fR
|
|
|
|
|
|
|
|
|
|
.RS
|
|
|
|
|
Causes each input item to be split at the first occurance of
|
|
|
|
|
\fI<command sep>\fR. The text to the left of the separator is displayed
|
|
|
|
|
as a menu option, and the text to the right is displayed when a
|
|
|
|
|
selection is made.
|
|
|
|
|
.RE
|
|
|
|
|
|
2010-10-08 00:31:42 +04:00
|
|
|
|
.SH KEY BINDINGS
|
|
|
|
|
.P
|
|
|
|
|
\fBwimenu\fR's default key bindings are based largely on the
|
|
|
|
|
movement keys of vi and the standard UNIX shell input bindings.
|
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
Return, C\-j, C\-m
|
|
|
|
|
Accept the input, and select the first matching
|
|
|
|
|
completion if the cursor is at the end of the input.
|
|
|
|
|
.TP
|
|
|
|
|
S\-Return, C\-S\-j, C\-S\-m
|
|
|
|
|
Accept the input literally.
|
|
|
|
|
.TP
|
|
|
|
|
Esc, C\-[
|
|
|
|
|
Quit without returning any output, and exit with
|
|
|
|
|
non\-zero status.
|
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
A\-p
|
|
|
|
|
Paste the PRIMARY selection.
|
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
Left, C\-b
|
|
|
|
|
Move backward one character.
|
|
|
|
|
.TP
|
|
|
|
|
Right, C\-f
|
|
|
|
|
Move forward one character.
|
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
A\-b
|
|
|
|
|
Move backward one word.
|
|
|
|
|
.TP
|
|
|
|
|
A\-f
|
|
|
|
|
Move forward one word.
|
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
C\-a
|
|
|
|
|
Move to the begining of the line.
|
|
|
|
|
.TP
|
|
|
|
|
C\-e
|
|
|
|
|
Move to the end of the line.
|
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
C\-p, up
|
|
|
|
|
Move backward through the input history.
|
|
|
|
|
.TP
|
|
|
|
|
C\-n, up
|
|
|
|
|
Move forward through the input history.
|
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
Backspace, C\-h
|
|
|
|
|
Delete the previous character.
|
|
|
|
|
.TP
|
|
|
|
|
C\-Backspace, C\-w
|
|
|
|
|
Delete the previous word.
|
|
|
|
|
.TP
|
|
|
|
|
C\-u
|
|
|
|
|
Delete the previous portion of the line.
|
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
Tab, C\-i¸ A\-l
|
|
|
|
|
Select the next completion.
|
|
|
|
|
.TP
|
|
|
|
|
S\-Tab, C\-S\-i, A\-h
|
|
|
|
|
Select the previous completion.
|
|
|
|
|
.TP
|
|
|
|
|
PageUp, A\-k
|
|
|
|
|
Select the previous completion page.
|
|
|
|
|
.TP
|
|
|
|
|
PageDown, A\-j
|
|
|
|
|
Select the next completion page.
|
|
|
|
|
.TP
|
|
|
|
|
Home, A\-g
|
|
|
|
|
Select the first completion page.
|
|
|
|
|
.TP
|
|
|
|
|
End, A\-S\-g
|
|
|
|
|
Select the last completion page.
|
|
|
|
|
|
2009-10-27 04:25:53 +03:00
|
|
|
|
.SH CUSTOM COMPLETION
|
|
|
|
|
.P
|
|
|
|
|
Custom, multipart completion data may be proveded by an
|
|
|
|
|
external application. When the standard input is not a TTY,
|
|
|
|
|
processing of a set of completions stops at every blank line.
|
|
|
|
|
After the first new line or EOF, \fBwimenu\fR displays the first
|
|
|
|
|
set of menu items, and waits for further input. The completion
|
|
|
|
|
items may be replaced by writing out a new set, again followed
|
|
|
|
|
by a new line. Every set following the first must begin with a
|
|
|
|
|
line containing a single decimal number specifying where the
|
|
|
|
|
new completion results are to be spliced into the input. When
|
|
|
|
|
an item is selected, text from this position to the position
|
|
|
|
|
of the caret is replaced.
|
|
|
|
|
|
|
|
|
|
.SS ARGUMENTS
|
|
|
|
|
.TP
|
|
|
|
|
\-c
|
|
|
|
|
Prints the contents of the input buffer each time the
|
|
|
|
|
user inputs a character, as such:
|
|
|
|
|
|
|
|
|
|
\fI<text before caret>\fR\en\fI<text after caret>\fR\en
|
|
|
|
|
|
2009-10-13 06:07:51 +04:00
|
|
|
|
|
2009-10-27 04:25:53 +03:00
|
|
|
|
.SS EXAMPLE
|
|
|
|
|
.P
|
|
|
|
|
Let's assume that a script would like to provide a menu with
|
|
|
|
|
completions first for a command name, then for arguments
|
|
|
|
|
to that command. Given three commands and argument sets,
|
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
foo
|
|
|
|
|
|
|
|
|
|
.RS
|
|
|
|
|
1, 2, 3
|
|
|
|
|
.RE
|
|
|
|
|
.TP
|
|
|
|
|
bar
|
|
|
|
|
|
|
|
|
|
.RS
|
|
|
|
|
4, 5, 6
|
|
|
|
|
.RE
|
|
|
|
|
.TP
|
|
|
|
|
baz
|
|
|
|
|
|
|
|
|
|
.RS
|
|
|
|
|
7, 8, 9
|
|
|
|
|
.RE
|
|
|
|
|
|
|
|
|
|
.P
|
|
|
|
|
the following script provides the appropriate completions:
|
|
|
|
|
|
|
|
|
|
.nf
|
|
|
|
|
#!/bin/sh -f
|
|
|
|
|
|
|
|
|
|
rm fifo
|
|
|
|
|
mkfifo fifo
|
|
|
|
|
|
|
|
|
|
# Open wimenu with a fifo as its stdin
|
|
|
|
|
wimenu -c <fifo | awk '
|
|
|
|
|
BEGIN {
|
|
|
|
|
# Define the completion results
|
|
|
|
|
cmds = "foo\enbar\enbaz\en"
|
|
|
|
|
cmd\fI["foo"]\fR = "1\en2\en3\en"
|
|
|
|
|
cmd\fI["bar"]\fR = "4\en5\en6\en"
|
|
|
|
|
cmd\fI["baz"]\fR = "7\en8\en9\en"
|
|
|
|
|
|
|
|
|
|
# Print the first set of completions to wimenu’s fifo
|
|
|
|
|
fifo = "fifo"
|
|
|
|
|
print cmds >fifo; fflush(fifo)
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-08 00:31:42 +04:00
|
|
|
|
{ print; fflush() }
|
2009-10-27 04:25:53 +03:00
|
|
|
|
|
|
|
|
|
# Push out a new set of completions
|
|
|
|
|
function update(str, opts) {
|
2009-10-31 00:32:33 +03:00
|
|
|
|
print length(str) >fifo # Print the length of the preceding string
|
|
|
|
|
print opts >fifo # and the options themself
|
2009-10-27 04:25:53 +03:00
|
|
|
|
fflush(fifo)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Ensure correct argument count with trailing spaces
|
|
|
|
|
/ $/ { $0 = $0 "#"; }
|
|
|
|
|
|
|
|
|
|
{ # Process the input and provide the completions
|
|
|
|
|
if (NF == 1)
|
|
|
|
|
update("", cmds) # The first arg, command choices
|
|
|
|
|
else
|
|
|
|
|
update($1 " ", cmd\fI[$1]\fR) # The second arg, command arguments
|
|
|
|
|
# Skip the trailing part of the command
|
|
|
|
|
getline rest
|
|
|
|
|
}
|
2010-10-08 00:31:42 +04:00
|
|
|
|
\&' | tail -1
|
2009-10-27 04:25:53 +03:00
|
|
|
|
.fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.P
|
|
|
|
|
In theory, this facility can be used for myriad purposes,
|
|
|
|
|
including hijacking the programmable completion facilities of
|
2010-10-08 00:31:42 +04:00
|
|
|
|
most shells. See also the provided examples\fI[1]\fR.
|
2009-05-14 08:14:24 +04:00
|
|
|
|
|
|
|
|
|
.SH ENVIRONMENT
|
|
|
|
|
.TP
|
2009-10-13 06:07:51 +04:00
|
|
|
|
\fB$WMII_ADDRESS\fR
|
|
|
|
|
The address at which to connect to wmii.
|
2009-05-14 08:14:24 +04:00
|
|
|
|
.TP
|
2009-10-13 06:07:51 +04:00
|
|
|
|
\fB$NAMESPACE\fR
|
2009-05-14 08:14:24 +04:00
|
|
|
|
The namespace directory to use if no address is
|
|
|
|
|
provided.
|
2009-10-13 06:07:51 +04:00
|
|
|
|
|
2009-05-14 08:14:24 +04:00
|
|
|
|
.SH SEE ALSO
|
|
|
|
|
.P
|
2010-05-27 11:58:02 +04:00
|
|
|
|
wmii(1), wmiir(1), wistrug(1), wmii9menu(1), dmenu(1)
|
2009-05-14 08:14:24 +04:00
|
|
|
|
|
|
|
|
|
.P
|
2010-10-08 00:31:42 +04:00
|
|
|
|
\fI[1]\fR http://www.suckless.org/wiki/wmii/tips/9p_tips
|
|
|
|
|
.P
|
|
|
|
|
\fI[2]\fR @EXAMPLES@
|
2009-05-14 08:14:24 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.\" man code generated by txt2tags 2.5 (http://txt2tags.sf.net)
|
2009-05-27 21:27:08 +04:00
|
|
|
|
.\" cmdline: txt2tags -o- wimenu.man1
|
2009-05-14 08:14:24 +04:00
|
|
|
|
|