0

I have a shell script which when executed asks user inputs and save it to a file and later it will create a docker container based on user inputs.

I have to create a simple GUI page with check boxes and text boxes to add their inputs. How can I achieve that. Can someone please help me.

  • See [Create bash script that allows you to choose multiple options instead of just one?](https://askubuntu.com/q/1106787/295286), [How to get dialog box input directed to a variable?](https://askubuntu.com/q/491509/295286), and [How can I easily create a GUI dialog with a bash script?](https://askubuntu.com/q/244672/295286) – Sergiy Kolodyazhnyy Jan 13 '19 at 10:31
  • My shell script is a distributive package which we ship to our customers. We cannot use tools other than the one that comes with OS installation, since the customer at their end may no have that tools installed. Can you please suggest some options that we useful for shipping the script with GUI installation page, while the customers executing it. – KarthiKeyan Jan 13 '19 at 10:44
  • 1
    `dialog` is one of the packages that come with Ubuntu, so it is included. Regarding other Debian-based systems - we do not address questions other than Ubuntu-related on this site. – Sergiy Kolodyazhnyy Jan 13 '19 at 10:52

1 Answers1

4

dialog

  • dialog provides a TUI, a text user interface, which works both in text mode and in terminal windows in graphical desktops.

  • dialog is in the repository 'universe', that is activated in Ubuntu when installed, but not in live or persistent live Ubuntu.

    • Necessary only in live or persistent live Ubuntu, run

      sudo add-apt-repository universe
      

      to activate it.

  • You can install dialog

    sudo apt update
    sudo apt install dialog
    

    and you can add these command lines into your shellscript, to make them run automatically, when a customer runs your shellscript. These commands need root privileges, which may be a problem, if you have customers who lack such privileges.

    Please notice that apt is used by Ubuntu and Debian (and linux distros based on Ubuntu or Debian). Other linux distros have different tools to install programs.

  • The current version in Ubuntu 18.04.1 LTS is dialog 1.3-20171209.

  • After installation you can see the on-line manual man dialog.

zenity

  • zenity provides a GUI, a graphical user interface, which works only in graphical desktops.

  • zenity is bundled with Ubuntu, you need not install it.

  • The current version in Ubuntu 18.04.1 LTS is zenity 3.28.1.
  • See also the on-line manual man zenity.

screenshots

dialog:

enter image description here

zenity:

enter image description here

sudodus
  • 45,126
  • 5
  • 87
  • 151