WIMENU(1)
π NAME π
hey bestie, meet wimenu(1) from the General Commands Manual β the wmii menu program β¨ Sheβs wmiiβs standard menu program, and she gets used extensively by wmii and related programs to prompt the user for input. The standard configuration uses her to launch programs, select views, and perform standard actions. She supports basic item completion and history searching, and honestly? iconic behavior π
β¨ SYNOPSIS β¨
wimenu [-i] [-h <history file>] [-n <history count>] [-p <prompt>]
wimenu -v
π¦ DESCRIPTION π¦
okay so wimenu is the standard menu program for wmii β like the main-character menu popup of the whole vibe πΈ wmii and related programs use it all over the place to ask the user for input. The standard setup uses it to launch programs, pick views, and do standard actions. It also does basic item completion and history searching, which is lowkey essential π«Ά
π BASIC ARGUMENTS π
Normal use of wimenu shouldnβt need any arguments besides these cuties. The more advanced options are documented below, so donβt stress π
-h <history file>β tellswimenuto read her command history from<history file>, and to append her result to that file if-nis given. bestie said memory π-iβ makes matching of completion items case insensitive. no cap, lowercase and uppercase can both slay β¨-n <count>β writes at most<count>items back to the history file. The file is never modified unless this option is provided. Duplicates get filtered out within a20item sliding window before this limit is imposed. yes,20, she said what she said π-p <prompt>β the string<prompt>will be shown before the input field when the menu is opened. itβs giving βhello, gorgeousβ π-r <rows>β displays completion items as a vertical list, one per row, instead of a horizontal list side-by-side. A maximum of<rows>rows will be displayed. vertical era π₯
π ADVANCED ARGUMENTS π
-aβ the address at which to connect to wmii.-Kβ preventswimenufrom initializing her default key bindings.
β οΈ WARNING: if you do this, be sure to bind a key with theAcceptorRejectaction, or you will have no way to exitwimenu. not me trapping you in the menu π please bind an exit key, bestie.
-k <key file>β key bindings will be read from<key file>. Bindings appear as:
<key> [action] [args]
where <key> 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 wimenu executable. this level of customization is reserved for the determined, iykyk π
-s <screen>β suggests that the menu open on Xinerama screen<screen>.-S <command separator>β causes each input item to be split at the first occurance of<command sep>. 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. left side main character, right side reveal β¨
π§ KEY BINDINGS π§
wimenuβs default key bindings are based largely on the movement keys of vi and the standard UNIX shell input bindings. old-school but make it cute π
Return,C-j,C-mβ accept the input, and select the first matching completion if the cursor is at the end of the input.S-Return,C-S-j,C-S-mβ accept the input literally.Esc,C-[β quit without returning any output, and exit with non-zero status. dramatic exit, periodt πA-pβ paste thePRIMARYselection.Left,C-bβ move backward one character.Right,C-fβ move forward one character.A-bβ move backward one word.A-fβ move forward one word.C-aβ move to the beginning of the line.C-eβ move to the end of the line.C-p,Upβ move backward through the input history.C-n,Downβ move forward through the input history.Backspace,C-hβ delete the previous character.C-Backspace,C-wβ delete the previous word.C-uβ delete the previous portion of the line.Tab,C-iΒΈ A-lβ select the next completion.S-Tab,C-S-i,A-hβ select the previous completion.PageUp,A-kβ select the previous completion page.PageDown,A-jβ select the next completion page.Home,A-gβ select the first completion page.End,A-S-gβ select the last completion page.
π CUSTOM COMPLETION π
Custom, multipart completion data may be proveded by an external application β yes, βproveded,β the manual said it, we respect the typo π 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, wimenu 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. caret girlies rise π
πΈ ARGUMENTS πΈ
-cβ prints the contents of the input buffer each time the user inputs a character, as such:
<text before caret>\n<text after caret>\n
π¦ EXAMPLE π¦
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,
foo1,2,3
bar4,5,6
baz7,8,9
the following script provides the appropriate completions:
#!/nix/store/7kydial85yfip25hh4zlcq6qm43z4d33-dash-0.5.13.3/bin/dash -f
rm fifo
mkfifo fifo
# Open wimenu with a fifo as its stdin
wimenu -c <fifo | awk '
BEGIN {
# Define the completion results
cmds = "foo\nbar\nbaz\n"
cmd["foo"] = "1\n2\n3\n"
cmd["bar"] = "4\n5\n6\n"
cmd["baz"] = "7\n8\n9\n"
# Print the first set of completions to wimenuβs fifo
fifo = "fifo"
print cmds >fifo; fflush(fifo)
}
{ print; fflush() }
# Push out a new set of completions
function update(str, opts) {
print length(str) >fifo # Print the length of the preceding string
print opts >fifo # and the options themself
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[$1]) # The second arg, command arguments
# Skip the trailing part of the command
getline rest
}
' | tail -1
In theory, this facility can be used for myriad purposes, including hijacking the programmable completion facilities of most shells. See also the provided examples[1] πβ¨
π ENVIRONMENT π
$WMII_ADDRESSβ the address at which to connect to wmii.$NAMESPACEβ the namespace directory to use if no address is provided.
β SEE ALSO β
wmii(1),wmiir(1),wistrug(1),wmii9menu(1),dmenu(1)[1]http://www.suckless.org/wiki/wmii/tips/9p_tips[2]/nix/store/slssan5bnbckq9395sb3rjcrds2k5h1v-wmii-0-unstable-2023-09-30/share/doc/wmii/examples
mwah π β this little icon is from wmii-, dated Oct, 2009, and the manual page is WIMENU(1), periodt ππ
π¦ where this page comes from
- nixos 26.05: wmii 0-unstable-2023-09-30
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms