This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
other:dialog_terminal_tui [2021/04/06 02:44] nanodano |
other:dialog_terminal_tui [2021/04/06 03:38] (current) nanodano [.dialogrc file] |
||
---|---|---|---|
Line 5: | Line 5: | ||
The official documentation and downloads are at [[https:// | The official documentation and downloads are at [[https:// | ||
- | More screenshots and examples are available at [[https:// | + | More screenshots and examples |
===== Install ===== | ===== Install ===== | ||
Line 13: | Line 13: | ||
<code bash> | <code bash> | ||
apt install dialog | apt install dialog | ||
+ | dpkg -L dialog | ||
dialog --version | dialog --version | ||
dialog --help | dialog --help | ||
+ | man dialog | ||
</ | </ | ||
Line 43: | Line 45: | ||
</ | </ | ||
- | Here is another example that shows how to get output a different way. The answer comes from [[https:// | + | Here is another example that shows how to get output a different way. This is out it is done in the examples in the source code. |
<code bash> | <code bash> | ||
- | # https:// | ||
- | |||
# Create temp stream for current shell | # Create temp stream for current shell | ||
exec 3>& | exec 3>& | ||
# Prompt with dialog and get response | # Prompt with dialog and get response | ||
- | result=$(dialog --inputbox | + | user_text=$(dialog --inputbox |
- | # Store return | + | # Store return |
# Check if it's 0 to confirm they didn't cancel | # Check if it's 0 to confirm they didn't cancel | ||
- | exitcode=$? | + | exit_code=$? |
# Close the temp stream | # Close the temp stream | ||
Line 62: | Line 62: | ||
# Print the results | # Print the results | ||
- | echo $result | + | Echo " |
+ | echo "User input: | ||
</ | </ | ||
===== Available options ===== | ===== Available options ===== | ||
- | Below you will find a list of all the options and menus available. Also refer to [[https:// | + | Below you will find a list of all the options and menus available. Also refer to [[https:// |
+ | |||
+ | There are also numerous script examples in the [[https:// | ||
< | < | ||
Line 136: | 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 | ||
</ | </ |