This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
other:dialog_terminal_tui [2021/04/06 02:30] nanodano created |
other:dialog_terminal_tui [2021/04/06 03:38] (current) nanodano [.dialogrc file] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | [[https:// | + | [[https:// |
The official documentation and downloads are at [[https:// | The official documentation and downloads are at [[https:// | ||
+ | More screenshots and examples of all widgets are available at [[https:// | ||
+ | |||
+ | ===== Install ===== | ||
+ | |||
+ | In Debian and most Linux distributions it's as simple as using the package manager to install: | ||
<code bash> | <code bash> | ||
apt install dialog | apt install dialog | ||
+ | dpkg -L dialog | ||
dialog --version | dialog --version | ||
dialog --help | dialog --help | ||
+ | man dialog | ||
</ | </ | ||
- | For example: | + | If you want to build from source, simply download, configure, and make: |
+ | |||
+ | <code bash> | ||
+ | wget ftp:// | ||
+ | tar xzf dialog.tar.gz | ||
+ | cd dialog-1.3-20210324 # Or whatever it is | ||
+ | ./configure --help | less # Check options | ||
+ | ./ | ||
+ | make | ||
+ | ./dialog --version | ||
+ | ./dialog --help | ||
+ | make install | ||
+ | </ | ||
+ | |||
+ | ===== Example usage ===== | ||
+ | |||
+ | Here is an example | ||
<code bash> | <code bash> | ||
Line 22: | Line 45: | ||
</ | </ | ||
- | From [[https:// | + | Here is another |
<code bash> | <code bash> | ||
- | # https:// | + | # Create temp stream for current shell |
- | exec 3>& | + | exec 3>& |
- | result=$(dialog --inputbox | + | |
- | exitcode=$? # Success exit code = 0 | + | # Prompt with dialog and get response |
- | exec 3>& | + | user_text=$(dialog --inputbox |
- | echo $result | + | |
+ | # Store return value of dialog process. 0 = success. | ||
+ | # Check if it's 0 to confirm they didn't cancel | ||
+ | exit_code=$? | ||
+ | |||
+ | # Close the temp stream | ||
+ | exec 3>&- | ||
+ | |||
+ | # Print the results | ||
+ | Echo " | ||
+ | echo "User input: | ||
</ | </ | ||
- | ===== Help output | + | ===== Available options |
+ | |||
+ | Below you will find a list of all the options and menus available. Also refer to [[https:// | ||
- | This is the output of '' | + | There are also numerous script examples in the [[https:// |
< | < | ||
+ | $ dialog --help | ||
+ | |||
cdialog (ComeOn Dialog!) version 1.2-20130523 | cdialog (ComeOn Dialog!) version 1.2-20130523 | ||
Copyright 2000-2012, | Copyright 2000-2012, | ||
Line 102: | Line 139: | ||
Auto-size with height and width = 0. Maximize with height and width = -1. | Auto-size with height and width = 0. Maximize with height and width = -1. | ||
Global-auto-size if also menu_height/ | Global-auto-size if also menu_height/ | ||
+ | </ | ||
+ | |||
+ | ===== .dialogrc file ===== | ||
+ | |||
+ | You can specify settings in a '' | ||
+ | |||
+ | To generate a default rc file, run the following command. | ||
+ | |||
+ | <code bash> | ||
+ | # Create a ~/.dialogrc file | ||
+ | dialog --create-rc ~/.dialogrc | ||
+ | </ | ||
+ | |||
+ | Then you'll have an rc file with all the color and options populated for you to modify. | ||
+ | |||
+ | ==== Change colors === | ||
+ | |||
+ | If you want to see some example rc files, check in the [[https:// | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | Also make sure '' | ||
+ | |||
+ | To override the default rc filename, set a '' | ||
+ | |||
+ | Here is a sample '' | ||
+ | |||
+ | <code text .dialogrc> | ||
+ | # | ||
+ | # Run-time configuration file for dialog | ||
+ | # | ||
+ | # Types of values: | ||
+ | # | ||
+ | # Number | ||
+ | # String | ||
+ | # Boolean | ||
+ | # Attribute | ||
+ | |||
+ | # Set aspect-ration. | ||
+ | aspect = 0 | ||
+ | # Set separator (for multiple widgets output). | ||
+ | separate_widget = "" | ||
+ | # Set tab-length (for textbox tab-conversion). | ||
+ | tab_len = 0 | ||
+ | # Make tab-traversal for checklist, etc., include the list. | ||
+ | visit_items = OFF | ||
+ | # Shadow dialog boxes? This also turns on color. | ||
+ | use_shadow = OFF | ||
+ | # Turn color support ON or OFF | ||
+ | use_colors = ON | ||
+ | screen_color = (CYAN, | ||
+ | shadow_color = (RED, | ||
+ | dialog_color = (CYAN, | ||
+ | title_color = (CYAN, | ||
+ | border_color = (CYAN, | ||
+ | button_active_color = (BLACK, | ||
+ | button_inactive_color = dialog_color | ||
+ | button_key_active_color = button_active_color | ||
+ | button_key_inactive_color = (WHITE, | ||
+ | button_label_active_color = (WHITE, | ||
+ | button_label_inactive_color = (WHITE, | ||
+ | inputbox_color = dialog_color | ||
+ | inputbox_border_color = dialog_color | ||
+ | searchbox_color = dialog_color | ||
+ | searchbox_title_color = title_color | ||
+ | searchbox_border_color = border_color | ||
+ | position_indicator_color = title_color | ||
+ | menubox_color = dialog_color | ||
+ | menubox_border_color = border_color | ||
+ | item_color = dialog_color | ||
+ | item_selected_color = button_active_color | ||
+ | tag_color = title_color | ||
+ | tag_selected_color = button_label_active_color | ||
+ | tag_key_color = button_key_inactive_color | ||
+ | tag_key_selected_color = (CYAN, | ||
+ | check_color = dialog_color | ||
+ | check_selected_color = button_active_color | ||
+ | uarrow_color = (RED, | ||
+ | darrow_color = uarrow_color | ||
+ | itemhelp_color = (WHITE, | ||
+ | form_active_text_color = button_active_color | ||
+ | form_text_color = (WHITE, | ||
+ | form_item_readonly_color = (CYAN, | ||
+ | gauge_color = title_color | ||
+ | border2_color = dialog_color | ||
+ | inputbox_border2_color = dialog_color | ||
+ | searchbox_border2_color = dialog_color | ||
+ | menubox_border2_color = dialog_color | ||
</ | </ |