Dialog - использование диалогов в shell-скриптах

Материал из rrv-wiki
Перейти к навигации Перейти к поиску

Для упрощения интерфейса пользователя у скрипта в консоли, можно воспользоваться утилитой dialog, позволяющей отрисовывать диалоговые окна в консоли. Аналогично утилите kdialog, с той лишь разницей, что kdialog отрисовывает окна в Х-ах.

Использование аналогично описанному в статье "Использование_диалоговых_окон_KDE_в_shell-скриптах".

За примерами можно зайти сюда или на русском сюда.

Использование: dialog <options> { --and-widget <options> } where options are "common" options, followed by "box" options

Special options:

  • [--create-rc "file"]

Common options:

  • [--aspect <ratio>] [--backtitle <backtitle>] [--begin <y> <x>]
  • [--cancel-label <str>] [--clear] [--colors] [--cr-wrap]
  • [--default-item <str>] [--defaultno] [--exit-label <str>]
  • [--extra-button] [--extra-label <str>] [--help-button]
  • [--help-label <str>] [--help-status] [--ignore] [--input-fd <fd>]
  • [--insecure] [--item-help] [--keep-window] [--max-input <n>]
  • [--no-cancel] [--no-collapse] [--no-kill] [--no-label <str>]
  • [--no-shadow] [--ok-label <str>] [--output-fd <fd>] [--print-maxsize]
  • [--print-size] [--print-version] [--separate-output]
  • [--separate-widget <str>] [--shadow] [--single-quoted] [--size-err]
  • [--sleep <secs>] [--stderr] [--stdout] [--tab-correct] [--tab-len <n>]
  • [--timeout <secs>] [--title <title>] [--trim] [--visit-items]
  • [--version] [--yes-label <str>]

Box options:

  • --calendar <text> <height> <width> <day> <month> <year>
  • --checklist <text> <height> <width> <list height> <tag1> <item1> <status1>...
  • --form <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1>...
  • --fselect <filepath> <height> <width>
  • --gauge <text> <height> <width> [<percent>]
  • --infobox <text> <height> <width>
  • --inputbox <text> <height> <width> [<init>]
  • --inputmenu <text> <height> <width> <menu height> <tag1> <item1>...
  • --menu <text> <height> <width> <menu height> <tag1> <item1>...
  • --msgbox <text> <height> <width>
  • --passwordbox <text> <height> <width> [<init>]
  • --pause <text> <height> <width> <seconds>
  • --radiolist <text> <height> <width> <list height> <tag1> <item1> <status1>...
  • --tailbox <file> <height> <width>
  • --tailboxbg <file> <height> <width>
  • --textbox <file> <height> <width>
  • --timebox <text> <height> <width> <hour> <minute> <second>
  • --yesno <text> <height> <width>