summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/dialog/README
blob: 975bdac54b4308bbf6832c954d4540c82cf5cd9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161

          dialog - Display dialog boxes in shell script (version 0.3)
          ===========================================================

This is a program that will enable you to present a variety of questions or
display messages using dialog boxes from a shell script. Currently, these
types of dialog boxes are implemented: yes/no box, menu box, input box,
message box, text box, info box, checklist box. The idea of writing this
program came from the fact that most questions asked in a shell script (and
many interactive programs as well) can be classified into these few types:


    1)  One that requires the user to answer either yes or no.

    2)  One that presents a number of options for the user to choose.

    3)  One that requires the user to input a string.

    4)  One that displays a message and optionally wait for a key press
        before continuing.

    5)  One that presents a list of options that can be turned on or off.


The program 'dialog' can, say for example, be called in a shell script to
present the first type of questions like this:


	if dialog --yesno <question text> <height> <width>
	then
	  ...
	fi


	e.g.  if dialog --yesno "Do you want to continue?" 7 51
	      then
	        echo "Continuing..."
	      else
	        echo "Aborting..."
	      fi


I've included a sample shell script for each type of boxes in the directory
samples. The program requires ncurses to compile. Running 'dialog' without
arguments will display the usage.



FEATURES
--------

	*  Friendly dialog box interface with buttons, etc.

	*  Auto wrap around of question text if it's too long to fit on
	   one line.

        *  "\n" can be inserted in question text to control line breaking
           explicitly. The real newline character '\n' can also be used.

        *  run-time configruation of color settings and other options using
           a configuration file.



WHAT'S NEW SINCE VERSION 0.21?
------------------------------

	*  some changes for faster screen update.

	*  much more flexible color settings. Can use all 16 colors
           (8 normal, 8 highlight) of the Linux console.

	*  added run-time configuration using configuration file.

	*  some minor bug fixes and cleanups for menubox, checklist and
	   textbox.

	*  added a man page.

	*  some changes for easier porting to other Unix systems (tested
           on Ultrix, SunOS and HPUX)



INSTALLATION
------------

	1.  cd ./src

	2.  Go to step 3 if your system has ncurses (e.g. Linux).
	    Edit Makefile and remove -DHAVE_NCURSES from DEFS. Also
            remove rc.c from SRCS and rc.o from OBJS. Change LIBS as
            appropriate (Usually, it should be '-lcurses -ltermcap').
            Go to step 6.

	3.  Edit Makefile and remove -DBROKEN_WSCRL from DEFS if you
            are using ncurses 1.8.3 or newer. Menu scrolling should
            be faster. DON'T REMOVE IT IF YOU ARE NOT USING AT LEAST
            VERSION 1.8.3 OF NCURSES.

        4.  Edit dialog.h and change USE_SHADOW to FALSE if you don't
            want shadowed dialog boxes. Also change USE_COLORS to
            FALSE if you don't want colors. Note that 'dialog' will
            check if the terminal supports colors, and will use mono
            settings if it doesn't, so USE_COLORS won't do any harm
            even if you have a mono display. Also note that USE_SHADOW
            implies USE_COLORS. These two options can be changed at
            run-time using the run-time configuration file (see below).

	5.  Edit colors.h to change default color definitions if you
            don't like the defaults. These are only compiled in defaults,
            you can change them at run-time using the run-time
            configuration file.

	6.  'make depend; make install' will compile and install the
            binaries in /usr/local/bin (change BINDIR in Makefile if
            you want to install elsewhere).

        7.  'make install.man' will install the man page to
            /usr/local/man (change MANDIR in Makefile if you want to
            install elsewhere).

        8.  You can then try the sample shell scripts in the samples
            directory (make sure the environment variable DIALOG is
            not set, the scripts use it to find the dialog binary, if
            it's not set, "../src/dialog" will be used).

	9.  Don't forget to mail me (mail address at end of this file)
            if you find any bugs, have some good color settings to
            contribute or just want to tell me that you like it, Don't
            mail me if you don't like it :-)



RUN-TIME CONFIGURATION
----------------------

	1.  Create a sample configuration file by typing:

                "dialog --create-rc <file>"

        2.  At start, 'dialog' determines the settings to use as follows:

              a)  if environment variable DIALOGRC is set, it's value
                  determines the name of the configuration file.

              b)  if the file in (a) can't be found, use the file
                  $HOME/.dialogrc as the configuration file.

              c)  if the file in (b) can't be found, use compiled in
                  defaults.

	3.  Edit the sample configuration file and copy it to some place
            that 'dialog' can find, as stated in step 2 above.




Comments and bug reports welcome.

- Savio Lam (lam836@cs.cuhk.hk)
OpenPOWER on IntegriCloud