.\" -*-nroff-*- .TH xgetline 1 "15 November 1998" "Straylight/Edgeware" "xtoys" .SH NAME xgetline \- request a line of text in an X dialogue box .SH SYNOPSIS .B xgetline .RI [ gtk-options ...] .RB [ -Hin ] .RB [ \- M .IR max ] .RB [ \-d .IR default ] .RB [ \-l .IR file ] .RB [ \-p .IR prompt ] .RB [ \-t .IR title ] .SH DESCRIPTION The .B xgetline program reads a line of text from the user via a pretty GTK dialogue box. The title bar contents, prompt string, and default text are all configurable. If the user enters a string and clicks the .B OK button (or presses .IR enter ), the string is echoed to standard output and .B xgetline returns an exit status of zero. If the user cancels the dialogue box (by closing it, or pressing .IR escape ), .B xgetline echoes nothing and returns an exit status of one. .PP The .B xgetline program is intended to be used in window manager configuration files, to allow users to fill in bits of text (e.g., hostnames or shell commands) in generally useful places. For example, the author has the following shell command attached to a hotkey: .PP .RS 5 .ft B .nf cmd=$(xgetline -t "Shell command in window" -p "_Command:") && xterm -T "$cmd" -e sh -c "$cmd" .ft R .fi .SS Options .TP 5 .B "\-H, \-\-history" With .BR \-l , update the file with the newly entered line at the top. Other lines matching the newly entered string are not written. No effect without .BR \-l . .TP 5 .BI "\-M, \-\-histmax " max When writing an updated history file, do not write more than .I max lines. The default is 20; a value of 0 disables a length limit on the history file. .TP 5 .BI "\-d, \-\-default " default Sets the default text in the entry field to .IR default . The default default is the first item in the empty string. The special default string .RB ` @ ' sets the default to be the first item in the history list, if one is supplied. .TP 5 .B \-i, \-\-invisible Don't echo characters to the screen when they're typed. Useful when requesting passwords and similar secrets. .TP 5 .BI "\-l, \-\-list " file Reads a list of alternatives from .I file and displays them in a drop-down list box. The user can rapidly select an item from the drop-down list using the mouse or cursor keys. The file is not modified (but see the .B \-\-history option below). .TP 5 .B "\-n, \-\-no-choice" One of the items from the selection list must be chosen; the user may not type an entry in directly. .TP 5 .BI "\-p, \-\-prompt " prompt Sets the prompt string in the dialogue box to .IR prompt . If the prompt string contains an underscore character .RB ` _ ', then the following character appears underlined; pressing Alt and the leftmost underlined character (the `mnemonic') moves the input focus to the entry widget. If you want a literal underscore, type two consecutive underscores. The default is to have no prompt string. .TP 5 .BI "\-t, \-\-title " title Sets the title of the dialogue box to .IR title . The default title is .RB ` "Input request" '. .SH BUGS Hopefully none. .SH SEE ALSO .BR gtk-options (7). .SH AUTHOR Mark Wooding (mdw@distorted.org.uk).