Yad: Create ad-hoc GTK GUIs from shell
github.com
github.com
Also see:
https://wiki.gnome.org/Projects/Zenity (also gtk, less features, GNOME project)
In KDE/Qt domain:
Dare do explain why? If all you need is a form to pop up and some way to save the data, this is probably the least steep learning curve for anyone who already has to work on a UNIX but is clueless about it.
- Now you can't use these shell scripts purely on the shell
- Bash is a terrible language for writing complex programs. If you actually are at the point where you need a GUI your program is complex enough that you should use a scripting language. It's going to be more maintainable, probably shorter. I don't really buy that bash is more accessible to non-programmer ops people. If you're getting to the point where you're writing a GUI, you are programming, you're just programming in a bad/slow language.
A couple of things I've made using it:
- vpnd: an update notifier for Void Linux, using Bash [1]
- volemad: a now 'deprecated' interface for Mullvad's wireguard, using Common Lisp [2]
I think apple's Visual Format Language https://developer.apple.com/library/archive/documentation/Us... seems a better approach.
It doesn't offer the same level of fine-grained control over the actual widgets, and tends to feel (in|less ) appropriate with fixed-sized windows.
Also, these are not really comparable examples. The Yad one shows the full interaction with the shell script; the VPL one shows merely how to construct the UI, but does not show any integration with the logic residing in a script.
GTK4 docs: https://docs.gtk.org/gtk4/broadway.html
GTK3 docs: https://docs.gtk.org/gtk3/broadway.html
Write the WebUI in a separate HTML page, then start a server and listen for requests.
That said I've used it quite a lot because it is installed by default. If you can't guarantee that anything has been installed on the system or that you have an Internet connection it is incredibly helpful to have a simple GUI system available to shell scripts by default.