L
L
leonidpetrosian2019-10-28 19:57:15
Python
leonidpetrosian, 2019-10-28 19:57:15

How to make UI in Bash?

Good day!
Essence of the question:
There is a certain Python project that has reached such a size that it is no longer convenient to enter data line by line and / or into sysargs, but it has not matured enough to make a full-fledged GUI for it.
A simple UI in bash appears in my head. As a mini utility / program (as an example: the nano text editor)
Due to the low familiarity with bash (and maybe technical illiteracy), I don’t know which way to dig. Please give me direction!
Thank you all in advance!

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Sergey c0re, 2019-10-28
@leonidpetrosian

a quick duck search gives the answer right away - ui on bash !
Zenith !
and as it turned out, he (a) is still, and already, installed (in Linux Mint 18.3)
and everything is not simple, but very simple, here is an example of a window with a form:

zenity --forms --title="Add Friend" \
  --text="Enter information about your friend." \
  --separator="," \
  --add-entry="First Name" \
  --add-entry="Family Name" \
  --add-entry="Email" \
  --add-calendar="Birthday"

zenity-forms-screenshot.png
the result is returned to stdout in csv format.
see the Zenity UPD Guide : Whiptail for text based user interfaces (TUI) is also already on the system. Bash GUI Whiptail Menu Tutorial Part 1 Also see Glade videos on youtube - BASH Tutorial - Advanced GUI Interface

advmenu.gif

P
pfemidi, 2019-10-28
@pfemidi

Here is the direction:

[[email protected] ~]$ dnf info dialog
Last metadata expiration check: 0:00:30 ago on Mon 28 Oct 2019 08:02:00 PM MSK.
Available Packages
Name         : dialog
Version      : 1.3
Release      : 16.20180621.fc30
Architecture : i686
Size         : 234 k
Source       : dialog-1.3-16.20180621.fc30.src.rpm
Repository   : fedora
Summary      : A utility for creating TTY dialog boxes
URL          : https://invisible-island.net/dialog/dialog.html
License      : LGPLv2
Description  : Dialog is a utility that allows you to show dialog boxes (containing
             : questions or messages) in TTY (text mode) interfaces.  Dialog is called
             : from within a shell script.  The following dialog boxes are implemented:
             : yes/no, menu, input, message, text, info, checklist, radiolist, and
             : gauge.
             : 
             : Install dialog if you would like to create TTY dialog boxes.

[[email protected] ~]$

S
Sergey Gornostaev, 2019-10-28
@sergey-gornostaev

Bash is absolutely not designed for this. Even if something can be heaped on it, then in Python it is much faster and easier.

A
Alexey Kharchenko, 2019-10-29
@AVX

https://habr.com/en/post/126701/
I did something on kdialog - I liked it.

V
Vitaly Karasik, 2019-10-28
@vitaly_il1

I would make a config file - either just a text format like
xxx=123
or in fancy YAML

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question