How do I create a terminal-based GUI?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
45
down vote

favorite
24












I'm looking to create a terminal-based environment to adapt my Bash script into. I want it to look like this:



Debian install










share|improve this question



















  • 4




    Look into dialog, which is what this appears to use.
    – DopeGhoti
    May 26 '16 at 21:39










  • See also my older question Why doesn't dialog display the menu (but accepts acceptance) when started through a command substitution expression?
    – Î± CVn
    May 27 '16 at 13:35











  • I think a terminal-based GUI is a TUI (which is different from CLI).
    – UniversallyUniqueID
    May 28 '16 at 6:21










  • "tui" is a RH term IIRC. whiptail > dialog also
    – Bratchley
    May 28 '16 at 14:45










  • @Bratchley: GDB also uses tui for its split-window mode (showing registers, source, and commands with layout reg for example, and tui reg vec to show vector registers in the reg window (in a not-flexible way, so that part's not really useful :/). IDK if Redhat wrote the patch that added that feature, or even how old it is.
    – Peter Cordes
    May 29 '16 at 4:21















up vote
45
down vote

favorite
24












I'm looking to create a terminal-based environment to adapt my Bash script into. I want it to look like this:



Debian install










share|improve this question



















  • 4




    Look into dialog, which is what this appears to use.
    – DopeGhoti
    May 26 '16 at 21:39










  • See also my older question Why doesn't dialog display the menu (but accepts acceptance) when started through a command substitution expression?
    – Î± CVn
    May 27 '16 at 13:35











  • I think a terminal-based GUI is a TUI (which is different from CLI).
    – UniversallyUniqueID
    May 28 '16 at 6:21










  • "tui" is a RH term IIRC. whiptail > dialog also
    – Bratchley
    May 28 '16 at 14:45










  • @Bratchley: GDB also uses tui for its split-window mode (showing registers, source, and commands with layout reg for example, and tui reg vec to show vector registers in the reg window (in a not-flexible way, so that part's not really useful :/). IDK if Redhat wrote the patch that added that feature, or even how old it is.
    – Peter Cordes
    May 29 '16 at 4:21













up vote
45
down vote

favorite
24









up vote
45
down vote

favorite
24






24





I'm looking to create a terminal-based environment to adapt my Bash script into. I want it to look like this:



Debian install










share|improve this question















I'm looking to create a terminal-based environment to adapt my Bash script into. I want it to look like this:



Debian install







terminal text-user-interface






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 28 '16 at 14:43









Peter Mortensen

84658




84658










asked May 26 '16 at 21:33









tempforFind Me In The Woods

328134




328134







  • 4




    Look into dialog, which is what this appears to use.
    – DopeGhoti
    May 26 '16 at 21:39










  • See also my older question Why doesn't dialog display the menu (but accepts acceptance) when started through a command substitution expression?
    – Î± CVn
    May 27 '16 at 13:35











  • I think a terminal-based GUI is a TUI (which is different from CLI).
    – UniversallyUniqueID
    May 28 '16 at 6:21










  • "tui" is a RH term IIRC. whiptail > dialog also
    – Bratchley
    May 28 '16 at 14:45










  • @Bratchley: GDB also uses tui for its split-window mode (showing registers, source, and commands with layout reg for example, and tui reg vec to show vector registers in the reg window (in a not-flexible way, so that part's not really useful :/). IDK if Redhat wrote the patch that added that feature, or even how old it is.
    – Peter Cordes
    May 29 '16 at 4:21













  • 4




    Look into dialog, which is what this appears to use.
    – DopeGhoti
    May 26 '16 at 21:39










  • See also my older question Why doesn't dialog display the menu (but accepts acceptance) when started through a command substitution expression?
    – Î± CVn
    May 27 '16 at 13:35











  • I think a terminal-based GUI is a TUI (which is different from CLI).
    – UniversallyUniqueID
    May 28 '16 at 6:21










  • "tui" is a RH term IIRC. whiptail > dialog also
    – Bratchley
    May 28 '16 at 14:45










  • @Bratchley: GDB also uses tui for its split-window mode (showing registers, source, and commands with layout reg for example, and tui reg vec to show vector registers in the reg window (in a not-flexible way, so that part's not really useful :/). IDK if Redhat wrote the patch that added that feature, or even how old it is.
    – Peter Cordes
    May 29 '16 at 4:21








4




4




Look into dialog, which is what this appears to use.
– DopeGhoti
May 26 '16 at 21:39




Look into dialog, which is what this appears to use.
– DopeGhoti
May 26 '16 at 21:39












See also my older question Why doesn't dialog display the menu (but accepts acceptance) when started through a command substitution expression?
– Î± CVn
May 27 '16 at 13:35





See also my older question Why doesn't dialog display the menu (but accepts acceptance) when started through a command substitution expression?
– Î± CVn
May 27 '16 at 13:35













I think a terminal-based GUI is a TUI (which is different from CLI).
– UniversallyUniqueID
May 28 '16 at 6:21




I think a terminal-based GUI is a TUI (which is different from CLI).
– UniversallyUniqueID
May 28 '16 at 6:21












"tui" is a RH term IIRC. whiptail > dialog also
– Bratchley
May 28 '16 at 14:45




"tui" is a RH term IIRC. whiptail > dialog also
– Bratchley
May 28 '16 at 14:45












@Bratchley: GDB also uses tui for its split-window mode (showing registers, source, and commands with layout reg for example, and tui reg vec to show vector registers in the reg window (in a not-flexible way, so that part's not really useful :/). IDK if Redhat wrote the patch that added that feature, or even how old it is.
– Peter Cordes
May 29 '16 at 4:21





@Bratchley: GDB also uses tui for its split-window mode (showing registers, source, and commands with layout reg for example, and tui reg vec to show vector registers in the reg window (in a not-flexible way, so that part's not really useful :/). IDK if Redhat wrote the patch that added that feature, or even how old it is.
– Peter Cordes
May 29 '16 at 4:21











4 Answers
4






active

oldest

votes

















up vote
40
down vote



accepted










dialog --backtitle "Package configuration" 
--title "Configuration sun-java-jre"
--yesno "nBla bla bla...nnDo you accept?" 10 30


enter image description here



The user response is stored in the exit code, so can be printed as usual: echo $? (note that 0 means "yes", and 1 is "no" in the shell world).




Concerning other questions from the comment section:




  • to put into the dialog box the output from some command just use command substitution mechanism $(), eg:



     dialog --backtitle "$(echo abc)" --title "$(cat file)" ...


  • to give user multiple choices you can use --menu option instead of --yesno



  • to store the output of the user choice into variable one needs to use --stdout option or change output descriptor either via --output-fd or manually, e.g.:



    output=$(dialog --backtitle "Package configuration" 
    --title "Configuration sun-java-jre"
    --menu "$(parted -l)" 15 40 4 1 "sda1" 2 "sda2" 3 "sda3"
    3>&1 1>&2 2>&3 3>&-)
    echo "$output"


    This trick is needed because dialog by default outputs to stderr, not stdout.



And as always, man dialog is your friend.






share|improve this answer






















  • thats beautiful "Bla bla bla..." but how do you capture the output?
    – tempforFind Me In The Woods
    May 26 '16 at 23:17






  • 1




    @tempforFindMeInTheWoods if by output you mean exit code, then just as usuall: it is stored inside ? variable, try echo $?.
    – jimmij
    May 26 '16 at 23:21







  • 1




    @tempforFindMeInTheWoods If you want to present output of the command parted -l to the user via dialog box then probably option --menu is a better choice instead of -yesno. In such case you would have to play a bit with descriptors to store output into the variable, for example: output=$(dialog --backtitle "Package configuration" --title "Configuration sun-java-jre" --menu "$(parted -l)" 15 40 4 1 "sda1" 2 "sda2" 3 "sda3" 3>&1 1>&2 2>&3 3>&-); echo $output
    – jimmij
    May 27 '16 at 0:29







  • 3




    Or, you could use the --stdout option.
    – Thomas Dickey
    May 27 '16 at 0:45






  • 2




    All dialog options are explained in the manual: man dialog
    – Ferrybig
    May 27 '16 at 8:48

















up vote
34
down vote













The screenshot in the question looks like whiptail (a functionally-reduced program imitating dialog, using newt rather than ncurses). The way the title and buttons are rendered is built into each program, making them look different.



Here is a script which duplicates the original screenshot, for either whiptail or dialog:



#!/bin/sh
: $DIALOG:=dialog
case "$DIALOG" in
*dialog*)
OPTS="$OPTS --cr-wrap"
high=10
;;
*whiptail*)
high=12
;;
esac
rows=$(stty size | cut -d' ' -f1)
[ -z "$rows" ] && rows=$high
[ $rows -gt $high ] && rows=$high
cols=$(stty size | cut -d' ' -f2)
$DIALOG --backtitle "Package configuration"
--title "Configuring sun-java6-jre"
$OPTS
--yesno 'nIn order to install this package, you must accept the license terms, the "Operating System Distributor License for Java" (DLJ), v1.1. Not accepting will cancel the installation.nnDo you accept the DLJ license terms?' $rows $((cols - 5))


and for comparison, screenshot with whiptail:



screenshot with whiptail



and with dialog:



screenshot with dialog



Besides the different appearance of the title and buttons, dialog uses different colors by default (though that is configurable—see screenshots), and it uses fewer lines on the screen.



dialog (and whiptail) use libraries for managing the display of lines, colors, etc. But you may also see newt used in Red Hat anaconda program as a shared library called from python (with the same appearance). Along the same lines, the kernel configuration program started as a (cut-down) copy of dialog, and then evolved into features using a shared library (without the original lxdialog program) much like the way newt is used from python.



From bash — you could use either dialog or whiptail for the most commonly-used features. Someone wrote a wrapper for those (in perl) to allow scripts to more readily use either those or a few others, but you're better off using dialog directly since the perl module is essentially common-denominator.



The dialog sources include examples of all of the widgets along with most of the command-line options:



cdialog (ComeOn Dialog!) version 1.3-20160424
Copyright 2000-2015,2016 Thomas E. Dickey
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

* Display dialog boxes from shell scripts *

Usage: cdialog <options> --and-widget <options>
where options are "common" options, followed by "box" options

Special options:
[--create-rc "file"]
Common options:
[--ascii-lines] [--aspect <ratio>] [--backtitle <backtitle>] [--beep]
[--beep-after] [--begin <y> <x>] [--cancel-label <str>] [--clear]
[--colors] [--column-separator <str>] [--cr-wrap] [--date-format <str>]
[--default-button <str>] [--default-item <str>] [--defaultno]
[--exit-label <str>] [--extra-button] [--extra-label <str>]
[--help-button] [--help-label <str>] [--help-status] [--help-tags]
[--hfile <str>] [--hline <str>] [--ignore] [--input-fd <fd>]
[--insecure] [--item-help] [--keep-tite] [--keep-window] [--last-key]
[--max-input <n>] [--no-cancel] [--no-collapse] [--no-cr-wrap]
[--no-items] [--no-kill] [--no-label <str>] [--no-lines] [--no-mouse]
[--no-nl-expand] [--no-ok] [--no-shadow] [--no-tags] [--nook]
[--ok-label <str>] [--output-fd <fd>] [--output-separator <str>]
[--print-maxsize] [--print-size] [--print-version] [--quoted]
[--scrollbar] [--separate-output] [--separate-widget <str>] [--shadow]
[--single-quoted] [--size-err] [--sleep <secs>] [--stderr] [--stdout]
[--tab-correct] [--tab-len <n>] [--time-format <str>] [--timeout <secs>]
[--title <title>] [--trace <file>] [--trim] [--version] [--visit-items]
[--week-start <str>] [--yes-label <str>]
Box options:
--buildlist <text> <height> <width> <list-height> <tag1> <item1> <status1>...
--calendar <text> <height> <width> <day> <month> <year>
--checklist <text> <height> <width> <list height> <tag1> <item1> <status1>...
--dselect <directory> <height> <width>
--editbox <file> <height> <width>
--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>...
--mixedform <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1> <itype>...
--mixedgauge <text> <height> <width> <percent> <tag1> <item1>...
--msgbox <text> <height> <width>
--passwordbox <text> <height> <width> [<init>]
--passwordform <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1>...
--pause <text> <height> <width> <seconds>
--prgbox <text> <command> <height> <width>
--programbox <text> <height> <width>
--progressbox <text> <height> <width>
--radiolist <text> <height> <width> <list height> <tag1> <item1> <status1>...
--rangebox <text> <height> <width> <min-value> <max-value> <default-value>
--tailbox <file> <height> <width>
--tailboxbg <file> <height> <width>
--textbox <file> <height> <width>
--timebox <text> <height> <width> <hour> <minute> <second>
--treeview <text> <height> <width> <list-height> <tag1> <item1> <status1> <depth1>...
--yesno <text> <height> <width>

Auto-size with height and width = 0. Maximize with height and width = -1.
Global-auto-size if also menu_height/list_height = 0.


Further reading:



  • dialog

  • ncurses

  • Anaconda/Features/NoLoader

  • How to create GUIs (such as menuconfig) with lxdialog





share|improve this answer





























    up vote
    11
    down vote













    I believe the package you are looking for is ncurses.



    Wikipedia describes ncurses as follows:




    ncurses (new curses) is a programming library providing an API that
    allows the programmer to write text-based user interfaces in a
    terminal-independent manner. It is a toolkit for developing "GUI-like"
    application software that runs under a terminal emulator




    It is widely used, for example, in the menuconfig kernel configuration tool:
    Screen shot of Linux kernel menuconfig tool



    Since you are using bash, you can use Bash Simple Curses (as mentioned by Runium in the comment below).






    share|improve this answer


















    • 11




      ncurses is a C-library. (If I understand correctly) OP wants a scripting environment (for bash). menuconfig is written in C. As an alternative to dialog, as per other answer, you could perhaps mention Bash Simple Curses which is written in bash (relying on tput).
      – Runium
      May 26 '16 at 22:23











    • @Runium: Thanks for the clarification and the link to Bash Simple Curses.
      – Thawn
      May 27 '16 at 6:09






    • 2




      still, it was useful to mention that ncurses is the basis of this, and it answers a more general version of the question... like the one in the title here :)
      – underscore_d
      May 28 '16 at 18:49

















    up vote
    0
    down vote













    zenity



    # var means variable

    var
    =$(
    zenity --entry
    --title="title"
    --text="text"
    --entry-text="entry text"
    )
    &&
    echo "$var"


    .



    # ls is a command to list files in a directory

    ls $(zenity --file-selection --directory)


    zenity dialog entry with options



    password=$(zenity --password)


    zenity --password)



    file="$(zenity --file-selection)"


    zenity --file-selection



    zenity --help


    zenity --help result



    zenity --help-general 


    zenity --help-general result



    zenity --help-entry


    zenity --help-entry result



    other graphical user interfaces (gui)



    dialog


    dialog



    dialog 
    --backtitle "backtitle"
    --title "title"
    --yesno
    "bla bla bla...nn Do you accept?"
    0 -1
    echo $?


    stops further execution of the script





    share




















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f285777%2fhow-do-i-create-a-terminal-based-gui%23new-answer', 'question_page');

      );

      Post as a guest






























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      40
      down vote



      accepted










      dialog --backtitle "Package configuration" 
      --title "Configuration sun-java-jre"
      --yesno "nBla bla bla...nnDo you accept?" 10 30


      enter image description here



      The user response is stored in the exit code, so can be printed as usual: echo $? (note that 0 means "yes", and 1 is "no" in the shell world).




      Concerning other questions from the comment section:




      • to put into the dialog box the output from some command just use command substitution mechanism $(), eg:



         dialog --backtitle "$(echo abc)" --title "$(cat file)" ...


      • to give user multiple choices you can use --menu option instead of --yesno



      • to store the output of the user choice into variable one needs to use --stdout option or change output descriptor either via --output-fd or manually, e.g.:



        output=$(dialog --backtitle "Package configuration" 
        --title "Configuration sun-java-jre"
        --menu "$(parted -l)" 15 40 4 1 "sda1" 2 "sda2" 3 "sda3"
        3>&1 1>&2 2>&3 3>&-)
        echo "$output"


        This trick is needed because dialog by default outputs to stderr, not stdout.



      And as always, man dialog is your friend.






      share|improve this answer






















      • thats beautiful "Bla bla bla..." but how do you capture the output?
        – tempforFind Me In The Woods
        May 26 '16 at 23:17






      • 1




        @tempforFindMeInTheWoods if by output you mean exit code, then just as usuall: it is stored inside ? variable, try echo $?.
        – jimmij
        May 26 '16 at 23:21







      • 1




        @tempforFindMeInTheWoods If you want to present output of the command parted -l to the user via dialog box then probably option --menu is a better choice instead of -yesno. In such case you would have to play a bit with descriptors to store output into the variable, for example: output=$(dialog --backtitle "Package configuration" --title "Configuration sun-java-jre" --menu "$(parted -l)" 15 40 4 1 "sda1" 2 "sda2" 3 "sda3" 3>&1 1>&2 2>&3 3>&-); echo $output
        – jimmij
        May 27 '16 at 0:29







      • 3




        Or, you could use the --stdout option.
        – Thomas Dickey
        May 27 '16 at 0:45






      • 2




        All dialog options are explained in the manual: man dialog
        – Ferrybig
        May 27 '16 at 8:48














      up vote
      40
      down vote



      accepted










      dialog --backtitle "Package configuration" 
      --title "Configuration sun-java-jre"
      --yesno "nBla bla bla...nnDo you accept?" 10 30


      enter image description here



      The user response is stored in the exit code, so can be printed as usual: echo $? (note that 0 means "yes", and 1 is "no" in the shell world).




      Concerning other questions from the comment section:




      • to put into the dialog box the output from some command just use command substitution mechanism $(), eg:



         dialog --backtitle "$(echo abc)" --title "$(cat file)" ...


      • to give user multiple choices you can use --menu option instead of --yesno



      • to store the output of the user choice into variable one needs to use --stdout option or change output descriptor either via --output-fd or manually, e.g.:



        output=$(dialog --backtitle "Package configuration" 
        --title "Configuration sun-java-jre"
        --menu "$(parted -l)" 15 40 4 1 "sda1" 2 "sda2" 3 "sda3"
        3>&1 1>&2 2>&3 3>&-)
        echo "$output"


        This trick is needed because dialog by default outputs to stderr, not stdout.



      And as always, man dialog is your friend.






      share|improve this answer






















      • thats beautiful "Bla bla bla..." but how do you capture the output?
        – tempforFind Me In The Woods
        May 26 '16 at 23:17






      • 1




        @tempforFindMeInTheWoods if by output you mean exit code, then just as usuall: it is stored inside ? variable, try echo $?.
        – jimmij
        May 26 '16 at 23:21







      • 1




        @tempforFindMeInTheWoods If you want to present output of the command parted -l to the user via dialog box then probably option --menu is a better choice instead of -yesno. In such case you would have to play a bit with descriptors to store output into the variable, for example: output=$(dialog --backtitle "Package configuration" --title "Configuration sun-java-jre" --menu "$(parted -l)" 15 40 4 1 "sda1" 2 "sda2" 3 "sda3" 3>&1 1>&2 2>&3 3>&-); echo $output
        – jimmij
        May 27 '16 at 0:29







      • 3




        Or, you could use the --stdout option.
        – Thomas Dickey
        May 27 '16 at 0:45






      • 2




        All dialog options are explained in the manual: man dialog
        – Ferrybig
        May 27 '16 at 8:48












      up vote
      40
      down vote



      accepted







      up vote
      40
      down vote



      accepted






      dialog --backtitle "Package configuration" 
      --title "Configuration sun-java-jre"
      --yesno "nBla bla bla...nnDo you accept?" 10 30


      enter image description here



      The user response is stored in the exit code, so can be printed as usual: echo $? (note that 0 means "yes", and 1 is "no" in the shell world).




      Concerning other questions from the comment section:




      • to put into the dialog box the output from some command just use command substitution mechanism $(), eg:



         dialog --backtitle "$(echo abc)" --title "$(cat file)" ...


      • to give user multiple choices you can use --menu option instead of --yesno



      • to store the output of the user choice into variable one needs to use --stdout option or change output descriptor either via --output-fd or manually, e.g.:



        output=$(dialog --backtitle "Package configuration" 
        --title "Configuration sun-java-jre"
        --menu "$(parted -l)" 15 40 4 1 "sda1" 2 "sda2" 3 "sda3"
        3>&1 1>&2 2>&3 3>&-)
        echo "$output"


        This trick is needed because dialog by default outputs to stderr, not stdout.



      And as always, man dialog is your friend.






      share|improve this answer














      dialog --backtitle "Package configuration" 
      --title "Configuration sun-java-jre"
      --yesno "nBla bla bla...nnDo you accept?" 10 30


      enter image description here



      The user response is stored in the exit code, so can be printed as usual: echo $? (note that 0 means "yes", and 1 is "no" in the shell world).




      Concerning other questions from the comment section:




      • to put into the dialog box the output from some command just use command substitution mechanism $(), eg:



         dialog --backtitle "$(echo abc)" --title "$(cat file)" ...


      • to give user multiple choices you can use --menu option instead of --yesno



      • to store the output of the user choice into variable one needs to use --stdout option or change output descriptor either via --output-fd or manually, e.g.:



        output=$(dialog --backtitle "Package configuration" 
        --title "Configuration sun-java-jre"
        --menu "$(parted -l)" 15 40 4 1 "sda1" 2 "sda2" 3 "sda3"
        3>&1 1>&2 2>&3 3>&-)
        echo "$output"


        This trick is needed because dialog by default outputs to stderr, not stdout.



      And as always, man dialog is your friend.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Nov 17 '17 at 23:01

























      answered May 26 '16 at 21:49









      jimmij

      29.7k867102




      29.7k867102











      • thats beautiful "Bla bla bla..." but how do you capture the output?
        – tempforFind Me In The Woods
        May 26 '16 at 23:17






      • 1




        @tempforFindMeInTheWoods if by output you mean exit code, then just as usuall: it is stored inside ? variable, try echo $?.
        – jimmij
        May 26 '16 at 23:21







      • 1




        @tempforFindMeInTheWoods If you want to present output of the command parted -l to the user via dialog box then probably option --menu is a better choice instead of -yesno. In such case you would have to play a bit with descriptors to store output into the variable, for example: output=$(dialog --backtitle "Package configuration" --title "Configuration sun-java-jre" --menu "$(parted -l)" 15 40 4 1 "sda1" 2 "sda2" 3 "sda3" 3>&1 1>&2 2>&3 3>&-); echo $output
        – jimmij
        May 27 '16 at 0:29







      • 3




        Or, you could use the --stdout option.
        – Thomas Dickey
        May 27 '16 at 0:45






      • 2




        All dialog options are explained in the manual: man dialog
        – Ferrybig
        May 27 '16 at 8:48
















      • thats beautiful "Bla bla bla..." but how do you capture the output?
        – tempforFind Me In The Woods
        May 26 '16 at 23:17






      • 1




        @tempforFindMeInTheWoods if by output you mean exit code, then just as usuall: it is stored inside ? variable, try echo $?.
        – jimmij
        May 26 '16 at 23:21







      • 1




        @tempforFindMeInTheWoods If you want to present output of the command parted -l to the user via dialog box then probably option --menu is a better choice instead of -yesno. In such case you would have to play a bit with descriptors to store output into the variable, for example: output=$(dialog --backtitle "Package configuration" --title "Configuration sun-java-jre" --menu "$(parted -l)" 15 40 4 1 "sda1" 2 "sda2" 3 "sda3" 3>&1 1>&2 2>&3 3>&-); echo $output
        – jimmij
        May 27 '16 at 0:29







      • 3




        Or, you could use the --stdout option.
        – Thomas Dickey
        May 27 '16 at 0:45






      • 2




        All dialog options are explained in the manual: man dialog
        – Ferrybig
        May 27 '16 at 8:48















      thats beautiful "Bla bla bla..." but how do you capture the output?
      – tempforFind Me In The Woods
      May 26 '16 at 23:17




      thats beautiful "Bla bla bla..." but how do you capture the output?
      – tempforFind Me In The Woods
      May 26 '16 at 23:17




      1




      1




      @tempforFindMeInTheWoods if by output you mean exit code, then just as usuall: it is stored inside ? variable, try echo $?.
      – jimmij
      May 26 '16 at 23:21





      @tempforFindMeInTheWoods if by output you mean exit code, then just as usuall: it is stored inside ? variable, try echo $?.
      – jimmij
      May 26 '16 at 23:21





      1




      1




      @tempforFindMeInTheWoods If you want to present output of the command parted -l to the user via dialog box then probably option --menu is a better choice instead of -yesno. In such case you would have to play a bit with descriptors to store output into the variable, for example: output=$(dialog --backtitle "Package configuration" --title "Configuration sun-java-jre" --menu "$(parted -l)" 15 40 4 1 "sda1" 2 "sda2" 3 "sda3" 3>&1 1>&2 2>&3 3>&-); echo $output
      – jimmij
      May 27 '16 at 0:29





      @tempforFindMeInTheWoods If you want to present output of the command parted -l to the user via dialog box then probably option --menu is a better choice instead of -yesno. In such case you would have to play a bit with descriptors to store output into the variable, for example: output=$(dialog --backtitle "Package configuration" --title "Configuration sun-java-jre" --menu "$(parted -l)" 15 40 4 1 "sda1" 2 "sda2" 3 "sda3" 3>&1 1>&2 2>&3 3>&-); echo $output
      – jimmij
      May 27 '16 at 0:29





      3




      3




      Or, you could use the --stdout option.
      – Thomas Dickey
      May 27 '16 at 0:45




      Or, you could use the --stdout option.
      – Thomas Dickey
      May 27 '16 at 0:45




      2




      2




      All dialog options are explained in the manual: man dialog
      – Ferrybig
      May 27 '16 at 8:48




      All dialog options are explained in the manual: man dialog
      – Ferrybig
      May 27 '16 at 8:48












      up vote
      34
      down vote













      The screenshot in the question looks like whiptail (a functionally-reduced program imitating dialog, using newt rather than ncurses). The way the title and buttons are rendered is built into each program, making them look different.



      Here is a script which duplicates the original screenshot, for either whiptail or dialog:



      #!/bin/sh
      : $DIALOG:=dialog
      case "$DIALOG" in
      *dialog*)
      OPTS="$OPTS --cr-wrap"
      high=10
      ;;
      *whiptail*)
      high=12
      ;;
      esac
      rows=$(stty size | cut -d' ' -f1)
      [ -z "$rows" ] && rows=$high
      [ $rows -gt $high ] && rows=$high
      cols=$(stty size | cut -d' ' -f2)
      $DIALOG --backtitle "Package configuration"
      --title "Configuring sun-java6-jre"
      $OPTS
      --yesno 'nIn order to install this package, you must accept the license terms, the "Operating System Distributor License for Java" (DLJ), v1.1. Not accepting will cancel the installation.nnDo you accept the DLJ license terms?' $rows $((cols - 5))


      and for comparison, screenshot with whiptail:



      screenshot with whiptail



      and with dialog:



      screenshot with dialog



      Besides the different appearance of the title and buttons, dialog uses different colors by default (though that is configurable—see screenshots), and it uses fewer lines on the screen.



      dialog (and whiptail) use libraries for managing the display of lines, colors, etc. But you may also see newt used in Red Hat anaconda program as a shared library called from python (with the same appearance). Along the same lines, the kernel configuration program started as a (cut-down) copy of dialog, and then evolved into features using a shared library (without the original lxdialog program) much like the way newt is used from python.



      From bash — you could use either dialog or whiptail for the most commonly-used features. Someone wrote a wrapper for those (in perl) to allow scripts to more readily use either those or a few others, but you're better off using dialog directly since the perl module is essentially common-denominator.



      The dialog sources include examples of all of the widgets along with most of the command-line options:



      cdialog (ComeOn Dialog!) version 1.3-20160424
      Copyright 2000-2015,2016 Thomas E. Dickey
      This is free software; see the source for copying conditions. There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

      * Display dialog boxes from shell scripts *

      Usage: cdialog <options> --and-widget <options>
      where options are "common" options, followed by "box" options

      Special options:
      [--create-rc "file"]
      Common options:
      [--ascii-lines] [--aspect <ratio>] [--backtitle <backtitle>] [--beep]
      [--beep-after] [--begin <y> <x>] [--cancel-label <str>] [--clear]
      [--colors] [--column-separator <str>] [--cr-wrap] [--date-format <str>]
      [--default-button <str>] [--default-item <str>] [--defaultno]
      [--exit-label <str>] [--extra-button] [--extra-label <str>]
      [--help-button] [--help-label <str>] [--help-status] [--help-tags]
      [--hfile <str>] [--hline <str>] [--ignore] [--input-fd <fd>]
      [--insecure] [--item-help] [--keep-tite] [--keep-window] [--last-key]
      [--max-input <n>] [--no-cancel] [--no-collapse] [--no-cr-wrap]
      [--no-items] [--no-kill] [--no-label <str>] [--no-lines] [--no-mouse]
      [--no-nl-expand] [--no-ok] [--no-shadow] [--no-tags] [--nook]
      [--ok-label <str>] [--output-fd <fd>] [--output-separator <str>]
      [--print-maxsize] [--print-size] [--print-version] [--quoted]
      [--scrollbar] [--separate-output] [--separate-widget <str>] [--shadow]
      [--single-quoted] [--size-err] [--sleep <secs>] [--stderr] [--stdout]
      [--tab-correct] [--tab-len <n>] [--time-format <str>] [--timeout <secs>]
      [--title <title>] [--trace <file>] [--trim] [--version] [--visit-items]
      [--week-start <str>] [--yes-label <str>]
      Box options:
      --buildlist <text> <height> <width> <list-height> <tag1> <item1> <status1>...
      --calendar <text> <height> <width> <day> <month> <year>
      --checklist <text> <height> <width> <list height> <tag1> <item1> <status1>...
      --dselect <directory> <height> <width>
      --editbox <file> <height> <width>
      --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>...
      --mixedform <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1> <itype>...
      --mixedgauge <text> <height> <width> <percent> <tag1> <item1>...
      --msgbox <text> <height> <width>
      --passwordbox <text> <height> <width> [<init>]
      --passwordform <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1>...
      --pause <text> <height> <width> <seconds>
      --prgbox <text> <command> <height> <width>
      --programbox <text> <height> <width>
      --progressbox <text> <height> <width>
      --radiolist <text> <height> <width> <list height> <tag1> <item1> <status1>...
      --rangebox <text> <height> <width> <min-value> <max-value> <default-value>
      --tailbox <file> <height> <width>
      --tailboxbg <file> <height> <width>
      --textbox <file> <height> <width>
      --timebox <text> <height> <width> <hour> <minute> <second>
      --treeview <text> <height> <width> <list-height> <tag1> <item1> <status1> <depth1>...
      --yesno <text> <height> <width>

      Auto-size with height and width = 0. Maximize with height and width = -1.
      Global-auto-size if also menu_height/list_height = 0.


      Further reading:



      • dialog

      • ncurses

      • Anaconda/Features/NoLoader

      • How to create GUIs (such as menuconfig) with lxdialog





      share|improve this answer


























        up vote
        34
        down vote













        The screenshot in the question looks like whiptail (a functionally-reduced program imitating dialog, using newt rather than ncurses). The way the title and buttons are rendered is built into each program, making them look different.



        Here is a script which duplicates the original screenshot, for either whiptail or dialog:



        #!/bin/sh
        : $DIALOG:=dialog
        case "$DIALOG" in
        *dialog*)
        OPTS="$OPTS --cr-wrap"
        high=10
        ;;
        *whiptail*)
        high=12
        ;;
        esac
        rows=$(stty size | cut -d' ' -f1)
        [ -z "$rows" ] && rows=$high
        [ $rows -gt $high ] && rows=$high
        cols=$(stty size | cut -d' ' -f2)
        $DIALOG --backtitle "Package configuration"
        --title "Configuring sun-java6-jre"
        $OPTS
        --yesno 'nIn order to install this package, you must accept the license terms, the "Operating System Distributor License for Java" (DLJ), v1.1. Not accepting will cancel the installation.nnDo you accept the DLJ license terms?' $rows $((cols - 5))


        and for comparison, screenshot with whiptail:



        screenshot with whiptail



        and with dialog:



        screenshot with dialog



        Besides the different appearance of the title and buttons, dialog uses different colors by default (though that is configurable—see screenshots), and it uses fewer lines on the screen.



        dialog (and whiptail) use libraries for managing the display of lines, colors, etc. But you may also see newt used in Red Hat anaconda program as a shared library called from python (with the same appearance). Along the same lines, the kernel configuration program started as a (cut-down) copy of dialog, and then evolved into features using a shared library (without the original lxdialog program) much like the way newt is used from python.



        From bash — you could use either dialog or whiptail for the most commonly-used features. Someone wrote a wrapper for those (in perl) to allow scripts to more readily use either those or a few others, but you're better off using dialog directly since the perl module is essentially common-denominator.



        The dialog sources include examples of all of the widgets along with most of the command-line options:



        cdialog (ComeOn Dialog!) version 1.3-20160424
        Copyright 2000-2015,2016 Thomas E. Dickey
        This is free software; see the source for copying conditions. There is NO
        warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

        * Display dialog boxes from shell scripts *

        Usage: cdialog <options> --and-widget <options>
        where options are "common" options, followed by "box" options

        Special options:
        [--create-rc "file"]
        Common options:
        [--ascii-lines] [--aspect <ratio>] [--backtitle <backtitle>] [--beep]
        [--beep-after] [--begin <y> <x>] [--cancel-label <str>] [--clear]
        [--colors] [--column-separator <str>] [--cr-wrap] [--date-format <str>]
        [--default-button <str>] [--default-item <str>] [--defaultno]
        [--exit-label <str>] [--extra-button] [--extra-label <str>]
        [--help-button] [--help-label <str>] [--help-status] [--help-tags]
        [--hfile <str>] [--hline <str>] [--ignore] [--input-fd <fd>]
        [--insecure] [--item-help] [--keep-tite] [--keep-window] [--last-key]
        [--max-input <n>] [--no-cancel] [--no-collapse] [--no-cr-wrap]
        [--no-items] [--no-kill] [--no-label <str>] [--no-lines] [--no-mouse]
        [--no-nl-expand] [--no-ok] [--no-shadow] [--no-tags] [--nook]
        [--ok-label <str>] [--output-fd <fd>] [--output-separator <str>]
        [--print-maxsize] [--print-size] [--print-version] [--quoted]
        [--scrollbar] [--separate-output] [--separate-widget <str>] [--shadow]
        [--single-quoted] [--size-err] [--sleep <secs>] [--stderr] [--stdout]
        [--tab-correct] [--tab-len <n>] [--time-format <str>] [--timeout <secs>]
        [--title <title>] [--trace <file>] [--trim] [--version] [--visit-items]
        [--week-start <str>] [--yes-label <str>]
        Box options:
        --buildlist <text> <height> <width> <list-height> <tag1> <item1> <status1>...
        --calendar <text> <height> <width> <day> <month> <year>
        --checklist <text> <height> <width> <list height> <tag1> <item1> <status1>...
        --dselect <directory> <height> <width>
        --editbox <file> <height> <width>
        --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>...
        --mixedform <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1> <itype>...
        --mixedgauge <text> <height> <width> <percent> <tag1> <item1>...
        --msgbox <text> <height> <width>
        --passwordbox <text> <height> <width> [<init>]
        --passwordform <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1>...
        --pause <text> <height> <width> <seconds>
        --prgbox <text> <command> <height> <width>
        --programbox <text> <height> <width>
        --progressbox <text> <height> <width>
        --radiolist <text> <height> <width> <list height> <tag1> <item1> <status1>...
        --rangebox <text> <height> <width> <min-value> <max-value> <default-value>
        --tailbox <file> <height> <width>
        --tailboxbg <file> <height> <width>
        --textbox <file> <height> <width>
        --timebox <text> <height> <width> <hour> <minute> <second>
        --treeview <text> <height> <width> <list-height> <tag1> <item1> <status1> <depth1>...
        --yesno <text> <height> <width>

        Auto-size with height and width = 0. Maximize with height and width = -1.
        Global-auto-size if also menu_height/list_height = 0.


        Further reading:



        • dialog

        • ncurses

        • Anaconda/Features/NoLoader

        • How to create GUIs (such as menuconfig) with lxdialog





        share|improve this answer
























          up vote
          34
          down vote










          up vote
          34
          down vote









          The screenshot in the question looks like whiptail (a functionally-reduced program imitating dialog, using newt rather than ncurses). The way the title and buttons are rendered is built into each program, making them look different.



          Here is a script which duplicates the original screenshot, for either whiptail or dialog:



          #!/bin/sh
          : $DIALOG:=dialog
          case "$DIALOG" in
          *dialog*)
          OPTS="$OPTS --cr-wrap"
          high=10
          ;;
          *whiptail*)
          high=12
          ;;
          esac
          rows=$(stty size | cut -d' ' -f1)
          [ -z "$rows" ] && rows=$high
          [ $rows -gt $high ] && rows=$high
          cols=$(stty size | cut -d' ' -f2)
          $DIALOG --backtitle "Package configuration"
          --title "Configuring sun-java6-jre"
          $OPTS
          --yesno 'nIn order to install this package, you must accept the license terms, the "Operating System Distributor License for Java" (DLJ), v1.1. Not accepting will cancel the installation.nnDo you accept the DLJ license terms?' $rows $((cols - 5))


          and for comparison, screenshot with whiptail:



          screenshot with whiptail



          and with dialog:



          screenshot with dialog



          Besides the different appearance of the title and buttons, dialog uses different colors by default (though that is configurable—see screenshots), and it uses fewer lines on the screen.



          dialog (and whiptail) use libraries for managing the display of lines, colors, etc. But you may also see newt used in Red Hat anaconda program as a shared library called from python (with the same appearance). Along the same lines, the kernel configuration program started as a (cut-down) copy of dialog, and then evolved into features using a shared library (without the original lxdialog program) much like the way newt is used from python.



          From bash — you could use either dialog or whiptail for the most commonly-used features. Someone wrote a wrapper for those (in perl) to allow scripts to more readily use either those or a few others, but you're better off using dialog directly since the perl module is essentially common-denominator.



          The dialog sources include examples of all of the widgets along with most of the command-line options:



          cdialog (ComeOn Dialog!) version 1.3-20160424
          Copyright 2000-2015,2016 Thomas E. Dickey
          This is free software; see the source for copying conditions. There is NO
          warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

          * Display dialog boxes from shell scripts *

          Usage: cdialog <options> --and-widget <options>
          where options are "common" options, followed by "box" options

          Special options:
          [--create-rc "file"]
          Common options:
          [--ascii-lines] [--aspect <ratio>] [--backtitle <backtitle>] [--beep]
          [--beep-after] [--begin <y> <x>] [--cancel-label <str>] [--clear]
          [--colors] [--column-separator <str>] [--cr-wrap] [--date-format <str>]
          [--default-button <str>] [--default-item <str>] [--defaultno]
          [--exit-label <str>] [--extra-button] [--extra-label <str>]
          [--help-button] [--help-label <str>] [--help-status] [--help-tags]
          [--hfile <str>] [--hline <str>] [--ignore] [--input-fd <fd>]
          [--insecure] [--item-help] [--keep-tite] [--keep-window] [--last-key]
          [--max-input <n>] [--no-cancel] [--no-collapse] [--no-cr-wrap]
          [--no-items] [--no-kill] [--no-label <str>] [--no-lines] [--no-mouse]
          [--no-nl-expand] [--no-ok] [--no-shadow] [--no-tags] [--nook]
          [--ok-label <str>] [--output-fd <fd>] [--output-separator <str>]
          [--print-maxsize] [--print-size] [--print-version] [--quoted]
          [--scrollbar] [--separate-output] [--separate-widget <str>] [--shadow]
          [--single-quoted] [--size-err] [--sleep <secs>] [--stderr] [--stdout]
          [--tab-correct] [--tab-len <n>] [--time-format <str>] [--timeout <secs>]
          [--title <title>] [--trace <file>] [--trim] [--version] [--visit-items]
          [--week-start <str>] [--yes-label <str>]
          Box options:
          --buildlist <text> <height> <width> <list-height> <tag1> <item1> <status1>...
          --calendar <text> <height> <width> <day> <month> <year>
          --checklist <text> <height> <width> <list height> <tag1> <item1> <status1>...
          --dselect <directory> <height> <width>
          --editbox <file> <height> <width>
          --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>...
          --mixedform <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1> <itype>...
          --mixedgauge <text> <height> <width> <percent> <tag1> <item1>...
          --msgbox <text> <height> <width>
          --passwordbox <text> <height> <width> [<init>]
          --passwordform <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1>...
          --pause <text> <height> <width> <seconds>
          --prgbox <text> <command> <height> <width>
          --programbox <text> <height> <width>
          --progressbox <text> <height> <width>
          --radiolist <text> <height> <width> <list height> <tag1> <item1> <status1>...
          --rangebox <text> <height> <width> <min-value> <max-value> <default-value>
          --tailbox <file> <height> <width>
          --tailboxbg <file> <height> <width>
          --textbox <file> <height> <width>
          --timebox <text> <height> <width> <hour> <minute> <second>
          --treeview <text> <height> <width> <list-height> <tag1> <item1> <status1> <depth1>...
          --yesno <text> <height> <width>

          Auto-size with height and width = 0. Maximize with height and width = -1.
          Global-auto-size if also menu_height/list_height = 0.


          Further reading:



          • dialog

          • ncurses

          • Anaconda/Features/NoLoader

          • How to create GUIs (such as menuconfig) with lxdialog





          share|improve this answer














          The screenshot in the question looks like whiptail (a functionally-reduced program imitating dialog, using newt rather than ncurses). The way the title and buttons are rendered is built into each program, making them look different.



          Here is a script which duplicates the original screenshot, for either whiptail or dialog:



          #!/bin/sh
          : $DIALOG:=dialog
          case "$DIALOG" in
          *dialog*)
          OPTS="$OPTS --cr-wrap"
          high=10
          ;;
          *whiptail*)
          high=12
          ;;
          esac
          rows=$(stty size | cut -d' ' -f1)
          [ -z "$rows" ] && rows=$high
          [ $rows -gt $high ] && rows=$high
          cols=$(stty size | cut -d' ' -f2)
          $DIALOG --backtitle "Package configuration"
          --title "Configuring sun-java6-jre"
          $OPTS
          --yesno 'nIn order to install this package, you must accept the license terms, the "Operating System Distributor License for Java" (DLJ), v1.1. Not accepting will cancel the installation.nnDo you accept the DLJ license terms?' $rows $((cols - 5))


          and for comparison, screenshot with whiptail:



          screenshot with whiptail



          and with dialog:



          screenshot with dialog



          Besides the different appearance of the title and buttons, dialog uses different colors by default (though that is configurable—see screenshots), and it uses fewer lines on the screen.



          dialog (and whiptail) use libraries for managing the display of lines, colors, etc. But you may also see newt used in Red Hat anaconda program as a shared library called from python (with the same appearance). Along the same lines, the kernel configuration program started as a (cut-down) copy of dialog, and then evolved into features using a shared library (without the original lxdialog program) much like the way newt is used from python.



          From bash — you could use either dialog or whiptail for the most commonly-used features. Someone wrote a wrapper for those (in perl) to allow scripts to more readily use either those or a few others, but you're better off using dialog directly since the perl module is essentially common-denominator.



          The dialog sources include examples of all of the widgets along with most of the command-line options:



          cdialog (ComeOn Dialog!) version 1.3-20160424
          Copyright 2000-2015,2016 Thomas E. Dickey
          This is free software; see the source for copying conditions. There is NO
          warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

          * Display dialog boxes from shell scripts *

          Usage: cdialog <options> --and-widget <options>
          where options are "common" options, followed by "box" options

          Special options:
          [--create-rc "file"]
          Common options:
          [--ascii-lines] [--aspect <ratio>] [--backtitle <backtitle>] [--beep]
          [--beep-after] [--begin <y> <x>] [--cancel-label <str>] [--clear]
          [--colors] [--column-separator <str>] [--cr-wrap] [--date-format <str>]
          [--default-button <str>] [--default-item <str>] [--defaultno]
          [--exit-label <str>] [--extra-button] [--extra-label <str>]
          [--help-button] [--help-label <str>] [--help-status] [--help-tags]
          [--hfile <str>] [--hline <str>] [--ignore] [--input-fd <fd>]
          [--insecure] [--item-help] [--keep-tite] [--keep-window] [--last-key]
          [--max-input <n>] [--no-cancel] [--no-collapse] [--no-cr-wrap]
          [--no-items] [--no-kill] [--no-label <str>] [--no-lines] [--no-mouse]
          [--no-nl-expand] [--no-ok] [--no-shadow] [--no-tags] [--nook]
          [--ok-label <str>] [--output-fd <fd>] [--output-separator <str>]
          [--print-maxsize] [--print-size] [--print-version] [--quoted]
          [--scrollbar] [--separate-output] [--separate-widget <str>] [--shadow]
          [--single-quoted] [--size-err] [--sleep <secs>] [--stderr] [--stdout]
          [--tab-correct] [--tab-len <n>] [--time-format <str>] [--timeout <secs>]
          [--title <title>] [--trace <file>] [--trim] [--version] [--visit-items]
          [--week-start <str>] [--yes-label <str>]
          Box options:
          --buildlist <text> <height> <width> <list-height> <tag1> <item1> <status1>...
          --calendar <text> <height> <width> <day> <month> <year>
          --checklist <text> <height> <width> <list height> <tag1> <item1> <status1>...
          --dselect <directory> <height> <width>
          --editbox <file> <height> <width>
          --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>...
          --mixedform <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1> <itype>...
          --mixedgauge <text> <height> <width> <percent> <tag1> <item1>...
          --msgbox <text> <height> <width>
          --passwordbox <text> <height> <width> [<init>]
          --passwordform <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1>...
          --pause <text> <height> <width> <seconds>
          --prgbox <text> <command> <height> <width>
          --programbox <text> <height> <width>
          --progressbox <text> <height> <width>
          --radiolist <text> <height> <width> <list height> <tag1> <item1> <status1>...
          --rangebox <text> <height> <width> <min-value> <max-value> <default-value>
          --tailbox <file> <height> <width>
          --tailboxbg <file> <height> <width>
          --textbox <file> <height> <width>
          --timebox <text> <height> <width> <hour> <minute> <second>
          --treeview <text> <height> <width> <list-height> <tag1> <item1> <status1> <depth1>...
          --yesno <text> <height> <width>

          Auto-size with height and width = 0. Maximize with height and width = -1.
          Global-auto-size if also menu_height/list_height = 0.


          Further reading:



          • dialog

          • ncurses

          • Anaconda/Features/NoLoader

          • How to create GUIs (such as menuconfig) with lxdialog






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 13 '17 at 12:36









          Community♦

          1




          1










          answered May 26 '16 at 22:27









          Thomas Dickey

          50.6k588160




          50.6k588160




















              up vote
              11
              down vote













              I believe the package you are looking for is ncurses.



              Wikipedia describes ncurses as follows:




              ncurses (new curses) is a programming library providing an API that
              allows the programmer to write text-based user interfaces in a
              terminal-independent manner. It is a toolkit for developing "GUI-like"
              application software that runs under a terminal emulator




              It is widely used, for example, in the menuconfig kernel configuration tool:
              Screen shot of Linux kernel menuconfig tool



              Since you are using bash, you can use Bash Simple Curses (as mentioned by Runium in the comment below).






              share|improve this answer


















              • 11




                ncurses is a C-library. (If I understand correctly) OP wants a scripting environment (for bash). menuconfig is written in C. As an alternative to dialog, as per other answer, you could perhaps mention Bash Simple Curses which is written in bash (relying on tput).
                – Runium
                May 26 '16 at 22:23











              • @Runium: Thanks for the clarification and the link to Bash Simple Curses.
                – Thawn
                May 27 '16 at 6:09






              • 2




                still, it was useful to mention that ncurses is the basis of this, and it answers a more general version of the question... like the one in the title here :)
                – underscore_d
                May 28 '16 at 18:49














              up vote
              11
              down vote













              I believe the package you are looking for is ncurses.



              Wikipedia describes ncurses as follows:




              ncurses (new curses) is a programming library providing an API that
              allows the programmer to write text-based user interfaces in a
              terminal-independent manner. It is a toolkit for developing "GUI-like"
              application software that runs under a terminal emulator




              It is widely used, for example, in the menuconfig kernel configuration tool:
              Screen shot of Linux kernel menuconfig tool



              Since you are using bash, you can use Bash Simple Curses (as mentioned by Runium in the comment below).






              share|improve this answer


















              • 11




                ncurses is a C-library. (If I understand correctly) OP wants a scripting environment (for bash). menuconfig is written in C. As an alternative to dialog, as per other answer, you could perhaps mention Bash Simple Curses which is written in bash (relying on tput).
                – Runium
                May 26 '16 at 22:23











              • @Runium: Thanks for the clarification and the link to Bash Simple Curses.
                – Thawn
                May 27 '16 at 6:09






              • 2




                still, it was useful to mention that ncurses is the basis of this, and it answers a more general version of the question... like the one in the title here :)
                – underscore_d
                May 28 '16 at 18:49












              up vote
              11
              down vote










              up vote
              11
              down vote









              I believe the package you are looking for is ncurses.



              Wikipedia describes ncurses as follows:




              ncurses (new curses) is a programming library providing an API that
              allows the programmer to write text-based user interfaces in a
              terminal-independent manner. It is a toolkit for developing "GUI-like"
              application software that runs under a terminal emulator




              It is widely used, for example, in the menuconfig kernel configuration tool:
              Screen shot of Linux kernel menuconfig tool



              Since you are using bash, you can use Bash Simple Curses (as mentioned by Runium in the comment below).






              share|improve this answer














              I believe the package you are looking for is ncurses.



              Wikipedia describes ncurses as follows:




              ncurses (new curses) is a programming library providing an API that
              allows the programmer to write text-based user interfaces in a
              terminal-independent manner. It is a toolkit for developing "GUI-like"
              application software that runs under a terminal emulator




              It is widely used, for example, in the menuconfig kernel configuration tool:
              Screen shot of Linux kernel menuconfig tool



              Since you are using bash, you can use Bash Simple Curses (as mentioned by Runium in the comment below).







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited May 28 '16 at 0:12









              G-Man

              12k92860




              12k92860










              answered May 26 '16 at 21:51









              Thawn

              83839




              83839







              • 11




                ncurses is a C-library. (If I understand correctly) OP wants a scripting environment (for bash). menuconfig is written in C. As an alternative to dialog, as per other answer, you could perhaps mention Bash Simple Curses which is written in bash (relying on tput).
                – Runium
                May 26 '16 at 22:23











              • @Runium: Thanks for the clarification and the link to Bash Simple Curses.
                – Thawn
                May 27 '16 at 6:09






              • 2




                still, it was useful to mention that ncurses is the basis of this, and it answers a more general version of the question... like the one in the title here :)
                – underscore_d
                May 28 '16 at 18:49












              • 11




                ncurses is a C-library. (If I understand correctly) OP wants a scripting environment (for bash). menuconfig is written in C. As an alternative to dialog, as per other answer, you could perhaps mention Bash Simple Curses which is written in bash (relying on tput).
                – Runium
                May 26 '16 at 22:23











              • @Runium: Thanks for the clarification and the link to Bash Simple Curses.
                – Thawn
                May 27 '16 at 6:09






              • 2




                still, it was useful to mention that ncurses is the basis of this, and it answers a more general version of the question... like the one in the title here :)
                – underscore_d
                May 28 '16 at 18:49







              11




              11




              ncurses is a C-library. (If I understand correctly) OP wants a scripting environment (for bash). menuconfig is written in C. As an alternative to dialog, as per other answer, you could perhaps mention Bash Simple Curses which is written in bash (relying on tput).
              – Runium
              May 26 '16 at 22:23





              ncurses is a C-library. (If I understand correctly) OP wants a scripting environment (for bash). menuconfig is written in C. As an alternative to dialog, as per other answer, you could perhaps mention Bash Simple Curses which is written in bash (relying on tput).
              – Runium
              May 26 '16 at 22:23













              @Runium: Thanks for the clarification and the link to Bash Simple Curses.
              – Thawn
              May 27 '16 at 6:09




              @Runium: Thanks for the clarification and the link to Bash Simple Curses.
              – Thawn
              May 27 '16 at 6:09




              2




              2




              still, it was useful to mention that ncurses is the basis of this, and it answers a more general version of the question... like the one in the title here :)
              – underscore_d
              May 28 '16 at 18:49




              still, it was useful to mention that ncurses is the basis of this, and it answers a more general version of the question... like the one in the title here :)
              – underscore_d
              May 28 '16 at 18:49










              up vote
              0
              down vote













              zenity



              # var means variable

              var
              =$(
              zenity --entry
              --title="title"
              --text="text"
              --entry-text="entry text"
              )
              &&
              echo "$var"


              .



              # ls is a command to list files in a directory

              ls $(zenity --file-selection --directory)


              zenity dialog entry with options



              password=$(zenity --password)


              zenity --password)



              file="$(zenity --file-selection)"


              zenity --file-selection



              zenity --help


              zenity --help result



              zenity --help-general 


              zenity --help-general result



              zenity --help-entry


              zenity --help-entry result



              other graphical user interfaces (gui)



              dialog


              dialog



              dialog 
              --backtitle "backtitle"
              --title "title"
              --yesno
              "bla bla bla...nn Do you accept?"
              0 -1
              echo $?


              stops further execution of the script





              share
























                up vote
                0
                down vote













                zenity



                # var means variable

                var
                =$(
                zenity --entry
                --title="title"
                --text="text"
                --entry-text="entry text"
                )
                &&
                echo "$var"


                .



                # ls is a command to list files in a directory

                ls $(zenity --file-selection --directory)


                zenity dialog entry with options



                password=$(zenity --password)


                zenity --password)



                file="$(zenity --file-selection)"


                zenity --file-selection



                zenity --help


                zenity --help result



                zenity --help-general 


                zenity --help-general result



                zenity --help-entry


                zenity --help-entry result



                other graphical user interfaces (gui)



                dialog


                dialog



                dialog 
                --backtitle "backtitle"
                --title "title"
                --yesno
                "bla bla bla...nn Do you accept?"
                0 -1
                echo $?


                stops further execution of the script





                share






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  zenity



                  # var means variable

                  var
                  =$(
                  zenity --entry
                  --title="title"
                  --text="text"
                  --entry-text="entry text"
                  )
                  &&
                  echo "$var"


                  .



                  # ls is a command to list files in a directory

                  ls $(zenity --file-selection --directory)


                  zenity dialog entry with options



                  password=$(zenity --password)


                  zenity --password)



                  file="$(zenity --file-selection)"


                  zenity --file-selection



                  zenity --help


                  zenity --help result



                  zenity --help-general 


                  zenity --help-general result



                  zenity --help-entry


                  zenity --help-entry result



                  other graphical user interfaces (gui)



                  dialog


                  dialog



                  dialog 
                  --backtitle "backtitle"
                  --title "title"
                  --yesno
                  "bla bla bla...nn Do you accept?"
                  0 -1
                  echo $?


                  stops further execution of the script





                  share












                  zenity



                  # var means variable

                  var
                  =$(
                  zenity --entry
                  --title="title"
                  --text="text"
                  --entry-text="entry text"
                  )
                  &&
                  echo "$var"


                  .



                  # ls is a command to list files in a directory

                  ls $(zenity --file-selection --directory)


                  zenity dialog entry with options



                  password=$(zenity --password)


                  zenity --password)



                  file="$(zenity --file-selection)"


                  zenity --file-selection



                  zenity --help


                  zenity --help result



                  zenity --help-general 


                  zenity --help-general result



                  zenity --help-entry


                  zenity --help-entry result



                  other graphical user interfaces (gui)



                  dialog


                  dialog



                  dialog 
                  --backtitle "backtitle"
                  --title "title"
                  --yesno
                  "bla bla bla...nn Do you accept?"
                  0 -1
                  echo $?


                  stops further execution of the script






                  share











                  share


                  share










                  answered 3 mins ago









                  FireInTheSky

                  1392




                  1392



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f285777%2fhow-do-i-create-a-terminal-based-gui%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Displaying single band from multi-band raster using QGIS

                      How many registers does an x86_64 CPU actually have?