Yet another patchlevel.
[xtoys] / xgetline.1
CommitLineData
90b2c5d4 1.TH xgetline 1 "15 November 1998" "Edgeware tools"
2.SH NAME
3xgetline \- request a line of text in an X dialogue box
4.SH SYNOPSIS
5.B xgetline
0a47c222 6.RB [ -in ]
90b2c5d4 7.RB [ \-t
8.IR title ]
9.RB [ \-p
10.IR prompt ]
11.RB [ \-d
12.IR default ]
0a47c222 13.RB [ \-l | \-H
14.IR file ]
15.RB [ \- m
16.IR max ]
90b2c5d4 17.SH DESCRIPTION
18The
19.B xgetline
20program reads a line of text from the user via a pretty GTK dialogue
21box. The title bar contents, prompt string, and default text are all
22configurable. If the user enters a string and clicks the
23.B OK
24button (or
25presses
26.IR enter ),
27the string is echoed to standard output and
28.B xgetline
29returns an exit status of zero. If the user cancels the dialogue box
30(by closing it, or pressing
31.IR escape ),
32.B xgetline
33echoes nothing and returns an exit status of one.
34.PP
35The
36.B xgetline
37program is intended to be used in window manager configuration files, to
38allow users to fill in bits of text (e.g., hostnames or shell commands)
39in generally useful places. For example, the author has the following
40shell command attached to a hotkey:
41.PP
42.RS 5
43.ft B
44.nf
45cmd=`xgetline -t "Shell command in window" -p "Command:"` &&
46 xterm -T "$cmd" -e sh -c "$cmd"
47.ft R
48.fi
49.SS OPTIONS
50.TP 5
f3b35b6b 51.B \-i, \-\-invisible
52Don't echo characters to the screen when they're typed. Useful when
53requesting passwords and similar secrets.
54.TP 5
90b2c5d4 55.BI "\-t, \-\-title " title
56Sets the title of the dialogue box to
57.IR title .
58The default title is
59.RB ` "Input request" '.
60.TP 5
61.BI "\-p, \-\-prompt " prompt
62Sets the prompt string in the dialogue box to
63.IR prompt .
64The default is to have no prompt string.
65.TP 5
66.BI "\-d, \-\-default " default
67Sets the default text in the entry field to
68.IR default .
0a47c222 69The default default is the first item in the empty string. The special
70default string
71.RB ` @ '
72sets the default to be the first item in the history list, if one is
73supplied.
74.TP 5
75.BI "\-l, \-\-list " file
76Reads a list of alternatives from
77.I file
78and displays them in a drop-down list box. The user can rapidly select
79an item from the drop-down list using the mouse or cursor keys. The
80file is not modified (but see the
81.B \-\-history
82option below).
83.TP 5
84.B "\-n, \-\-no-choice"
85One of the items from the selection list must be chosen; the user may
86not type an entry in directly.
87.TP 5
88.BI "\-H, \-\-history " file
89Reads a file and displays the contents in a drop-down list, as for
90.B \-\-list
91above. Once the user has entered a string, a new list written to
92.I file
93containing the newly entered string as the first item; other lines
94matching the newly entered string are not written.
95.TP 5
96.BI "\-m, \-\-histmax " max
97When writing an updated history file, do not write more than
98.I max
99lines. The default is 20; a value of 0 disables a length limit on the
100history file.
90b2c5d4 101.SH AUTHOR
102Mark Wooding (mdw@nsict.org).
103.SH BUGS
104Hopefully none.