6 ms·
Yad: Create ad-hoc GTK GUIs from shell
- calvinmorrison 5y agozenity also does this. It can be useful to gather user data for scripts you don't run from the terminal (say a hotkey)
- jordemort 5y agoThis appears to allow you to build significantly more complex dialogs than zenity.
- jandrese 5y agoZenity is very limited in what it can do though. You slam into the limits with some pretty simple requirements. Plus it spits out an annoying warning about parentless modal dialogs every time you use it. 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.
- _emacsomancer_ 5y agoyad is an (old) fork of zenity
- marcodiego 5y agoQuick look at the examples: https://sanana.kiev.ua/index.php/yad https://sanana.kiev.ua/index.php/yad ... Looks like too much code. I think apple's Visual Format Language https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/AutolayoutPG/VisualFormatLanguage.html https://developer.apple.com/library/archive/documentation/Us... seems a better approach.
- PaulDavisThe1st 5y agoVFL uses a constraint-packing model, which is excellent for UIs that may be resized (can we all say "mobile" ?). 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.
- overgard 5y agoI think this is super impressive and super far into the realm of "oh my god please don't actually use this for anything real".
- jlg23 5y ago> "oh my god please don't actually use this for anything real" 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.
- overgard 5y agoA few reasons: - 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.
- _emacsomancer_ 5y agoBut you don't have to use Bash, you can use whatever you want.
- indigodaddy 5y agoYad has been around for a very long time. I was using it ~2010 to build system startup login dialogs for systems I was purposing as “thin clients”
- ducktective 5y agoYad is fantastic! Write the core of your app in bash/curl/jq, then write a thin wrapper to invoke yad so your app is presentable to non-techie people. Also see: https://wiki.gnome.org/Projects/Zenity https://wiki.gnome.org/Projects/Zenity (also gtk, less features, GNOME project) In KDE/Qt domain: https://github.com/KDE/kdialog https://github.com/KDE/kdialog https://github.com/luebking/qarma https://github.com/luebking/qarma
- jhgb 5y agoThere's also GTK-server: https://www.gtk-server.org https://www.gtk-server.org
- p4bl0 5y agoA long time ago when I was a student and elected at my university's board, I built an entire CMS system using zenity (an equivalent of Yad) because I wanted non-technical people (other elected students) to be able to update a static website easily. We only had static web space to publish the board's documents and our minutes of each of the boards reunion for other students. It even worked okay over ssh with -X (of course I created a clic-me launcher for the other they wouldn't open a terminal and ssh -X into the university's server). It was… kinda fun, in its own way.
- fwip 5y agoThis is nifty. Is there any similar tool that presents the UI as a web page, rather than a GTK gui?
- nsajko 5y agoGTK actually seems to be capable of this for many years, with its "Broadway" GDK backend: GTK4 docs: https://docs.gtk.org/gtk4/broadway.html https://docs.gtk.org/gtk4/broadway.html GTK3 docs: https://docs.gtk.org/gtk3/broadway.html https://docs.gtk.org/gtk3/broadway.html
- moondev 5y agoYou can run broadway inside a container as well. Yad could make an interesting entrypoint for it
- drran 5y agoNodeJS, PHP, Python, Perl? Write the WebUI in a separate HTML page, then start a server and listen for requests.
- stuaxo 5y agoThis really needs a few examples with screenshots.
- ducktective 5y agohttp://smokey01.com/yad/ http://smokey01.com/yad/ https://sourceforge.net/p/yad-dialog/wiki/Examples/ https://sourceforge.net/p/yad-dialog/wiki/Examples/
- dwheeler 5y agoI've used zenity to do the same kind of thing. If you're writing a simple shell script & need some simplistic local GUI interaction, zenity is great; it's easy to create / read / modify the code.
- amelius 5y agoSounds like something Tcl/Tk would be an appropriate tool for.
- mkj 5y agoTk seems stagnated, no hidpi in wayland for example?
- _emacsomancer_ 5y agoYad is great! It makes it easy to use a scripting language (bash, python, common lisp, etc.) and pretty quickly come up with a usable widgety thing. 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] [1]: https://gitlab.com/emacsomancer/vpnd https://gitlab.com/emacsomancer/vpnd [2]: https://gitlab.com/emacsomancer/volemad https://gitlab.com/emacsomancer/volemad