Post a Comment
It's a tool to show simple dialog boxes from the terminal. These tools have been around forever. Big deal.
The author uses it to pop up a message when his network-connection script runs. Seems he just realised that there's a world of desktop users out there too. Taking care to make your programs (shell scripts or otherwise) user-friendly, interactive and informative isn't newsworthy. Indeed, it should be compulsory.
Yes, what you say is true. But the problem is that to allow the user to work as he/she is used to may require quite a bit of work if you do it in any other way than zenity or kdialog.
Like, for instance, having him pick a date.
You can write a whole script and just use zenity to put up the user interactions with minimal work, and its all going to be very intuitive and normal for them.
Example at
http://www.linuxjournal.com/content/make-your-scripts-user-friendly...
What it means is, you can use shell scripts where otherwise you might be driven to a full blown gui language.
For KDE users there is kdialog. It has everything zenity has minus calender but plus many other things: --geticon, --getopenurl, --menu, --combobox, --password, --checklist, --radiolist etc.
In combination with kfmclient (or kioclient for KDE4) this is really handy. I use it from python, too. e.g.: http://kde-apps.org/content/show.php/Get+YouTube+Video+(improved)?content=41456
zenity (or kdialog or xdialog etc.) are all well and good, but your shell script should check for $DISPLAY and only run zenity if it's set. If it isn't set, each GUI dialog prompt/display will need the equivalent text-only prompts/output.
I'm about to do something similar myself with a text-only program I've written (in C - nothing wrong with system()'ing zenity from a binary - it's not just for shell scripts) - I'll be calling zenity for input and output, but only if $DISPLAY is set and /usr/bin/zenity is available (otherwise the old text input/output code will be used as a fallback).



